]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
use register contact to determine proper contact in 200 ok response to register
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 30 Jul 2011 02:55:52 +0000 (21:55 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 30 Jul 2011 02:55:52 +0000 (21:55 -0500)
src/mod/endpoints/mod_sofia/sofia_reg.c

index 88c5dd4ec6515bd767bac7a796eb452adcc80fb4..520b4e68497982daf51b85274a1db0a019344c5d 100644 (file)
@@ -1831,8 +1831,17 @@ void sofia_reg_handle_sip_r_register(int status,
                                const char *new_expires;
                                uint32_t expi;
                                if (contact->m_next) {
-                                       const char *sipip = profile->extsipip ? profile->extsipip : profile->sipip;
-                                       for (; contact && strcasecmp(contact->m_url->url_host, sipip); contact = contact->m_next);
+                                       char *full;
+
+                                       for (; contact; contact = contact->m_next) {
+                                               if ((full = sip_header_as_string(nh->nh_home, (void *) contact))) {
+                                                       if (switch_stristr(sofia_private->gateway->register_contact, full)) {
+                                                               break;
+                                                       }
+
+                                                       su_free(nh->nh_home, full);
+                                               }
+                                       }
                                }
 
                                if (!contact) {