Changeset 2179
- Timestamp:
- Jul 28, 2008 6:57:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r2039 r2179 1501 1501 } 1502 1502 1503 /* Update the target URI if this is a target refresh request. 1504 * We have passed the basic checking for the request, I think we 1505 * should update the target URI regardless of whether the request 1506 * is accepted or not (e.g. when re-INVITE is answered with 488, 1507 * we would still need to update the target URI, otherwise our 1508 * target URI would be wrong, wouldn't it). 1509 */ 1510 if (pjsip_method_creates_dialog(&rdata->msg_info.cseq->method)) { 1511 pjsip_contact_hdr *contact; 1512 1513 contact = (pjsip_contact_hdr*) 1514 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1515 NULL); 1516 if (contact && (dlg->remote.contact==NULL || 1517 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1518 dlg->remote.contact->uri, 1519 contact->uri))) 1520 { 1521 dlg->remote.contact = (pjsip_contact_hdr*) 1522 pjsip_hdr_clone(dlg->pool, contact); 1523 dlg->target = dlg->remote.contact->uri; 1524 } 1525 } 1526 1503 1527 /* Report the request to dialog usages. */ 1504 1528 for (i=0; i<dlg->usage_cnt; ++i) { … … 1690 1714 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1691 1715 NULL); 1692 if (contact) { 1716 if (contact && (dlg->remote.contact==NULL || 1717 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1718 dlg->remote.contact->uri, 1719 contact->uri))) 1720 { 1693 1721 dlg->remote.contact = (pjsip_contact_hdr*) 1694 1722 pjsip_hdr_clone(dlg->pool, contact); … … 1736 1764 PJSIP_H_CONTACT, 1737 1765 NULL); 1738 if (contact) { 1766 if (contact && (dlg->remote.contact==NULL || 1767 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1768 dlg->remote.contact->uri, 1769 contact->uri))) 1770 { 1739 1771 dlg->remote.contact = (pjsip_contact_hdr*) 1740 1772 pjsip_hdr_clone(dlg->pool, contact);
Note: See TracChangeset
for help on using the changeset viewer.