]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9970: [mod_sofia] don't detect nat in cases when the contact is in the acl, but...
authorMike Jerris <mike@jerris.com>
Fri, 27 Jan 2017 21:13:18 +0000 (15:13 -0600)
committerMike Jerris <mike@jerris.com>
Fri, 27 Jan 2017 21:13:18 +0000 (15:13 -0600)
src/mod/endpoints/mod_sofia/sofia.c

index 8bd66b472a3500ec8ee64c81a5912df271e7e8e6..e9c157d5abf261273d33b6072c335923ab140c22 100644 (file)
@@ -10042,8 +10042,12 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
                char *last_acl = NULL;
                const char *contact_host = NULL;
 
-               if (sip && sip->sip_contact) {
-                       contact_host = sip->sip_contact->m_url->url_host;
+               if (sip) {
+                       if (sip->sip_via && sip->sip_via->v_host) {
+                               contact_host = sip->sip_via->v_host;
+                       } else if (sip->sip_contact) {
+                               contact_host = sip->sip_contact->m_url->url_host;
+                       }
                }
 
                if (!zstr(contact_host)) {