summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsua-lib/pjsua_media.c
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_media.c')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c7
1 files changed, 7 insertions, 0 deletions
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 */