Ignore:
Timestamp:
Dec 4, 2018 2:16:47 AM (6 years ago)
Author:
ming
Message:

Fixed #2165: Support video only call in pjsua

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r5914 r5918  
    12471247 
    12481248/* 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). 
    12531256 */ 
    12541257static void sort_media(const pjmedia_sdp_session *sdp, 
     
    20142017        sort_media(rem_sdp, &STR_AUDIO, acc->cfg.use_srtp, 
    20152018                   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         } 
    20222019 
    20232020#if PJMEDIA_HAS_VIDEO 
     
    20282025        PJ_UNUSED_ARG(STR_VIDEO); 
    20292026#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        } 
    20302034 
    20312035        /* Update media count only when remote add any media, this media count 
     
    22312235    } 
    22322236 
    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    } 
    22372245 
    22382246    if (pending_med_tp) { 
Note: See TracChangeset for help on using the changeset viewer.