Changeset 4728 for pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
- Timestamp:
- Feb 4, 2014 10:13:56 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r4208 r4728 1 1 /* $Id$ */ 2 /* 2 /* 3 3 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) 4 4 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> … … 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 20 #include <pjsip/sip_dialog.h> … … 74 74 return PJ_EINVALIDOP; 75 75 76 pool = pjsip_endpt_create_pool(endpt, "dlg%p", 77 PJSIP_POOL_LEN_DIALOG, 76 pool = pjsip_endpt_create_pool(endpt, "dlg%p", 77 PJSIP_POOL_LEN_DIALOG, 78 78 PJSIP_POOL_INC_DIALOG); 79 79 if (!pool) … … 195 195 dlg->local.info = pjsip_from_hdr_create(dlg->pool); 196 196 pj_strdup_with_null(dlg->pool, &dlg->local.info_str, local_uri); 197 dlg->local.info->uri = pjsip_parse_uri(dlg->pool, 198 dlg->local.info_str.ptr, 197 dlg->local.info->uri = pjsip_parse_uri(dlg->pool, 198 dlg->local.info_str.ptr, 199 199 dlg->local.info_str.slen, 0); 200 200 if (!dlg->local.info->uri) { … … 215 215 216 216 /* Init local contact. */ 217 pj_strdup_with_null(dlg->pool, &tmp, 217 pj_strdup_with_null(dlg->pool, &tmp, 218 218 local_contact ? local_contact : local_uri); 219 219 dlg->local.contact = (pjsip_contact_hdr*) 220 pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr, 220 pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr, 221 221 tmp.slen, NULL); 222 222 if (!dlg->local.contact) { … … 228 228 dlg->remote.info = pjsip_to_hdr_create(dlg->pool); 229 229 pj_strdup_with_null(dlg->pool, &dlg->remote.info_str, remote_uri); 230 dlg->remote.info->uri = pjsip_parse_uri(dlg->pool, 231 dlg->remote.info_str.ptr, 230 dlg->remote.info->uri = pjsip_parse_uri(dlg->pool, 231 dlg->remote.info_str.ptr, 232 232 dlg->remote.info_str.slen, 0); 233 233 if (!dlg->remote.info->uri) { … … 240 240 PJSIP_URI_SCHEME_IS_SIPS(dlg->remote.info->uri)) 241 241 { 242 pjsip_sip_uri *sip_uri = (pjsip_sip_uri *) 242 pjsip_sip_uri *sip_uri = (pjsip_sip_uri *) 243 243 pjsip_uri_get_uri(dlg->remote.info->uri); 244 244 if (!pj_list_empty(&sip_uri->header_param)) { … … 249 249 250 250 /* Print URI */ 251 tmp.ptr = (char*) pj_pool_alloc(dlg->pool, 251 tmp.ptr = (char*) pj_pool_alloc(dlg->pool, 252 252 dlg->remote.info_str.slen); 253 253 tmp.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 254 sip_uri, tmp.ptr, 254 sip_uri, tmp.ptr, 255 255 dlg->remote.info_str.slen); 256 256 … … 283 283 284 284 /* Init client authentication session. */ 285 status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt, 285 status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt, 286 286 dlg->pool, 0); 287 287 if (status != PJ_SUCCESS) … … 333 333 PJSIP_ENOTREQUESTMSG); 334 334 335 /* Request must not have To tag. 335 /* Request must not have To tag. 336 336 * This should have been checked in the user agent (or application?). 337 337 */ 338 338 PJ_ASSERT_RETURN(rdata->msg_info.to->tag.slen == 0, PJ_EINVALIDOP); 339 339 340 340 /* The request must be a dialog establishing request. */ 341 341 PJ_ASSERT_RETURN( … … 385 385 /* TODO: 386 386 * Section 12.1.1, paragraph about using SIPS URI in Contact. 387 * If the request that initiated the dialog contained a SIPS URI 388 * in the Request-URI or in the top Record-Route header field value, 389 * if there was any, or the Contact header field if there was no 387 * If the request that initiated the dialog contained a SIPS URI 388 * in the Request-URI or in the top Record-Route header field value, 389 * if there was any, or the Contact header field if there was no 390 390 * Record-Route header field, the Contact header field in the response 391 391 * MUST be a SIPS URI. … … 396 396 pj_strdup_with_null(dlg->pool, &tmp, contact); 397 397 dlg->local.contact = (pjsip_contact_hdr*) 398 pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr, 398 pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr, 399 399 tmp.slen, NULL); 400 400 if (!dlg->local.contact) { … … 409 409 410 410 /* Init remote info from the From header. */ 411 dlg->remote.info = (pjsip_fromto_hdr*) 411 dlg->remote.info = (pjsip_fromto_hdr*) 412 412 pjsip_hdr_clone(dlg->pool, rdata->msg_info.from); 413 413 pjsip_fromto_hdr_set_to(dlg->remote.info); … … 426 426 427 427 428 /* Init remote's contact from Contact header. 428 /* Init remote's contact from Contact header. 429 429 * Iterate the Contact URI until we find sip: or sips: scheme. 430 430 */ … … 452 452 } 453 453 454 dlg->remote.contact = (pjsip_contact_hdr*) 454 dlg->remote.contact = (pjsip_contact_hdr*) 455 455 pjsip_hdr_clone(dlg->pool, (pjsip_hdr*)contact_hdr); 456 456 … … 464 464 dlg->role = PJSIP_ROLE_UAS; 465 465 466 /* Secure? 466 /* Secure? 467 467 * RFC 3261 Section 12.1.1: 468 * If the request arrived over TLS, and the Request-URI contained a 468 * If the request arrived over TLS, and the Request-URI contained a 469 469 * SIPS URI, the 'secure' flag is set to TRUE. 470 470 */ … … 473 473 474 474 /* Call-ID */ 475 dlg->call_id = (pjsip_cid_hdr*) 475 dlg->call_id = (pjsip_cid_hdr*) 476 476 pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid); 477 477 478 /* Route set. 478 /* Route set. 479 479 * RFC 3261 Section 12.1.1: 480 * The route set MUST be set to the list of URIs in the Record-Route 481 * header field from the request, taken in order and preserving all URI 480 * The route set MUST be set to the list of URIs in the Record-Route 481 * header field from the request, taken in order and preserving all URI 482 482 * parameters. If no Record-Route header field is present in the request, 483 483 * the route set MUST be set to the empty set. … … 499 499 if (rr == (void*)&rdata->msg_info.msg->hdr) 500 500 break; 501 rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg, 501 rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg, 502 502 PJSIP_H_RECORD_ROUTE, rr); 503 503 } … … 621 621 /* Check arguments. */ 622 622 PJ_ASSERT_RETURN(first_dlg && rdata && new_dlg, PJ_EINVAL); 623 623 624 624 /* rdata must be response message. */ 625 625 PJ_ASSERT_RETURN(msg->type == PJSIP_RESPONSE_MSG, … … 649 649 650 650 /* Clone local info. */ 651 dlg->local.info = (pjsip_fromto_hdr*) 651 dlg->local.info = (pjsip_fromto_hdr*) 652 652 pjsip_hdr_clone(dlg->pool, first_dlg->local.info); 653 653 … … 661 661 662 662 /* Clone local Contact. */ 663 dlg->local.contact = (pjsip_contact_hdr*) 663 dlg->local.contact = (pjsip_contact_hdr*) 664 664 pjsip_hdr_clone(dlg->pool, first_dlg->local.contact); 665 665 666 666 /* Clone remote info. */ 667 dlg->remote.info = (pjsip_fromto_hdr*) 667 dlg->remote.info = (pjsip_fromto_hdr*) 668 668 pjsip_hdr_clone(dlg->pool, first_dlg->remote.info); 669 669 … … 690 690 691 691 /* Clone Call-ID header. */ 692 dlg->call_id = (pjsip_cid_hdr*) 692 dlg->call_id = (pjsip_cid_hdr*) 693 693 pjsip_hdr_clone(dlg->pool, first_dlg->call_id); 694 694 … … 708 708 709 709 /* Clone client authentication session. */ 710 status = pjsip_auth_clt_clone(dlg->pool, &dlg->auth_sess, 710 status = pjsip_auth_clt_clone(dlg->pool, &dlg->auth_sess, 711 711 &first_dlg->auth_sess); 712 712 if (status != PJ_SUCCESS) … … 842 842 PJ_DEF(void) pjsip_dlg_inc_lock(pjsip_dialog *dlg) 843 843 { 844 PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_inc_lock(), sess_count=%d", 844 PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_inc_lock(), sess_count=%d", 845 845 dlg->sess_count)); 846 846 … … 848 848 dlg->sess_count++; 849 849 850 PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_inc_lock(), sess_count=%d", 850 PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_inc_lock(), sess_count=%d", 851 851 dlg->sess_count)); 852 852 } … … 859 859 pj_status_t status; 860 860 861 PJ_LOG(6,(dlg->obj_name,"Entering pjsip_dlg_try_inc_lock(), sess_count=%d", 861 PJ_LOG(6,(dlg->obj_name,"Entering pjsip_dlg_try_inc_lock(), sess_count=%d", 862 862 dlg->sess_count)); 863 863 … … 870 870 dlg->sess_count++; 871 871 872 PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_try_inc_lock(), sess_count=%d", 872 PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_try_inc_lock(), sess_count=%d", 873 873 dlg->sess_count)); 874 874 … … 885 885 PJ_ASSERT_ON_FAIL(dlg!=NULL, return); 886 886 887 PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d", 887 PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d", 888 888 dlg->sess_count)); 889 889 … … 960 960 PJ_ASSERT_RETURN(dlg->usage_cnt < PJSIP_MAX_MODULE, PJ_EBUG); 961 961 962 PJ_LOG(5,(dlg->obj_name, 962 PJ_LOG(5,(dlg->obj_name, 963 963 "Module %.*s added as dialog usage, data=%p", 964 964 (int)mod->name.slen, mod->name.ptr, mod_data)); … … 977 977 * So return PJ_SUCCESS here. 978 978 */ 979 PJ_LOG(4,(dlg->obj_name, 979 PJ_LOG(4,(dlg->obj_name, 980 980 "Module %.*s already registered as dialog usage, " 981 981 "updating the data %p", … … 1000 1000 pj_array_insert(dlg->usage, sizeof(dlg->usage[0]), dlg->usage_cnt, 1001 1001 index, &mod); 1002 1002 1003 1003 /* Set module data. */ 1004 1004 dlg->mod_data[mod->id] = mod_data; … … 1014 1014 1015 1015 /* 1016 * Attach module specific data to the dialog. Application can also set 1016 * Attach module specific data to the dialog. Application can also set 1017 1017 * the value directly by accessing dlg->mod_data[module_id]. 1018 1018 */ … … 1044 1044 /* 1045 1045 * Create a new request within dialog (i.e. after the dialog session has been 1046 * established). The construction of such requests follows the rule in 1046 * established). The construction of such requests follows the rule in 1047 1047 * RFC3261 section 12.2.1. 1048 1048 */ … … 1058 1058 1059 1059 /* Contact Header field. 1060 * Contact can only be present in requests that establish dialog (in the 1060 * Contact can only be present in requests that establish dialog (in the 1061 1061 * core SIP spec, only INVITE). 1062 1062 */ … … 1083 1083 return status; 1084 1084 1085 /* Just copy dialog route-set to Route header. 1085 /* Just copy dialog route-set to Route header. 1086 1086 * The transaction will do the processing as specified in Section 12.2.1 1087 1087 * of RFC 3261 in function tsx_process_route() in sip_transaction.c. … … 1193 1193 */ 1194 1194 if (msg->line.req.method.id != PJSIP_CANCEL_METHOD && 1195 msg->line.req.method.id != PJSIP_ACK_METHOD) 1195 msg->line.req.method.id != PJSIP_ACK_METHOD) 1196 1196 { 1197 1197 pjsip_cseq_hdr *ch; 1198 1198 1199 1199 ch = PJSIP_MSG_CSEQ_HDR(msg); 1200 1200 PJ_ASSERT_RETURN(ch!=NULL, PJ_EBUG); … … 1245 1245 1246 1246 /* Send request */ 1247 status = pjsip_endpt_send_request_stateless(dlg->endpt, tdata, 1247 status = pjsip_endpt_send_request_stateless(dlg->endpt, tdata, 1248 1248 NULL, NULL); 1249 1249 if (status != PJ_SUCCESS) … … 1260 1260 /* Unlock dialog, may destroy dialog. */ 1261 1261 pjsip_dlg_dec_lock(dlg); 1262 1262 1263 1263 /* Whatever happen delete the message. */ 1264 1264 pjsip_tx_data_dec_ref( tdata ); … … 1287 1287 /* Add Contact header for 1xx, 2xx, 3xx and 485 response. */ 1288 1288 if (st_class==2 || st_class==3 || (st_class==1 && st_code != 100) || 1289 st_code==485) 1289 st_code==485) 1290 1290 { 1291 1291 /* Add contact header only if one is not present. */ 1292 1292 if (pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL) == 0 && 1293 pjsip_msg_find_hdr_by_name(tdata->msg, &HCONTACT, NULL) == 0) 1293 pjsip_msg_find_hdr_by_name(tdata->msg, &HCONTACT, NULL) == 0) 1294 1294 { 1295 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, 1295 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, 1296 1296 dlg->local.contact); 1297 1297 pjsip_msg_add_hdr(tdata->msg, hdr); … … 1302 1302 if ((((st_code/10==18 || st_class==2) && dlg->add_allow) 1303 1303 || st_code==405) && 1304 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ALLOW, NULL)==NULL) 1304 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ALLOW, NULL)==NULL) 1305 1305 { 1306 1306 c_hdr = pjsip_endpt_get_capability(dlg->endpt, … … 1313 1313 1314 1314 /* Add Supported header in 2xx response. */ 1315 if (st_class==2 && 1316 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_SUPPORTED, NULL)==NULL) 1315 if (st_class==2 && 1316 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_SUPPORTED, NULL)==NULL) 1317 1317 { 1318 1318 c_hdr = pjsip_endpt_get_capability(dlg->endpt, … … 1401 1401 } 1402 1402 1403 /* Remove existing Contact header (without this, when dialog sent 1403 /* Remove existing Contact header (without this, when dialog sent 1404 1404 * 180 and then 302, the Contact in 302 will not get updated). 1405 1405 */ … … 1446 1446 pjsip_tx_data_get_info(tdata))); 1447 1447 1448 /* Check that transaction method and cseq match the response. 1448 /* Check that transaction method and cseq match the response. 1449 1449 * This operation is sloooww (search CSeq header twice), that's why 1450 1450 * we only do it in debug mode. … … 1452 1452 #if defined(PJ_DEBUG) && PJ_DEBUG!=0 1453 1453 PJ_ASSERT_RETURN( PJSIP_MSG_CSEQ_HDR(tdata->msg)->cseq == tsx->cseq && 1454 pjsip_method_cmp(&PJSIP_MSG_CSEQ_HDR(tdata->msg)->method, 1454 pjsip_method_cmp(&PJSIP_MSG_CSEQ_HDR(tdata->msg)->method, 1455 1455 &tsx->method)==0, 1456 1456 PJ_EINVALIDOP); … … 1478 1478 status = pjsip_tsx_send_msg(tsx, tdata); 1479 1479 1480 /* This function must decrement transmit data request counter 1480 /* This function must decrement transmit data request counter 1481 1481 * regardless of the operation status. The transaction only 1482 1482 * decrements the counter if the operation is successful. … … 1563 1563 if (rdata->msg_info.cseq->cseq <= dlg->remote.cseq && 1564 1564 rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD && 1565 rdata->msg_info.msg->line.req.method.id != PJSIP_CANCEL_METHOD) 1565 rdata->msg_info.msg->line.req.method.id != PJSIP_CANCEL_METHOD) 1566 1566 { 1567 1567 /* Invalid CSeq. … … 1595 1595 1596 1596 /* Create UAS transaction for this request. */ 1597 if (pjsip_rdata_get_tsx(rdata) == NULL && 1598 rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) 1597 if (pjsip_rdata_get_tsx(rdata) == NULL && 1598 rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) 1599 1599 { 1600 1600 status = pjsip_tsx_create_uas(dlg->ua, rdata, &tsx); … … 1630 1630 1631 1631 contact = (pjsip_contact_hdr*) 1632 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1632 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1633 1633 NULL); 1634 1634 if (contact && contact->uri && … … 1638 1638 contact->uri))) 1639 1639 { 1640 dlg->remote.contact = (pjsip_contact_hdr*) 1640 dlg->remote.contact = (pjsip_contact_hdr*) 1641 1641 pjsip_hdr_clone(dlg->pool, contact); 1642 1642 dlg->target = dlg->remote.contact->uri; … … 1688 1688 { 1689 1689 const pjsip_hdr *hdr, *end_hdr; 1690 pj_int32_t msg_cseq;1690 //pj_int32_t msg_cseq; 1691 1691 const pjsip_msg *msg; 1692 1692 1693 1693 msg = rdata->msg_info.msg; 1694 msg_cseq = rdata->msg_info.cseq->cseq;1694 //msg_cseq = rdata->msg_info.cseq->cseq; 1695 1695 1696 1696 /* Ignore if route set has been frozen */ … … 1708 1708 1709 1709 /* Ignore subsequent responses with higher CSeq than initial CSeq. 1710 * Unfortunately this would be broken when the first request is 1710 * Unfortunately this would be broken when the first request is 1711 1711 * challenged! 1712 1712 */ … … 1747 1747 PJ_LOG(5,(dlg->obj_name, "Route-set updated")); 1748 1748 1749 /* Freeze the route set only when the route set comes in 2xx response. 1750 * If it is in 1xx response, prepare to recompute the route set when 1749 /* Freeze the route set only when the route set comes in 2xx response. 1750 * If it is in 1xx response, prepare to recompute the route set when 1751 1751 * the 2xx response comes in. 1752 1752 * … … 1756 1756 * upon receiving 2xx response). Also RFC 3261 says so in 13.2.2.4. 1757 1757 * 1758 * The pjsip_method_creates_dialog() check protects from wrongly 1758 * The pjsip_method_creates_dialog() check protects from wrongly 1759 1759 * freezing the route set upon receiving 200/OK response for PRACK. 1760 1760 */ 1761 1761 if (pjsip_method_creates_dialog(&rdata->msg_info.cseq->method) && 1762 PJSIP_IS_STATUS_IN_CLASS(msg->line.status.code, 200)) 1762 PJSIP_IS_STATUS_IN_CLASS(msg->line.status.code, 200)) 1763 1763 { 1764 1764 dlg->route_set_frozen = PJ_TRUE; … … 1789 1789 res_code = rdata->msg_info.msg->line.status.code; 1790 1790 1791 /* When we receive response that establishes dialog, update To tag, 1791 /* When we receive response that establishes dialog, update To tag, 1792 1792 * route set and dialog target. 1793 1793 * … … 1803 1803 * New update: 1804 1804 * We also need to update the dialog for 1xx responses, to handle the 1805 * case when 100rel is used, otherwise PRACK will be sent to the 1805 * case when 100rel is used, otherwise PRACK will be sent to the 1806 1806 * wrong target. 1807 1807 */ 1808 if ((dlg->state == PJSIP_DIALOG_STATE_NULL && 1808 if ((dlg->state == PJSIP_DIALOG_STATE_NULL && 1809 1809 pjsip_method_creates_dialog(&rdata->msg_info.cseq->method) && 1810 1810 (res_code > 100 && res_code < 300) && 1811 rdata->msg_info.to->tag.slen) 1811 rdata->msg_info.to->tag.slen) 1812 1812 || 1813 1813 (dlg->role==PJSIP_ROLE_UAC && … … 1820 1820 pjsip_contact_hdr *contact; 1821 1821 1822 /* Update remote capability info, when To tags in the dialog remote 1822 /* Update remote capability info, when To tags in the dialog remote 1823 1823 * info and the incoming response are different, e.g: first response 1824 1824 * with To-tag or forking, apply strict update. … … 1834 1834 /* RFC 3271 Section 12.1.2: 1835 1835 * The route set MUST be set to the list of URIs in the Record-Route 1836 * header field from the response, taken in reverse order and 1837 * preserving all URI parameters. If no Record-Route header field 1838 * is present in the response, the route set MUST be set to the 1836 * header field from the response, taken in reverse order and 1837 * preserving all URI parameters. If no Record-Route header field 1838 * is present in the response, the route set MUST be set to the 1839 1839 * empty set. This route set, even if empty, overrides any pre-existing 1840 1840 * route set for future requests in this dialog. … … 1842 1842 dlg_update_routeset(dlg, rdata); 1843 1843 1844 /* The remote target MUST be set to the URI from the Contact header 1844 /* The remote target MUST be set to the URI from the Contact header 1845 1845 * field of the response. 1846 1846 */ 1847 1847 contact = (pjsip_contact_hdr*) 1848 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1848 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1849 1849 NULL); 1850 1850 if (contact && contact->uri && … … 1854 1854 contact->uri))) 1855 1855 { 1856 dlg->remote.contact = (pjsip_contact_hdr*) 1856 dlg->remote.contact = (pjsip_contact_hdr*) 1857 1857 pjsip_hdr_clone(dlg->pool, contact); 1858 1858 dlg->target = dlg->remote.contact->uri; … … 1864 1864 * gets through this dialog (it shouldn't happen). 1865 1865 */ 1866 if (dlg->role==PJSIP_ROLE_UAC && !dlg->uac_has_2xx && 1867 res_code/100==2) 1866 if (dlg->role==PJSIP_ROLE_UAC && !dlg->uac_has_2xx && 1867 res_code/100==2) 1868 1868 { 1869 1869 dlg->uac_has_2xx = PJ_TRUE; … … 1872 1872 1873 1873 /* Update remote target (again) when receiving 2xx response messages 1874 * that's defined as target refresh. 1874 * that's defined as target refresh. 1875 1875 * 1876 1876 * Also upon receiving 2xx response, recheck again the route set. … … 1882 1882 the "confirmed" state, and the route set for the dialog MUST be 1883 1883 recomputed based on the 2xx response using the procedures of Section 1884 12.2.1.2. 1884 12.2.1.2. 1885 1885 1886 1886 Note that the only piece of state that is recomputed is the route … … 1897 1897 1898 1898 contact = (pjsip_contact_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg, 1899 PJSIP_H_CONTACT, 1899 PJSIP_H_CONTACT, 1900 1900 NULL); 1901 1901 if (contact && contact->uri && … … 1905 1905 contact->uri))) 1906 1906 { 1907 dlg->remote.contact = (pjsip_contact_hdr*) 1907 dlg->remote.contact = (pjsip_contact_hdr*) 1908 1908 pjsip_hdr_clone(dlg->pool, contact); 1909 1909 dlg->target = dlg->remote.contact->uri; … … 1943 1943 pj_status_t status; 1944 1944 1945 if (rdata->msg_info.cseq->method.id==PJSIP_INVITE_METHOD && 1946 rdata->msg_info.msg->line.status.code/100 == 2) 1945 if (rdata->msg_info.cseq->method.id==PJSIP_INVITE_METHOD && 1946 rdata->msg_info.msg->line.status.code/100 == 2) 1947 1947 { 1948 1948 pjsip_tx_data *ack; … … 1958 1958 pjsip_transaction *tsx = pjsip_rdata_get_tsx(rdata); 1959 1959 pjsip_tx_data *tdata; 1960 1961 status = pjsip_auth_clt_reinit_req( &dlg->auth_sess, 1960 1961 status = pjsip_auth_clt_reinit_req( &dlg->auth_sess, 1962 1962 rdata, tsx->last_tx, 1963 1963 &tdata); 1964 1964 1965 1965 if (status == PJ_SUCCESS) { 1966 1966 /* Re-send request. */ … … 2015 2015 */ 2016 2016 if (tsx->state == PJSIP_TSX_STATE_TERMINATED && 2017 tsx->mod_data[dlg->ua->id] == dlg) 2017 tsx->mod_data[dlg->ua->id] == dlg) 2018 2018 { 2019 2019 pj_assert(dlg->tsx_count>0); … … 2045 2045 pjsip_dlg_inc_lock(dlg); 2046 2046 2047 hdr = (const pjsip_generic_array_hdr*) 2047 hdr = (const pjsip_generic_array_hdr*) 2048 2048 pjsip_dlg_get_remote_cap_hdr(dlg, htype, hname); 2049 2049 if (!hdr) { … … 2072 2072 pj_bool_t strict) 2073 2073 { 2074 pjsip_hdr_e htypes[] = 2074 pjsip_hdr_e htypes[] = 2075 2075 { PJSIP_H_ACCEPT, PJSIP_H_ALLOW, PJSIP_H_SUPPORTED }; 2076 2076 unsigned i;
Note: See TracChangeset
for help on using the changeset viewer.