提交 cab02bbc authored 作者: Anthony Minessale's avatar Anthony Minessale

fix logic determining which ip to use in contact on re-invites in recovery…

fix logic determining which ip to use in contact on re-invites in recovery situations or when remote ip is unknown
上级 e518bb95
...@@ -2109,14 +2109,14 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) ...@@ -2109,14 +2109,14 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
if (zstr(tech_pvt->invite_contact)) { if (zstr(tech_pvt->invite_contact)) {
const char *contact; const char *contact;
if ((contact = switch_channel_get_variable(channel, "sip_contact_user"))) { if ((contact = switch_channel_get_variable(channel, "sip_contact_user"))) {
char *ip_addr; char *ip_addr = tech_pvt->profile->sipip;
char *ipv6; char *ipv6;
if (!zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) { if ( ( tech_pvt->profile->extsipip && !zstr(tech_pvt->remote_ip) ) &&
ip_addr = (switch_check_network_list_ip(tech_pvt->remote_ip, tech_pvt->profile->local_network)) ( sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip) ||
? tech_pvt->profile->sipip : tech_pvt->profile->extsipip; switch_check_network_list_ip(tech_pvt->remote_ip, tech_pvt->profile->local_network)
} else { ) ) {
ip_addr = tech_pvt->profile->extsipip ? tech_pvt->profile->extsipip : tech_pvt->profile->sipip; ip_addr = tech_pvt->profile->extsipip;
} }
ipv6 = strchr(ip_addr, ':'); ipv6 = strchr(ip_addr, ':');
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论