clean up nat stuff more

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8395 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-05-14 14:13:40 +00:00
parent 52a44f87e0
commit 1a43d04045
4 changed files with 24 additions and 6 deletions
+5
View File
@@ -2727,10 +2727,14 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
tech_pvt->remote_port = network_port;
if (sip->sip_contact && sip->sip_contact->m_url) {
char tmp[35] = "";
tech_pvt->record_route = switch_core_session_sprintf(session, "sip:%s@%s:%d",
sip->sip_contact->m_url->url_user,
tech_pvt->remote_ip,
tech_pvt->remote_port);
switch_channel_set_variable(channel, "sip_received_ip", tech_pvt->remote_ip);
snprintf(tmp, sizeof(tmp), "tech_pvt->remote_port");
switch_channel_set_variable(channel, "sip_received_port", tmp);
}
if (*key != '\0') {
@@ -3168,6 +3172,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
if (ok) {
switch_set_flag(tech_pvt, TFLAG_NAT);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setting NAT mode based on acl %s\n", last_acl);
switch_channel_set_variable(channel, "sip_nat_detected", "true");
}
}
}