From 8eb03e0895f9847b5bd64b7d42730103e0f8ef8f Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 9 May 2008 17:47:20 +0000 Subject: [PATCH] Wed May 7 15:54:41 EDT 2008 Pekka Pessi * outbound.c: fix sofia-sip.org bug #1930055 If the initial REGISTER was not challenged, the natted contact did not get unregistered. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8338 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/nua/outbound.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index bf08cb30bb..766f924c79 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Fri May 9 13:46:29 EDT 2008 +Fri May 9 13:47:15 EDT 2008 diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c b/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c index 1d2244e5cf..6778662b6d 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c @@ -97,7 +97,7 @@ struct outbound { /** Source of Contact header */ unsigned ob_by_stack:1; /** Self-generated contacts */ - unsigned ob_contacts:1, :0; + unsigned ob_contacts:1; /* The registration state machine. */ /** Initial REGISTER containing ob_rcontact has been sent */ @@ -336,6 +336,14 @@ int outbound_get_contacts(outbound_t *ob, if (ob) { if (ob->ob_contacts) *return_current_contact = ob->ob_rcontact; + else { + sip_contact_t *contact = *return_current_contact; + if (contact) { + if (ob->ob_rcontact) + msg_header_free_all(ob->ob_home, (msg_header_t*)ob->ob_rcontact); + ob->ob_rcontact = sip_contact_dup(ob->ob_home, contact); + } + } *return_previous_contact = ob->ob_previous; } return 0;