]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
auto-aleg-full and auto-aleg-domain for from_domain field in gateway
authorAnthony Minessale <anthm@freeswitch.org>
Sun, 3 Apr 2011 17:03:29 +0000 (12:03 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sun, 3 Apr 2011 17:03:29 +0000 (12:03 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index 507dcadd8d9bd666b469e73ccf913ad1110a330f..9af3963deeb2694b94faf31f52cbe9255a73897a 100644 (file)
@@ -4120,7 +4120,15 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                gateway_ptr->ob_calls++;
 
                if (!zstr(gateway_ptr->from_domain) && !switch_channel_get_variable(nchannel, "sip_invite_domain")) {
-                       if (!strcasecmp(gateway_ptr->from_domain, "auto-aleg")) {
+                       
+                       if (!strcasecmp(gateway_ptr->from_domain, "auto-aleg-full")) {
+                               const char *sip_full_from = switch_channel_get_variable(o_channel, "sip_full_from");
+                               
+                               if (!zstr(sip_full_from)) {
+                                       switch_channel_set_variable(nchannel, "sip_force_full_from", sip_full_from);
+                               }
+
+                       } else if (!strcasecmp(gateway_ptr->from_domain, "auto-aleg-domain")) {
                                const char *sip_from_host = switch_channel_get_variable(o_channel, "sip_from_host");
 
                                if (!zstr(sip_from_host)) {
index 7e16f8c01e9be7e9b532526c138c347580adb975..701b730fcce4ffd83a383d65cfb1162092fdb0de 100644 (file)
@@ -1893,6 +1893,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
        const char *invite_full_to = switch_channel_get_variable(tech_pvt->channel, "sip_invite_full_to");
        const char *handle_full_from = switch_channel_get_variable(tech_pvt->channel, "sip_handle_full_from");
        const char *handle_full_to = switch_channel_get_variable(tech_pvt->channel, "sip_handle_full_to");
+       const char *force_full_from = switch_channel_get_variable(tech_pvt->channel, "sip_force_full_from");
+       const char *force_full_to = switch_channel_get_variable(tech_pvt->channel, "sip_force_full_to");
        char *mp = NULL, *mp_type = NULL;
 
        rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
@@ -2125,6 +2127,15 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
                }
 
 
+               if (force_full_from) {
+                       from_str = (char *) force_full_from;
+               }
+
+               if (force_full_to) {
+                       to_str = (char *) force_full_to;
+               }
+
+
                if (invite_req_uri) {
                        url_str = (char *) invite_req_uri;
                }