From 7b28994121b820e24c48e80c11ff5149f16245d3 Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 3 Jan 2011 10:44:28 -0600 Subject: [PATCH] FS-502: gateway not identified when extension-in-contact is set --- src/mod/endpoints/mod_sofia/sofia.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 94eab68858..9e412bbbb7 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -6844,11 +6844,19 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ if (sip->sip_request->rq_url->url_params) { - gw_name = sofia_glue_find_parameter(sip->sip_request->rq_url->url_params, "gw="); + gw_name = sofia_glue_find_parameter_value(session, sip->sip_request->rq_url->url_params, "gw="); } if (strstr(destination_number, "gw+")) { - gw_name = destination_number + 3; + if (sofia_test_pflag(profile, PFLAG_FULL_ID)) { + char *tmp; + gw_name = switch_core_session_strdup(session, destination_number + 3); + if ((tmp = strchr(gw_name, '@'))) { + *tmp = '\0'; + } + } else { + gw_name = destination_number + 3; + } } if (gw_name) {