mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Multiple revisions 410509-410510
........ r410509 | file | 2014-03-13 06:23:14 -0700 (Thu, 13 Mar 2014) | 2 lines res_pjsip_multihomed: Fix a bug where the 200 OK for a REGISTER would contain the wrong contact. ........ r410510 | file | 2014-03-13 06:24:17 -0700 (Thu, 13 Mar 2014) | 2 lines res_pjsip_multihomed: Remove change for testing fix. ........ Merged revisions 410509-410510 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -87,7 +87,7 @@ static pj_status_t multihomed_on_tx_message(pjsip_tx_data *tdata)
|
|||||||
{
|
{
|
||||||
pjsip_tpmgr_fla2_param prm;
|
pjsip_tpmgr_fla2_param prm;
|
||||||
pjsip_transport *transport;
|
pjsip_transport *transport;
|
||||||
pjsip_contact_hdr *contact;
|
pjsip_cseq_hdr *cseq;
|
||||||
pjsip_via_hdr *via;
|
pjsip_via_hdr *via;
|
||||||
|
|
||||||
/* Use the destination information to determine what local interface this message will go out on */
|
/* Use the destination information to determine what local interface this message will go out on */
|
||||||
@@ -111,15 +111,18 @@ static pj_status_t multihomed_on_tx_message(pjsip_tx_data *tdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If the message needs to be updated with new address do so */
|
/* If the message needs to be updated with new address do so */
|
||||||
contact = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL);
|
if (tdata->msg->type == PJSIP_REQUEST_MSG || !(cseq = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL)) ||
|
||||||
if (contact && (PJSIP_URI_SCHEME_IS_SIP(contact->uri) || PJSIP_URI_SCHEME_IS_SIPS(contact->uri))) {
|
pj_strcmp2(&cseq->method.name, "REGISTER")) {
|
||||||
pjsip_sip_uri *uri = pjsip_uri_get_uri(contact->uri);
|
pjsip_contact_hdr *contact = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL);
|
||||||
|
if (contact && (PJSIP_URI_SCHEME_IS_SIP(contact->uri) || PJSIP_URI_SCHEME_IS_SIPS(contact->uri))) {
|
||||||
|
pjsip_sip_uri *uri = pjsip_uri_get_uri(contact->uri);
|
||||||
|
|
||||||
/* prm.ret_addr is allocated from the tdata pool so it is perfectly fine to just do an assignment like this */
|
/* prm.ret_addr is allocated from the tdata pool so it is perfectly fine to just do an assignment like this */
|
||||||
pj_strassign(&uri->host, &prm.ret_addr);
|
pj_strassign(&uri->host, &prm.ret_addr);
|
||||||
uri->port = prm.ret_port;
|
uri->port = prm.ret_port;
|
||||||
|
|
||||||
pjsip_tx_data_invalidate_msg(tdata);
|
pjsip_tx_data_invalidate_msg(tdata);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdata->msg->type == PJSIP_REQUEST_MSG && (via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL))) {
|
if (tdata->msg->type == PJSIP_REQUEST_MSG && (via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL))) {
|
||||||
|
Reference in New Issue
Block a user