- Timestamp:
- Nov 19, 2013 10:18:17 AM (11 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h
r4583 r4653 394 394 pj_bool_t cancelling; /**< CANCEL requested */ 395 395 pj_bool_t pending_cancel; /**< Wait to send CANCEL*/ 396 pjsip_tx_data *pending_bye; /**< BYE to send later */ 396 397 pjsip_status_code cause; /**< Disconnect cause. */ 397 398 pj_str_t cause_text; /**< Cause text. */ -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r4583 r4653 264 264 inv->invite_req = NULL; 265 265 } 266 if (inv->pending_bye) { 267 pjsip_tx_data_dec_ref(inv->pending_bye); 268 inv->pending_bye = NULL; 269 } 266 270 pjsip_100rel_end_session(inv); 267 271 pjsip_timer_end_session(inv); … … 356 360 } 357 361 362 /* Process pending disconnection 363 * http://trac.pjsip.org/repos/ticket/1712 364 */ 365 static void inv_perform_pending_bye(pjsip_inv_session *inv) 366 { 367 if (inv->pending_bye) { 368 pjsip_tx_data *bye = inv->pending_bye; 369 pj_status_t status; 370 371 PJ_LOG(4,(inv->dlg->obj_name, "Sending pending BYE")); 372 373 inv->pending_bye = NULL; 374 status = pjsip_inv_send_msg(inv, bye); 375 376 if (status != PJ_SUCCESS) { 377 PJ_PERROR(1,(inv->dlg->obj_name, status, 378 "Failed sending pending BYE")); 379 } 380 } 381 } 358 382 359 383 /* … … 529 553 PJSIP_EVENT_INIT_RX_MSG(event, rdata); 530 554 inv_set_state(inv, PJSIP_INV_STATE_CONFIRMED, &event); 555 556 /* Send pending BYE if any: 557 * http://trac.pjsip.org/repos/ticket/1712 558 * Do this after setting the state to CONFIRMED, so that we 559 * have consistent CONFIRMED state between caller and callee. 560 */ 561 if (inv->pending_bye) 562 inv_perform_pending_bye(inv); 531 563 } 532 564 } … … 2890 2922 } 2891 2923 2924 /* Don't send BYE before ACK is received 2925 * http://trac.pjsip.org/repos/ticket/1712 2926 */ 2927 if (tdata->msg->line.req.method.id == PJSIP_BYE_METHOD && 2928 inv->role == PJSIP_ROLE_UAS && 2929 inv->state == PJSIP_INV_STATE_CONNECTING) 2930 { 2931 if (inv->pending_bye) 2932 pjsip_tx_data_dec_ref(inv->pending_bye); 2933 2934 inv->pending_bye = tdata; 2935 PJ_LOG(4, (inv->obj_name, "Delaying BYE request until " 2936 "ACK is received")); 2937 pjsip_dlg_dec_lock(inv->dlg); 2938 goto on_return; 2939 } 2940 2892 2941 /* Associate our data in outgoing invite transaction */ 2893 2942 tsx_inv_data = PJ_POOL_ZALLOC_T(inv->pool, struct tsx_inv_data); … … 2925 2974 2926 2975 /* Done */ 2976 on_return: 2927 2977 pj_log_pop_indent(); 2928 2978 return PJ_SUCCESS; … … 4092 4142 4093 4143 inv_set_state(inv, PJSIP_INV_STATE_CONFIRMED, e); 4144 4145 /* Send pending BYE if any: 4146 * http://trac.pjsip.org/repos/ticket/1712 4147 * Do this after setting the state to CONFIRMED, so that we 4148 * have consistent CONFIRMED state between caller and callee. 4149 */ 4150 if (inv->pending_bye) 4151 inv_perform_pending_bye(inv); 4152 4094 4153 } 4095 4154 break;
Note: See TracChangeset
for help on using the changeset viewer.