#endif /*_WIN32_WCE*/
static int linphonec_parse_cmdline(int argc, char **argv);
static int linphonec_init(int argc, char **argv);
-static int linphonec_main_loop (LinphoneCore * opm, char * sipAddr);
+static int linphonec_main_loop (LinphoneCore * opm);
static int linphonec_idle_call (void);
#ifdef HAVE_READLINE
static int linphonec_initialize_readline(void);
static char *logfile_name = NULL;
static char configfile_name[PATH_MAX];
static const char *factory_configfile_name=NULL;
-static char *sipAddr = NULL; /* for autocall */
+static char *sip_addr_to_call = NULL; /* for autocall */
static int window_id = 0; /* 0=standalone window, or window id for embedding video */
#if !defined(_WIN32_WCE)
static ortp_pipe_t client_sock=ORTP_PIPE_INVALID;
if (! linphonec_init(argc, argv) ) exit(EXIT_FAILURE);
- linphonec_main_loop (linphonec, sipAddr);
+ linphonec_main_loop (linphonec);
linphonec_finish(EXIT_SUCCESS);
linphone_core_accept_call(opm,NULL);
answer_call=FALSE;
}
+ /* auto call handling */
+ if (sip_addr_to_call != NULL )
+ {
+ char buf[512];
+ snprintf (buf, sizeof(buf),"call %s", sip_addr_to_call);
+ sip_addr_to_call=NULL;
+ linphonec_parse_command_line(linphonec, buf);
+ }
if ( auth_stack.nitems )
{
}
static int
-linphonec_main_loop (LinphoneCore * opm, char * sipAddr)
+linphonec_main_loop (LinphoneCore * opm)
{
- char buf[LINE_MAX_LEN]; /* auto call handling */
char *input;
print_prompt(opm);
- /* auto call handling */
- if (sipAddr != NULL )
- {
- snprintf (buf, sizeof(buf),"call %s", sipAddr);
- linphonec_parse_command_line(linphonec, buf);
- }
-
while (linphonec_running && (input=linphonec_readline(prompt)))
{
char *iptr; /* input and input pointer */
{
arg_num++;
if (arg_num < argc)
- sipAddr = argv[arg_num];
+ sip_addr_to_call = argv[arg_num];
}
else if (strncmp ("-a", argv[arg_num], 2) == 0)
{
audio_stream_enable_gain_control(audiostream,TRUE);
if (linphone_core_echo_cancellation_enabled(lc)){
int len,delay,framesize;
+ const char *statestr=lp_config_get_string(lc->config,"sound","ec_state",NULL);
len=lp_config_get_int(lc->config,"sound","ec_tail_len",0);
delay=lp_config_get_int(lc->config,"sound","ec_delay",0);
framesize=lp_config_get_int(lc->config,"sound","ec_framesize",0);
audio_stream_set_echo_canceller_params(audiostream,len,delay,framesize);
+ if (statestr && audiostream->ec){
+ ms_filter_call_method(audiostream->ec,MS_ECHO_CANCELLER_SET_STATE_STRING,(void*)statestr);
+ }
}
audio_stream_enable_automatic_gain_control(audiostream,linphone_core_agc_enabled(lc));
{
void linphone_call_stop_media_streams(LinphoneCall *call){
if (call->audiostream!=NULL) {
+ if (call->audiostream->ec){
+ const char *state_str=NULL;
+ ms_filter_call_method(call->audiostream->ec,MS_ECHO_CANCELLER_GET_STATE_STRING,&state_str);
+ if (state_str){
+ ms_message("Writing echo canceller state, %i bytes",strlen(state_str));
+ lp_config_set_string(call->core->config,"sound","ec_state",state_str);
+ }
+ }
linphone_call_log_fill_stats (call->log,call->audiostream);
audio_stream_stop(call->audiostream);
call->audiostream=NULL;