audio_stream_enable_noise_gate(audiostream,enabled);
}
+ audio_stream_set_features(audiostream,linphone_core_get_audio_features(lc));
+
if (lc->rtptf){
RtpTransport *artp=lc->rtptf->audio_rtp_func(lc->rtptf->audio_rtp_func_data, call->audio_port);
RtpTransport *artcp=lc->rtptf->audio_rtcp_func(lc->rtptf->audio_rtcp_func_data, call->audio_port+1);
linphone_core_set_playback_gain_db (lc,gain);
linphone_core_set_remote_ringback_tone (lc,lp_config_get_string(lc->config,"sound","ringback_tone",NULL));
+
+ /*just parse requested stream feature once at start to print out eventual errors*/
+ linphone_core_get_audio_features(lc);
}
static void sip_config_read(LinphoneCore *lc)
*/
#include "private.h"
+#include "lpconfig.h"
#include "mediastreamer2/mediastream.h"
#include <stdlib.h>
#include <stdio.h>
return cfg->magic==linphone_proxy_config_magic ? cfg : NULL;
}
+unsigned int linphone_core_get_audio_features(LinphoneCore *lc){
+ unsigned int ret=0;
+ const char *features=lp_config_get_string(lc->config,"sound","features",NULL);
+ if (features){
+ char tmp[256]={0};
+ char name[256];
+ char *p,*n;
+ strncpy(tmp,features,sizeof(tmp)-1);
+ for(p=tmp;*p!='\0';p++){
+ if (*p==' ') continue;
+ n=strchr(p,'|');
+ if (n) *n='\0';
+ sscanf(p,"%s",name);
+ ms_message("Found audio feature %s",name);
+ if (strcasecmp(name,"PLC")==0) ret|=AUDIO_STREAM_FEATURE_PLC;
+ else if (strcasecmp(name,"EC")==0) ret|=AUDIO_STREAM_FEATURE_EC;
+ else if (strcasecmp(name,"EQUALIZER")==0) ret|=AUDIO_STREAM_FEATURE_EQUALIZER;
+ else if (strcasecmp(name,"VOL_SND")==0) ret|=AUDIO_STREAM_FEATURE_VOL_SND;
+ else if (strcasecmp(name,"VOL_RCV")==0) ret|=AUDIO_STREAM_FEATURE_VOL_RCV;
+ else if (strcasecmp(name,"DTMF")==0) ret|=AUDIO_STREAM_FEATURE_DTMF;
+ else if (strcasecmp(name,"DTMF_ECHO")==0) ret|=AUDIO_STREAM_FEATURE_DTMF_ECHO;
+ else if (strcasecmp(name,"ALL")==0) ret|=AUDIO_STREAM_FEATURE_ALL;
+ else if (strcasecmp(name,"NONE")==0) ret=0;
+ else ms_error("Unsupported audio feature %s requested in config file.",name);
+ if (!n) break;
+ p=n;
+ }
+ }else ret=AUDIO_STREAM_FEATURE_ALL;
+ return ret;
+}
+
#ifdef HAVE_GETIFADDRS
-
void _linphone_core_configure_resolver(){
/*bionic declares _res but does not define nor export it !!*/
#ifdef ANDROID
void linphone_core_conference_check_uninit(LinphoneCore *lc);
bool_t linphone_core_sound_resources_available(LinphoneCore *lc);
void linphone_core_notify_refer_state(LinphoneCore *lc, LinphoneCall *referer, LinphoneCall *newcall);
+unsigned int linphone_core_get_audio_features(LinphoneCore *lc);
void __linphone_core_invalidate_registers(LinphoneCore* lc);
void _linphone_core_codec_config_write(LinphoneCore *lc);