Commit 1b5b4827 authored by Guillaume Beraudo's avatar Guillaume Beraudo
Browse files

Merge branch 'master' of git://git.savannah.nongnu.org/linphone

parents c007bf6d 9dc22255
......@@ -107,7 +107,7 @@ static int copy_file(const char *from, const char *to);
#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);
......@@ -161,7 +161,7 @@ static int trace_level = 0;
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;
......@@ -630,7 +630,7 @@ main (int argc, char *argv[]) {
if (! linphonec_init(argc, argv) ) exit(EXIT_FAILURE);
linphonec_main_loop (linphonec, sipAddr);
linphonec_main_loop (linphonec);
linphonec_finish(EXIT_SUCCESS);
......@@ -985,6 +985,14 @@ linphonec_idle_call ()
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 )
{
......@@ -1073,21 +1081,13 @@ static void print_prompt(LinphoneCore *opm){
}
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 */
......@@ -1195,7 +1195,7 @@ linphonec_parse_cmdline(int argc, char **argv)
{
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)
{
......
......@@ -649,10 +649,14 @@ void linphone_call_init_media_streams(LinphoneCall *call){
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));
{
......@@ -859,7 +863,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
{
const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc,
SalProtoRtpAvp,SalAudio);
if (stream && stream->dir!=SalStreamInactive){
if (stream && stream->dir!=SalStreamInactive && stream->port!=0){
MSSndCard *playcard=lc->sound_conf.lsd_card ?
lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard;
MSSndCard *captcard=lc->sound_conf.capt_sndcard;
......@@ -941,7 +945,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
lc->previewstream=NULL;
}
call->current_params.has_video=FALSE;
if (vstream && vstream->dir!=SalStreamInactive) {
if (vstream && vstream->dir!=SalStreamInactive && vstream->port!=0) {
const char *addr=vstream->addr[0]!='\0' ? vstream->addr : call->resultdesc->addr;
call->video_profile=make_profile(call,call->resultdesc,vstream,&used_pt);
if (used_pt!=-1){
......@@ -1009,6 +1013,14 @@ static void linphone_call_log_fill_stats(LinphoneCallLog *log, AudioStream *st){
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;
......
......@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define MAX_LEN 1024
#define MAX_LEN 32768
#include "linphonecore.h"
......
......@@ -241,8 +241,14 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription
if (desc->ptime>0) sdp_message_a_attribute_add(msg,lineno,osip_strdup("ptime"),
int_2char(desc->ptime));
strip_well_known_rtpmaps=ms_list_size(desc->payloads)>5;
for(elem=desc->payloads;elem!=NULL;elem=elem->next){
add_payload(msg, lineno, (PayloadType*)elem->data,strip_well_known_rtpmaps);
if (desc->payloads){
for(elem=desc->payloads;elem!=NULL;elem=elem->next){
add_payload(msg, lineno, (PayloadType*)elem->data,strip_well_known_rtpmaps);
}
}else{
/* to comply with SDP we cannot have an empty payload type number list */
/* as it happens only when mline is declined with a zero port, it does not matter to put whatever codec*/
sdp_message_m_payload_add (msg,lineno, int_2char (0));
}
switch(desc->dir){
case SalStreamSendRecv:
......
mediastreamer2 @ 39a3f4dd
Subproject commit 5c2fe943251c5af493d18133251abf91e0ce5e83
Subproject commit 39a3f4ddd4a0f60cdd563fdef1d1b7d6e04d140d
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment