- Timestamp:
- Dec 4, 2018 2:16:47 AM (6 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r5834 r5918 294 294 295 295 /* Start ringback */ 296 ring_start(call_id); 296 if (call_info.rem_aud_cnt) 297 ring_start(call_id); 297 298 298 299 if (app_config.auto_answer > 0) { -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r5899 r5918 4724 4724 pj_str_t last_status_text; 4725 4725 4726 /** Media status of the first audio stream. */ 4726 /** Media status of the default audio stream. Default audio stream 4727 * is chosen according to this priority: 4728 * 1. enabled, i.e: SDP media port not zero 4729 * 2. transport protocol in the SDP matching account config's 4730 * secure media transport usage (\a use_srtp field). 4731 * 3. active, i.e: SDP media direction is not "inactive" 4732 * 4. media order (according to the SDP). 4733 */ 4727 4734 pjsua_call_media_status media_status; 4728 4735 4729 /** Media direction of the first audio stream. */ 4736 /** Media direction of the default audio stream. 4737 * See \a media_status above on how the default is chosen. 4738 */ 4730 4739 pjmedia_dir media_dir; 4731 4740 4732 /** The conference port number for the first audio stream. */ 4741 /** The conference port number for the default audio stream. 4742 * See \a media_status above on how the default is chosen. 4743 */ 4733 4744 pjsua_conf_port_id conf_slot; 4734 4745 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_aud.c
r5842 r5918 78 78 79 79 call = &pjsua_var.calls[call_id]; 80 port_id = call->media[call->audio_idx].strm.a.conf_slot; 80 if (call->audio_idx >= 0) 81 port_id = call->media[call->audio_idx].strm.a.conf_slot; 81 82 82 83 on_return: -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r5892 r5918 788 788 PJSUA_LOCK(); 789 789 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 790 826 /* Create sound port if none is instantiated, to check if sound device 791 827 * can be used. But only do this with the conference bridge, as with … … 794 830 */ 795 831 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) 797 833 { 798 834 status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); … … 801 837 } 802 838 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 839 839 /* Create temporary pool */ 840 840 tmp_pool = pjsua_pool_create("tmpcall10", 512, 256); -
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.