]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add sip_force_nat_mode so you can engange nat mode manually
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 28 Feb 2014 23:42:16 +0000 (04:42 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 28 Feb 2014 23:43:18 +0000 (04:43 +0500)
src/mod/endpoints/mod_sofia/mod_sofia.c

index e230397b72ec205d66684d3f73b9922961a5b055..bb73d37b3b50a260a79e765727ef74369786744f 100644 (file)
@@ -1895,6 +1895,12 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        const char *presence_id = switch_channel_get_variable(channel, "presence_id");
 
 
+                       if ((var = switch_channel_get_variable(channel, "sip_force_nat_mode")) && switch_true(var)) {
+                               sofia_set_flag(tech_pvt, TFLAG_NAT);
+                               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Setting NAT mode based on manual variable\n");
+                               switch_channel_set_variable(channel, "sip_nat_detected", "true");
+                       }
+
                        if ((var = switch_channel_get_variable(channel, "sip_enable_soa"))) {
                                if (switch_true(var)) {
                                        sofia_set_flag(tech_pvt, TFLAG_ENABLE_SOA);