Changeset 4924 for pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
- Timestamp:
- Sep 17, 2014 12:11:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r4900 r4924 4738 4738 4739 4739 if (status != PJ_SUCCESS) { 4740 4741 /* Not Acceptable */ 4742 const pjsip_hdr *accept; 4743 4744 /* The incoming SDP is unacceptable. If the SDP negotiator 4745 * state has just been changed, i.e: DONE -> REMOTE_OFFER, 4746 * revert it back. 4747 */ 4748 if (pjmedia_sdp_neg_get_state(inv->neg) == 4749 PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER) 4740 pj_bool_t reject_message = PJ_TRUE; 4741 4742 if (status == PJMEDIA_SDP_EINSDP) 4750 4743 { 4751 pjmedia_sdp_neg_cancel_offer(inv->neg); 4744 sdp_info = pjsip_rdata_get_sdp_info(rdata); 4745 if (sdp_info->body.ptr == NULL && 4746 PJSIP_INV_ACCEPT_UNKNOWN_BODY) 4747 { 4748 /* Message body is not "application/sdp" */ 4749 reject_message = PJ_FALSE; 4750 } 4752 4751 } 4753 4752 4754 status = pjsip_dlg_create_response(inv->dlg, rdata, 4755 488, NULL, &tdata); 4756 if (status != PJ_SUCCESS) 4753 if (reject_message) { 4754 /* Not Acceptable */ 4755 const pjsip_hdr *accept; 4756 4757 /* The incoming SDP is unacceptable. If the SDP negotiator 4758 * state has just been changed, i.e: DONE -> REMOTE_OFFER, 4759 * revert it back. 4760 */ 4761 if (pjmedia_sdp_neg_get_state(inv->neg) == 4762 PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER) 4763 { 4764 pjmedia_sdp_neg_cancel_offer(inv->neg); 4765 } 4766 4767 status = pjsip_dlg_create_response(inv->dlg, rdata, 4768 (status == PJMEDIA_SDP_EINSDP)?415:488, 4769 NULL, &tdata); 4770 4771 if (status != PJ_SUCCESS) 4772 return; 4773 4774 4775 accept = pjsip_endpt_get_capability(dlg->endpt, 4776 PJSIP_H_ACCEPT, 4777 NULL); 4778 if (accept) { 4779 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 4780 pjsip_hdr_clone(tdata->pool, accept)); 4781 } 4782 4783 status = pjsip_dlg_send_response(dlg, tsx, tdata); 4784 4757 4785 return; 4758 4759 4760 accept = pjsip_endpt_get_capability(dlg->endpt, PJSIP_H_ACCEPT,4761 NULL);4762 if (accept) {4763 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)4764 pjsip_hdr_clone(tdata->pool, accept));4765 4786 } 4766 4767 status = pjsip_dlg_send_response(dlg, tsx, tdata);4768 4769 return;4770 4787 } 4771 4788
Note: See TracChangeset
for help on using the changeset viewer.