[Freeswitch-svn] [commit] r13724 - freeswitch/trunk/src/mod/endpoints/mod_sofia
FreeSWITCH SVN
mikej at freeswitch.org
Tue Jun 9 09:33:33 PDT 2009
Author: mikej
Date: Tue Jun 9 11:33:33 2009
New Revision: 13724
Log:
strip_uri -> sofia_glue_strip_uri
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Tue Jun 9 11:33:33 2009
@@ -832,6 +832,7 @@
char * sofia_glue_find_parameter(const char *str, const char *param);
char *sofia_glue_create_via(switch_core_session_t *session, const char *ip, switch_port_t port, sofia_transport_t transport);
char *sofia_glue_create_external_via(switch_core_session_t *session, sofia_profile_t *profile, sofia_transport_t transport);
+char *sofia_glue_strip_uri(const char *str);
int sofia_glue_check_nat(sofia_profile_t *profile, const char *network_ip);
int sofia_glue_transport_has_tls(const sofia_transport_t tp);
const char *sofia_glue_get_unknown_header(sip_t const *sip, const char *name);
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Tue Jun 9 11:33:33 2009
@@ -844,6 +844,24 @@
}
}
+char *sofia_glue_strip_uri(const char *str)
+{
+ char *p;
+ char *r;
+
+ if ((p = strchr(str, '<'))) {
+ p++;
+ r = strdup(p);
+ if ((p = strchr(r, '>'))) {
+ *p = '\0';
+ }
+ } else {
+ r = strdup(str);
+ }
+
+ return r;
+}
+
int sofia_glue_check_nat(sofia_profile_t *profile, const char *network_ip)
{
return (network_ip &&
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c Tue Jun 9 11:33:33 2009
@@ -49,24 +49,6 @@
return 0;
}
-char *strip_uri(const char *str)
-{
- char *p;
- char *r;
-
- if ((p = strchr(str, '<'))) {
- p++;
- r = strdup(p);
- if ((p = strchr(r, '>'))) {
- *p = '\0';
- }
- } else {
- r = strdup(str);
- }
-
- return r;
-}
-
void sofia_sla_handle_register(nua_t *nua, sofia_profile_t *profile, sip_t const *sip, long exptime, const char *full_contact)
{
nua_handle_t *nh = NULL;
@@ -74,7 +56,7 @@
char my_contact[256] = "";
char *sql;
struct sla_helper sh = { { 0 } };
- char *contact_str = strip_uri(full_contact);
+ char *contact_str = sofia_glue_strip_uri(full_contact);
sofia_transport_t transport = sofia_glue_url2transport(sip->sip_contact->m_url);
char network_ip[80];
int network_port = 0;
@@ -235,7 +217,7 @@
char *full_contact = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_contact);
time_t expires = switch_epoch_time_now(NULL);
char *sql;
- char *contact_str = strip_uri(full_contact);
+ char *contact_str = sofia_glue_strip_uri(full_contact);
if (sip && sip->sip_expires) {
expires += sip->sip_expires->ex_delta + 30;
More information about the Freeswitch-svn
mailing list