From 675b65239c544cab6e7b00264d2161bb1ac21c0d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 14 Nov 2008 03:41:17 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10397 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 14c6cccd26..f15ae3bce0 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1089,6 +1089,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) const char *priv = "off"; const char *screen = "no"; const char *invite_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_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"); @@ -1103,7 +1104,13 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) url_str = url; - if (!switch_strlen_zero(tech_pvt->gateway_from_str)) { + if (from_var) { + if (strncasecmp(from_var, "sip:", 4) || strncasecmp(from_var, "sips:", 5)) { + use_from_str = switch_core_session_strdup(tech_pvt->session, from_var); + } else { + use_from_str = switch_core_session_sprintf(tech_pvt->session, "sip:%s", from_var); + } + } else if (!switch_strlen_zero(tech_pvt->gateway_from_str)) { use_from_str = tech_pvt->gateway_from_str; } else { use_from_str = tech_pvt->from_str;