From 2c1a25d5f8bfa779b7cee8f3ca3b130222d21363 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 1 Mar 2014 04:42:16 +0500 Subject: [PATCH] add sip_force_nat_mode so you can engange nat mode manually --- src/mod/endpoints/mod_sofia/mod_sofia.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 9f6f0643ef..43ec0df24d 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1200,6 +1200,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);