summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-12-02 10:41:46 +0000
committerBenny Prijono <bennylp@teluu.com>2010-12-02 10:41:46 +0000
commit883911360b9cb89f2b9da545a5745a34d1eaf6f4 (patch)
treef6caa5e91500ac56c3798d2b587a9a6de9ac2d4b /pjsip
parent0804e1cbdc9582e626f29c267e39d4044e67298a (diff)
Fixed #1170 (Assertion when receiving updated SDP offer with all media lines removed):
- pjsua_media.c checks if audio media is present in the offer; if not, do not set any answer - sip_inv.c checks if app has supplied an answer after on_rx_offer() callback is called, and returnd 488 (Not Acceptable) if not (previously, it will return 200/OK without SDP!) - added a SIPp scenario file to reproduce this git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3383 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip-ua/sip_inv.c8
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c7
2 files changed, 14 insertions, 1 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c
index aebd3353..b9bfe896 100644
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -1743,13 +1743,19 @@ static pj_status_t inv_check_sdp_in_incoming_msg( pjsip_inv_session *inv,
}
/* Inform application about remote offer. */
-
if (mod_inv.cb.on_rx_offer && inv->notify) {
(*mod_inv.cb.on_rx_offer)(inv, sdp_info->sdp);
}
+ /* application must have supplied an answer at this point. */
+ if (pjmedia_sdp_neg_get_state(inv->neg) !=
+ PJMEDIA_SDP_NEG_STATE_WAIT_NEGO)
+ {
+ return PJ_EINVALIDOP;
+ }
+
} else if (pjmedia_sdp_neg_get_state(inv->neg) ==
PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER)
{
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c
index 8ede0f8c..47cf1e7d 100644
--- a/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/pjsip/src/pjsua-lib/pjsua_media.c
@@ -1311,6 +1311,13 @@ pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id,
#endif
call->audio_idx = find_audio_index(rem_sdp, srtp_active);
+ if (call->audio_idx == -1) {
+ /* No audio in the offer. We can't accept this */
+ PJ_LOG(4,(THIS_FILE,
+ "Unable to accept SDP offer without audio for call %d",
+ call_id));
+ return PJMEDIA_SDP_EINMEDIA;
+ }
}
/* Media index must have been determined before */