- Timestamp:
- Dec 28, 2016 3:40:07 AM (8 years ago)
- Location:
- pjproject/branches/projects/uwp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/uwp
- Property svn:mergeinfo changed
/pjproject/trunk (added) merged: 5209,5212-5234,5237-5253,5255,5257-5292,5294-5297,5299-5332,5334-5394,5396-5438,5440-5469,5471-5496,5498-5510
- Property svn:mergeinfo changed
-
pjproject/branches/projects/uwp/pjsip/src/pjsip/sip_dialog.c
r5180 r5513 93 93 pj_list_init(&dlg->rem_cap_hdr); 94 94 95 /* Init client authentication session. */ 96 status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt, 97 dlg->pool, 0); 98 if (status != PJ_SUCCESS) 99 goto on_error; 100 95 101 status = pj_mutex_create_recursive(pool, dlg->obj_name, &dlg->mutex_); 96 102 if (status != PJ_SUCCESS) … … 120 126 pj_bzero(&dlg->tp_sel, sizeof(pjsip_tpselector)); 121 127 } 128 pjsip_auth_clt_deinit(&dlg->auth_sess); 122 129 pjsip_endpt_release_pool(dlg->endpt, dlg->pool); 123 130 } … … 283 290 pj_list_init(&dlg->route_set); 284 291 285 /* Init client authentication session. */286 status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt,287 dlg->pool, 0);288 if (status != PJ_SUCCESS)289 goto on_error;290 291 292 /* Register this dialog to user agent. */ 292 293 status = pjsip_ua_register_dlg( ua, dlg ); … … 312 313 * Create UAS dialog. 313 314 */ 314 PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua, 315 pjsip_rx_data *rdata, 316 const pj_str_t *contact, 317 pjsip_dialog **p_dlg) 315 pj_status_t create_uas_dialog( pjsip_user_agent *ua, 316 pjsip_rx_data *rdata, 317 const pj_str_t *contact, 318 pj_bool_t inc_lock, 319 pjsip_dialog **p_dlg) 318 320 { 319 321 pj_status_t status; … … 505 507 dlg->route_set_frozen = PJ_TRUE; 506 508 507 /* In it client authentication session. */508 status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt,509 dlg->pool, 0); 510 if ( status != PJ_SUCCESS)511 goto on_error;509 /* Increment the dialog's lock since tsx may cause the dialog to be 510 * destroyed prematurely (such as in case of transport error). 511 */ 512 if (inc_lock) 513 pjsip_dlg_inc_lock(dlg); 512 514 513 515 /* Create UAS transaction for this request. */ … … 553 555 } 554 556 555 destroy_dialog(dlg, PJ_FALSE); 557 if (inc_lock) { 558 pjsip_dlg_dec_lock(dlg); 559 } else { 560 destroy_dialog(dlg, PJ_FALSE); 561 } 562 556 563 return status; 564 } 565 566 567 #if !DEPRECATED_FOR_TICKET_1902 568 /* 569 * Create UAS dialog. 570 */ 571 PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua, 572 pjsip_rx_data *rdata, 573 const pj_str_t *contact, 574 pjsip_dialog **p_dlg) 575 { 576 return create_uas_dialog(ua, rdata, contact, PJ_FALSE, p_dlg); 577 } 578 #endif 579 580 581 /* 582 * Create UAS dialog and increase its session count. 583 */ 584 PJ_DEF(pj_status_t) 585 pjsip_dlg_create_uas_and_inc_lock( pjsip_user_agent *ua, 586 pjsip_rx_data *rdata, 587 const pj_str_t *contact, 588 pjsip_dialog **p_dlg) 589 { 590 return create_uas_dialog(ua, rdata, contact, PJ_TRUE, p_dlg); 557 591 } 558 592 … … 749 783 PJ_ASSERT_RETURN(dlg->tsx_count==0, PJ_EINVALIDOP); 750 784 751 /* Unregister from user agent. */ 752 status = pjsip_ua_unregister_dlg(dlg->ua, dlg); 753 if (status != PJ_SUCCESS) { 754 pj_assert(!"Unexpected failed unregistration!"); 755 return status; 785 /* Unregister from user agent, if it has been registered (see #1924) */ 786 if (dlg->dlg_set) { 787 status = pjsip_ua_unregister_dlg(dlg->ua, dlg); 788 if (status != PJ_SUCCESS) { 789 pj_assert(!"Unexpected failed unregistration!"); 790 return status; 791 } 756 792 } 757 793 … … 1089 1125 return status; 1090 1126 1127 /* Put this dialog in tdata's mod_data */ 1128 tdata->mod_data[dlg->ua->id] = dlg; 1129 1091 1130 /* Just copy dialog route-set to Route header. 1092 1131 * The transaction will do the processing as specified in Section 12.2.1 … … 1188 1227 /* Lock and increment session */ 1189 1228 pjsip_dlg_inc_lock(dlg); 1229 1230 /* Put this dialog in tdata's mod_data */ 1231 tdata->mod_data[dlg->ua->id] = dlg; 1190 1232 1191 1233 /* If via_addr is set, use this address for the Via header. */ … … 1370 1412 /* Lock the dialog. */ 1371 1413 pjsip_dlg_inc_lock(dlg); 1414 1415 /* Put this dialog in tdata's mod_data */ 1416 tdata->mod_data[dlg->ua->id] = dlg; 1372 1417 1373 1418 dlg_beautify_response(dlg, PJ_FALSE, st_code, tdata);
Note: See TracChangeset
for help on using the changeset viewer.