Wed Nov 26 13:30:48 CST 2008 Pekka Pessi <first.last@nokia.com>
* outbound.c: silenced warnings wtf? xxx. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10825 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
253c81bb45
commit
f7c4b7ad7c
|
@ -1 +1 @@
|
||||||
Tue Dec 16 14:24:06 CST 2008
|
Tue Dec 16 14:28:36 CST 2008
|
||||||
|
|
|
@ -265,6 +265,10 @@ static nua_handle_t *make_auth_natted_register(
|
||||||
m = s2_wait_for_request(SIP_METHOD_REGISTER);
|
m = s2_wait_for_request(SIP_METHOD_REGISTER);
|
||||||
fail_if(!m);
|
fail_if(!m);
|
||||||
fail_if(!m->sip->sip_authorization);
|
fail_if(!m->sip->sip_authorization);
|
||||||
|
/* should not unregister the previous contact
|
||||||
|
* as it has not been successfully registered */
|
||||||
|
fail_if(!m->sip->sip_contact);
|
||||||
|
fail_if(m->sip->sip_contact->m_next);
|
||||||
s2_save_register(m);
|
s2_save_register(m);
|
||||||
|
|
||||||
s2_respond_to(m, NULL,
|
s2_respond_to(m, NULL,
|
||||||
|
|
|
@ -102,7 +102,7 @@ struct outbound {
|
||||||
/* The registration state machine. */
|
/* The registration state machine. */
|
||||||
/** Initial REGISTER containing ob_rcontact has been sent */
|
/** Initial REGISTER containing ob_rcontact has been sent */
|
||||||
unsigned ob_registering:1;
|
unsigned ob_registering:1;
|
||||||
/** 2XX response to REGISTER containg ob_rcontact has been received */
|
/** 2XX response to REGISTER containing ob_rcontact has been received */
|
||||||
unsigned ob_registered:1;
|
unsigned ob_registered:1;
|
||||||
/** The registration has been validated:
|
/** The registration has been validated:
|
||||||
* We have successfully sent OPTIONS to ourselves.
|
* We have successfully sent OPTIONS to ourselves.
|
||||||
|
@ -361,14 +361,6 @@ int outbound_get_contacts(outbound_t *ob,
|
||||||
if (ob) {
|
if (ob) {
|
||||||
if (ob->ob_contacts)
|
if (ob->ob_contacts)
|
||||||
*return_current_contact = ob->ob_rcontact;
|
*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_previous_contact = ob->ob_previous;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -403,20 +395,24 @@ int outbound_register_response(outbound_t *ob,
|
||||||
|
|
||||||
assert(request->sip_request); assert(response->sip_status);
|
assert(request->sip_request); assert(response->sip_status);
|
||||||
|
|
||||||
|
status = response->sip_status->st_status;
|
||||||
|
|
||||||
|
if (status < 300) {
|
||||||
|
if (request->sip_contact && response->sip_contact) {
|
||||||
|
if (ob->ob_rcontact != NULL)
|
||||||
|
msg_header_free(ob->ob_home, (msg_header_t *)ob->ob_rcontact);
|
||||||
|
ob->ob_rcontact = sip_contact_dup(ob->ob_home, request->sip_contact);
|
||||||
|
ob->ob_registered = ob->ob_registering;
|
||||||
|
} else
|
||||||
|
ob->ob_registered = 0;
|
||||||
|
}
|
||||||
|
|
||||||
reregister = outbound_check_for_nat(ob, request, response);
|
reregister = outbound_check_for_nat(ob, request, response);
|
||||||
if (reregister)
|
if (reregister)
|
||||||
return reregister;
|
return reregister;
|
||||||
|
|
||||||
status = response->sip_status->st_status;
|
if (ob->ob_previous && status < 300) {
|
||||||
|
msg_header_free(ob->ob_home, (void *)ob->ob_previous);
|
||||||
if (status < 300) {
|
|
||||||
if (request->sip_contact && response->sip_contact)
|
|
||||||
ob->ob_registered = ob->ob_registering;
|
|
||||||
else
|
|
||||||
ob->ob_registered = 0;
|
|
||||||
|
|
||||||
if (ob->ob_previous)
|
|
||||||
msg_header_free(ob->ob_home, (void *)ob->ob_previous);
|
|
||||||
ob->ob_previous = NULL;
|
ob->ob_previous = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1071,7 +1067,6 @@ int outbound_contacts_from_via(outbound_t *ob, sip_via_t const *via)
|
||||||
{
|
{
|
||||||
su_home_t *home = ob->ob_home;
|
su_home_t *home = ob->ob_home;
|
||||||
sip_contact_t *rcontact, *dcontact;
|
sip_contact_t *rcontact, *dcontact;
|
||||||
int reg_id = 0;
|
|
||||||
char reg_id_param[20] = "";
|
char reg_id_param[20] = "";
|
||||||
sip_contact_t *previous_previous, *previous_rcontact, *previous_dcontact;
|
sip_contact_t *previous_previous, *previous_rcontact, *previous_dcontact;
|
||||||
sip_via_t *v, v0[1], *previous_via;
|
sip_via_t *v, v0[1], *previous_via;
|
||||||
|
@ -1110,8 +1105,10 @@ int outbound_contacts_from_via(outbound_t *ob, sip_via_t const *via)
|
||||||
previous_dcontact = ob->ob_dcontact;
|
previous_dcontact = ob->ob_dcontact;
|
||||||
previous_via = ob->ob_via;
|
previous_via = ob->ob_via;
|
||||||
|
|
||||||
if (ob->ob_registering &&
|
if (ob->ob_registered
|
||||||
(reg_id == 0 || ob->ob_info.outbound < outbound_feature_supported))
|
/* && (ob->ob_reg_id == 0 || ob->ob_info.outbound < outbound_feature_supported)
|
||||||
|
* XXX - multiple connections not yet supported
|
||||||
|
*/)
|
||||||
previous_rcontact = NULL, ob->ob_previous = ob->ob_rcontact;
|
previous_rcontact = NULL, ob->ob_previous = ob->ob_rcontact;
|
||||||
else
|
else
|
||||||
previous_rcontact = ob->ob_rcontact, ob->ob_previous = NULL;
|
previous_rcontact = ob->ob_rcontact, ob->ob_previous = NULL;
|
||||||
|
|
Loading…
Reference in New Issue