Commit 44967b46 authored by Pekka Pessi's avatar Pekka Pessi

outbound.c: fix sofia-sip.org bug #1930055

If the initial REGISTER was not challenged, the natted contact did not get
unregistered.

darcs-hash:20080507195441-db55f-1cc5a443a06bc6254d912aae41dfabf40ee4a231.gz
parent 242357bd
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment