]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add sip_local_network_addr var to see the ip of the sip profile a call came in or...
authorMichael Jerris <mike@jerris.com>
Tue, 23 Mar 2010 03:59:49 +0000 (03:59 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 23 Mar 2010 03:59:49 +0000 (03:59 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17073 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c

index 64af8643cf2b85c250e07d70806b5d58307b3ffc..348cb0282d067627aba91e62375799a27acebd30 100644 (file)
@@ -3320,6 +3320,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                }
        }
 
+       switch_channel_set_variable_printf(nchannel, "sip_local_network_addr", "%s", profile->extsipip ? profile->extsipip : profile->sipip);
        switch_channel_set_variable(nchannel, "sip_profile_name", profile_name);
 
        sofia_glue_get_user_host(switch_core_session_strdup(nsession, tech_pvt->dest), NULL, &tech_pvt->remote_ip);
index f0ea91b8bb880935a4a676c2d5ba86735363e0ac..528c31db1239ca1725a27e137c2f4250c36abf6c 100644 (file)
@@ -3644,6 +3644,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
 
                sofia_glue_get_addr(nua_current_request(nua), network_ip, sizeof(network_ip), &network_port);
 
+               switch_channel_set_variable_printf(channel, "sip_local_network_addr", "%s", profile->extsipip ? profile->extsipip : profile->sipip);
                switch_channel_set_variable(channel, "sip_reply_host", network_ip);
                switch_channel_set_variable_printf(channel, "sip_reply_port", "%d", network_port);
 
@@ -5909,6 +5910,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
 
        channel = tech_pvt->channel = switch_core_session_get_channel(session);
 
+       switch_channel_set_variable_printf(channel, "sip_local_network_addr", "%s", profile->extsipip ? profile->extsipip : profile->sipip);
        switch_channel_set_variable_printf(channel, "sip_network_ip", "%s", network_ip);
        switch_channel_set_variable_printf(channel, "sip_network_port", "%d", network_port);