Changeset 4948 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
- Timestamp:
- Oct 17, 2014 12:47:31 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r4934 r4948 49 49 }; 50 50 51 /* UPDATE method */ 52 static const pjsip_method pjsip_update_method = 53 { 54 PJSIP_OTHER_METHOD, 55 { "UPDATE", 6 } 56 }; 51 57 52 58 /* This callback receives notification from invite session when the … … 2509 2515 2510 2516 /* Send the request */ 2517 call->med_update_success = PJ_FALSE; 2511 2518 status = pjsip_inv_send_msg( call->inv, tdata); 2512 2519 if (status != PJ_SUCCESS) { … … 2617 2624 2618 2625 /* Send the request */ 2626 call->med_update_success = PJ_FALSE; 2619 2627 status = pjsip_inv_send_msg( call->inv, tdata); 2620 2628 if (status != PJ_SUCCESS) { … … 3815 3823 } 3816 3824 3825 call->med_update_success = (status == PJ_SUCCESS); 3826 3817 3827 /* Update remote's NAT type */ 3818 3828 if (pjsua_var.ua_cfg.nat_type_in_sdp) { … … 4682 4692 } 4683 4693 } else if (tsx->role == PJSIP_ROLE_UAC && 4684 tsx->last_tx == (pjsip_tx_data*)call->hold_msg && 4685 tsx->state >= PJSIP_TSX_STATE_COMPLETED) 4694 pjsip_method_cmp(&tsx->method, &pjsip_invite_method)==0 && 4695 tsx->state >= PJSIP_TSX_STATE_COMPLETED && 4696 (tsx->status_code!=401 && tsx->status_code!=407)) 4686 4697 { 4687 /* Monitor the status of call hold request */ 4688 call->hold_msg = NULL; 4689 if (tsx->status_code/100 != 2) { 4690 /* Outgoing call hold failed */ 4691 call->local_hold = PJ_FALSE; 4692 PJ_LOG(3,(THIS_FILE, "Error putting call %d on hold (reason=%d)", 4693 call->index, tsx->status_code)); 4694 } 4698 if (tsx->status_code/100 != 2) { 4699 /* Monitor the status of call hold/unhold request */ 4700 if (tsx->last_tx == (pjsip_tx_data*)call->hold_msg) { 4701 /* Outgoing call hold failed */ 4702 call->local_hold = PJ_FALSE; 4703 PJ_LOG(3,(THIS_FILE, "Error putting call %d on hold " 4704 "(reason=%d)", call->index, tsx->status_code)); 4705 } else if (call->opt.flag & PJSUA_CALL_UNHOLD) { 4706 /* Call unhold failed */ 4707 call->local_hold = PJ_TRUE; 4708 PJ_LOG(3,(THIS_FILE, "Error releasing hold on call %d " 4709 "(reason=%d)", call->index, tsx->status_code)); 4710 } 4711 } 4712 4713 if (tsx->last_tx == (pjsip_tx_data*)call->hold_msg) { 4714 call->hold_msg = NULL; 4715 } 4716 4717 if (tsx->status_code/100 != 2 || 4718 ((call->opt.flag & PJSUA_CALL_NO_SDP_OFFER) == 0 && 4719 !call->med_update_success)) 4720 { 4721 /* Either we get non-2xx or media update failed, 4722 * clean up provisional media. 4723 */ 4724 pjsua_media_prov_clean_up(call->index); 4725 } 4695 4726 } else if (tsx->role == PJSIP_ROLE_UAC && 4696 (call->opt.flag & PJSUA_CALL_UNHOLD) && 4697 tsx->state >= PJSIP_TSX_STATE_COMPLETED) 4727 pjsip_method_cmp(&tsx->method, &pjsip_update_method)==0 && 4728 tsx->state >= PJSIP_TSX_STATE_COMPLETED && 4729 (tsx->status_code!=401 && tsx->status_code!=407)) 4698 4730 { 4699 /* Monitor the status of call unhold request */4700 if (tsx->status_code/100 != 2&&4701 (tsx->status_code!=401 && tsx->status_code!=407))4731 if (tsx->status_code/100 != 2 || 4732 ((call->opt.flag & PJSUA_CALL_NO_SDP_OFFER) == 0 && 4733 !call->med_update_success)) 4702 4734 { 4703 /* Call unhold failed */4704 call->local_hold = PJ_TRUE;4705 PJ_LOG(3,(THIS_FILE, "Error releasing hold on call %d (reason=%d)", 4706 call->index, tsx->status_code));4735 /* Either we get non-2xx or media update failed, 4736 * clean up provisional media. 4737 */ 4738 pjsua_media_prov_clean_up(call->index); 4707 4739 } 4708 4740 } else if (tsx->role==PJSIP_ROLE_UAS &&
Note: See TracChangeset
for help on using the changeset viewer.