[Freeswitch-svn] [commit] r6803 - freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
stkn at freeswitch.org
Fri Dec 14 20:39:11 EST 2007
Author: stkn
Date: Fri Dec 14 20:39:11 2007
New Revision: 6803
Modified:
freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
Log:
Cleanup, sips: scheme is only needed for tls_bindurl, so remove everything we do not need anymore related to that
Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Fri Dec 14 20:39:11 2007
@@ -544,6 +544,5 @@
sofia_transport_t sofia_glue_url2transport(const url_t *url);
const char *sofia_glue_transport2str(const sofia_transport_t tp);
-const char *sofia_glue_transport2scheme(const sofia_transport_t tp);
int sofia_glue_transport_has_tls(const sofia_transport_t tp);
Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia.c Fri Dec 14 20:39:11 2007
@@ -1080,10 +1080,10 @@
}
if (profile->extsipip) {
- profile->tls_url = switch_core_sprintf(profile->pool, "sips:mod_sofia@%s:%d", profile->extsipip, profile->tls_sip_port);
+ profile->tls_url = switch_core_sprintf(profile->pool, "sip:mod_sofia@%s:%d", profile->extsipip, profile->tls_sip_port);
profile->tls_bindurl = switch_core_sprintf(profile->pool, "sips:mod_sofia@%s:%d;maddr=%s", profile->extsipip, profile->tls_sip_port, profile->sipip);
} else {
- profile->tls_url = switch_core_sprintf(profile->pool, "sips:mod_sofia@%s:%d", profile->sipip, profile->tls_sip_port);
+ profile->tls_url = switch_core_sprintf(profile->pool, "sip:mod_sofia@%s:%d", profile->sipip, profile->tls_sip_port);
profile->tls_bindurl = switch_core_sprintf(profile->pool, "sips:mod_sofia@%s:%d", profile->sipip, profile->tls_sip_port);
}
@@ -2050,8 +2050,8 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Components: \"%s\" \"%s\" \"%d\"\n", host, user, port);
- tech_pvt->to_uri = switch_core_session_sprintf(session, "%s:%s@%s:%d;transport=%s",
- sofia_glue_transport2scheme(transport), host, user, port, sofia_glue_transport2str(transport));
+ tech_pvt->to_uri = switch_core_session_sprintf(session, "sip:%s@%s:%d;transport=%s",
+ user, host, port, sofia_glue_transport2str(transport));
if (profile->ndlb & PFLAG_NDLB_TO_IN_200_CONTACT) {
if (strchr(tech_pvt->to_uri, '>')) {
Modified: freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/branches/stkn/sofia-exp/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Fri Dec 14 20:39:11 2007
@@ -543,48 +543,6 @@
return SOFIA_TRANSPORT_UNKNOWN;
}
-#if 0
-sofia_transport_t sofia_glue_uri2transport(const char *uri)
-{
- char *scheme = NULL, *transport = NULL;
- int tls = 0;
-
- if ((scheme = strchr(uri, '<'))) {
- scheme++;
- } else {
- scheme = (char *)uri;
- }
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "scheme: %s\n", scheme);
-
- if (!strncasecmp(scheme, "sips", 4)) {
- tls = 1;
- }
-
- if (!(transport = strchr(uri, ';'))) {
- return (tls) ? SOFIA_TRANSPORT_TCP_TLS : SOFIA_TRANSPORT_UDP;
- } else {
- transport = strchr(transport, '=');
- if (transport)
- transport++;
- }
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "transport: %s\n", transport);
-
- if (!strncasecmp(transport, "tls", 3)) {
- return SOFIA_TRANSPORT_TCP_TLS;
- }
- else if (!strncasecmp(transport, "tcp", 3)) {
- return (tls) ? SOFIA_TRANSPORT_TCP_TLS : SOFIA_TRANSPORT_TCP;
- }
- else if (!strncasecmp(transport, "sctp", 4)) {
- return SOFIA_TRANSPORT_SCTP;
- }
-
- return (tls) ? SOFIA_TRANSPORT_TCP_TLS : SOFIA_TRANSPORT_UDP;
-}
-#endif
-
const char *sofia_glue_transport2str(const sofia_transport_t tp)
{
switch(tp) {
@@ -602,17 +560,6 @@
}
}
-const char *sofia_glue_transport2scheme(const sofia_transport_t tp)
-{
- switch (tp) {
- case SOFIA_TRANSPORT_TCP_TLS:
- return "sips";
-
- default:
- return "sip";
- }
-}
-
int sofia_glue_transport_has_tls(const sofia_transport_t tp)
{
switch(tp) {
@@ -631,20 +578,14 @@
stripped = sofia_glue_get_url_from_contact(stripped, 0);
if (transport && transport != SOFIA_TRANSPORT_UDP) {
- const char *scheme = sofia_glue_transport2scheme(transport);
- char *tmp;
-
- if ((tmp = strchr(stripped, ':')) != NULL) {
- stripped = ++tmp;
- }
if (switch_stristr("port=", stripped)) {
- new_uri = switch_core_session_sprintf(session, "%s%s:%s%s", uri_only ? "" : "<", scheme, stripped, uri_only ? "" : ">");
+ new_uri = switch_core_session_sprintf(session, "%s%s%s", uri_only ? "" : "<", stripped, uri_only ? "" : ">");
} else {
if (strchr(stripped, ';')) {
- new_uri = switch_core_session_sprintf(session, "%s%s:%s&transport=%s%s", uri_only ? "" : "<", scheme, stripped, sofia_glue_transport2str(transport), uri_only ? "" : ">");
+ new_uri = switch_core_session_sprintf(session, "%s%s&transport=%s%s", uri_only ? "" : "<", stripped, sofia_glue_transport2str(transport), uri_only ? "" : ">");
} else {
- new_uri = switch_core_session_sprintf(session, "%s%s:%s;transport=%s%s", uri_only ? "" : "<", scheme, stripped, sofia_glue_transport2str(transport), uri_only ? "" : ">");
+ new_uri = switch_core_session_sprintf(session, "%s%s;transport=%s%s", uri_only ? "" : "<", stripped, sofia_glue_transport2str(transport), uri_only ? "" : ">");
}
}
} else {
More information about the Freeswitch-svn
mailing list