Changeset 5918 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Dec 4, 2018 2:16:47 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5914 r5918 1247 1247 1248 1248 /* Go through the list of media in the SDP, find acceptable media, and 1249 * sort them based on the "quality" of the media, and store the indexes 1250 * in the specified array. Media with the best quality will be listed 1251 * first in the array. The quality factors considered currently is 1252 * encryption. 1249 * sort them based on the below criteria, and store the indexes 1250 * in the specified array. The criteria is as follows: 1251 * 1. enabled, i.e: SDP media port not zero 1252 * 2. transport protocol in the SDP matching account config's 1253 * secure media transport usage (\a use_srtp field). 1254 * 3. active, i.e: SDP media direction is not "inactive" 1255 * 4. media order (according to the SDP). 1253 1256 */ 1254 1257 static void sort_media(const pjmedia_sdp_session *sdp, … … 2014 2017 sort_media(rem_sdp, &STR_AUDIO, acc->cfg.use_srtp, 2015 2018 maudidx, &maudcnt, &mtotaudcnt); 2016 if (maudcnt==0) {2017 /* Expecting audio in the offer */2018 if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE;2019 status = PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE);2020 goto on_error;2021 }2022 2019 2023 2020 #if PJMEDIA_HAS_VIDEO … … 2028 2025 PJ_UNUSED_ARG(STR_VIDEO); 2029 2026 #endif 2027 2028 if (maudcnt + mvidcnt == 0) { 2029 /* Expecting audio or video in the offer */ 2030 if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE; 2031 status = PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 2032 goto on_error; 2033 } 2030 2034 2031 2035 /* Update media count only when remote add any media, this media count … … 2231 2235 } 2232 2236 2233 call->audio_idx = maudidx[0]; 2234 2235 PJ_LOG(4,(THIS_FILE, "Media index %d selected for audio call %d", 2236 call->audio_idx, call->index)); 2237 if (maudcnt > 0) { 2238 call->audio_idx = maudidx[0]; 2239 2240 PJ_LOG(4,(THIS_FILE, "Media index %d selected for audio call %d", 2241 call->audio_idx, call->index)); 2242 } else { 2243 call->audio_idx = -1; 2244 } 2237 2245 2238 2246 if (pending_med_tp) {
Note: See TracChangeset
for help on using the changeset viewer.