]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add sip_recovery_break_rfc variable to set globally or per channel to not reverse...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 29 Jun 2012 19:41:02 +0000 (14:41 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 29 Jun 2012 19:41:06 +0000 (14:41 -0500)
src/mod/endpoints/mod_sofia/sofia_glue.c

index b08d7efc1722808f35b63b5278e345790b03bdf6..68763cd452a8a835716954f2e047f74b0fb63852 100644 (file)
@@ -5764,6 +5764,8 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
                switch_channel_set_variable(channel, "sip_handle_full_to", switch_channel_get_variable(channel, "sip_full_to"));
        } else {
                
+               int break_rfc = switch_true(switch_channel_get_variable(channel, "sip_recovery_break_rfc"));
+
                tech_pvt->redirected = switch_core_session_sprintf(session, "sip:%s", switch_channel_get_variable(channel, "sip_contact_uri"));
 
                if (zstr(rr)) {
@@ -5776,11 +5778,11 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
                tech_pvt->dest = switch_core_session_sprintf(session, "sip:%s", switch_channel_get_variable(channel, "sip_from_uri"));
 
                if (!switch_channel_get_variable_dup(channel, "sip_handle_full_from", SWITCH_FALSE, -1)) {
-                       switch_channel_set_variable(channel, "sip_handle_full_from", switch_channel_get_variable(channel, "sip_full_to"));
+                       switch_channel_set_variable(channel, "sip_handle_full_from", switch_channel_get_variable(channel, break_rfc ? "sip_full_from" : "sip_full_to"));
                }
 
                if (!switch_channel_get_variable_dup(channel, "sip_handle_full_to", SWITCH_FALSE, -1)) {
-                       switch_channel_set_variable(channel, "sip_handle_full_to", switch_channel_get_variable(channel, "sip_full_from"));
+                       switch_channel_set_variable(channel, "sip_handle_full_to", switch_channel_get_variable(channel, break_rfc ? "sip_full_to" : "sip_full_from"));
                }
        }