From: Brian West Date: Fri, 10 Oct 2008 01:06:03 +0000 (+0000) Subject: add sip_via_protocol variable and cleanup code X-Git-Tag: v1.0.2~883 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c35e3cd4a5d5f654ed9e2a5e532cd9c5316b414;p=thirdparty%2Ffreeswitch.git add sip_via_protocol variable and cleanup code git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9923 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 2846e9bcbf..ae749bce93 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -3519,6 +3519,10 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ switch_channel_set_variable(channel, "sip_received_port", tmp); } + if (sip->sip_via) { + switch_channel_set_variable(channel, "sip_via_protocol", sofia_glue_transport2str(sofia_glue_via2transport(sip->sip_via))); + } + if (*key != '\0') { tech_pvt->key = switch_core_session_strdup(session, key); } diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 12fe6aadcb..0d57bb22b7 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -676,15 +676,10 @@ sofia_transport_t sofia_glue_url2transport(const url_t *url) sofia_transport_t sofia_glue_via2transport(const sip_via_t *via) { char *ptr = NULL; - int tls = 0; if (!via || !via->v_protocol) return SOFIA_TRANSPORT_UNKNOWN; - if (!strncasecmp(via->v_protocol, "sips", 4)) { - tls++; - } - if ((ptr = strrchr(via->v_protocol, '/'))) { ptr++;