]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 14 Nov 2008 03:41:17 +0000 (03:41 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 14 Nov 2008 03:41:17 +0000 (03:41 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10397 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_glue.c

index 14c6cccd2651fcb6b6b96e3768f2ceb2cd40e280..f15ae3bce03860dcba9018c19d1a42b14ffe0159 100644 (file)
@@ -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;