From 0882d4c087175e70a5a4b61265e39865e59f17e5 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 4 Mar 2009 18:19:30 +0000 Subject: [PATCH] MODENDP-195 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12409 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 9afedb164d..fafe68abd0 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1110,6 +1110,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) const char *call_id = NULL; char *route = NULL; char *route_uri = NULL; + char *sendto = NULL; rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER); @@ -1171,7 +1172,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) const char *invite_contact_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_contact_params"); const char *invite_from_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_from_params"); const char *from_var = switch_channel_get_variable(tech_pvt->channel, "sip_from_uri"); - + if (switch_strlen_zero(tech_pvt->dest)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "URL Error!\n"); return SWITCH_STATUS_FALSE; @@ -1422,6 +1423,10 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) route_uri = switch_core_session_strdup(session, val); route = NULL; } + + if ((val = switch_channel_get_variable(channel, "sip_network_destination"))) { + sendto = switch_core_session_strdup(session, val); + } if (route_uri) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Setting proxy route to %s\n", route_uri, switch_channel_get_name(channel)); @@ -1436,6 +1441,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_IF(route_uri, NUTAG_PROXY(route_uri)), TAG_IF(route, SIPTAG_ROUTE_STR(route)), + TAG_IF(!switch_strlen_zero(sendto), NTATAG_DEFAULT_PROXY(sendto)), SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_REUSE_REJECTED(1),