Ignore:
Timestamp:
Dec 4, 2018 2:16:47 AM (5 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_call.c

    r5892 r5918  
    788788    PJSUA_LOCK(); 
    789789 
     790    acc = &pjsua_var.acc[acc_id]; 
     791    if (!acc->valid) { 
     792        pjsua_perror(THIS_FILE, "Unable to make call because account " 
     793                     "is not valid", PJ_EINVALIDOP); 
     794        status = PJ_EINVALIDOP; 
     795        goto on_error; 
     796    } 
     797 
     798    /* Find free call slot. */ 
     799    call_id = alloc_call_id(); 
     800 
     801    if (call_id == PJSUA_INVALID_ID) { 
     802        pjsua_perror(THIS_FILE, "Error making call", PJ_ETOOMANY); 
     803        status = PJ_ETOOMANY; 
     804        goto on_error; 
     805    } 
     806 
     807    /* Clear call descriptor */ 
     808    reset_call(call_id); 
     809 
     810    call = &pjsua_var.calls[call_id]; 
     811 
     812    /* Associate session with account */ 
     813    call->acc_id = acc_id; 
     814    call->call_hold_type = acc->cfg.call_hold_type; 
     815 
     816    /* Generate per-session RTCP CNAME, according to RFC 7022. */ 
     817    pj_create_random_string(call->cname_buf, call->cname.slen); 
     818 
     819    /* Apply call setting */ 
     820    status = apply_call_setting(call, opt, NULL); 
     821    if (status != PJ_SUCCESS) { 
     822        pjsua_perror(THIS_FILE, "Failed to apply call setting", status); 
     823        goto on_error; 
     824    } 
     825     
    790826    /* Create sound port if none is instantiated, to check if sound device 
    791827     * can be used. But only do this with the conference bridge, as with 
     
    794830     */ 
    795831    if (!pjsua_var.is_mswitch && pjsua_var.snd_port==NULL && 
    796         pjsua_var.null_snd==NULL && !pjsua_var.no_snd) 
     832        pjsua_var.null_snd==NULL && !pjsua_var.no_snd && call->opt.aud_cnt > 0) 
    797833    { 
    798834        status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 
     
    801837    } 
    802838 
    803     acc = &pjsua_var.acc[acc_id]; 
    804     if (!acc->valid) { 
    805         pjsua_perror(THIS_FILE, "Unable to make call because account " 
    806                      "is not valid", PJ_EINVALIDOP); 
    807         status = PJ_EINVALIDOP; 
    808         goto on_error; 
    809     } 
    810  
    811     /* Find free call slot. */ 
    812     call_id = alloc_call_id(); 
    813  
    814     if (call_id == PJSUA_INVALID_ID) { 
    815         pjsua_perror(THIS_FILE, "Error making call", PJ_ETOOMANY); 
    816         status = PJ_ETOOMANY; 
    817         goto on_error; 
    818     } 
    819  
    820     /* Clear call descriptor */ 
    821     reset_call(call_id); 
    822  
    823     call = &pjsua_var.calls[call_id]; 
    824  
    825     /* Associate session with account */ 
    826     call->acc_id = acc_id; 
    827     call->call_hold_type = acc->cfg.call_hold_type; 
    828  
    829     /* Generate per-session RTCP CNAME, according to RFC 7022. */ 
    830     pj_create_random_string(call->cname_buf, call->cname.slen); 
    831  
    832     /* Apply call setting */ 
    833     status = apply_call_setting(call, opt, NULL); 
    834     if (status != PJ_SUCCESS) { 
    835         pjsua_perror(THIS_FILE, "Failed to apply call setting", status); 
    836         goto on_error; 
    837     } 
    838      
    839839    /* Create temporary pool */ 
    840840    tmp_pool = pjsua_pool_create("tmpcall10", 512, 256); 
Note: See TracChangeset for help on using the changeset viewer.