From cd009860b2e01ecd1948b603bc5f5fe358089cc4 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 18 Jun 2010 10:56:51 +0200 Subject: [PATCH 01/32] add codec management to java api --- build/android/Android.mk | 1 - coreapi/linphonecore.c | 24 ++++++++++ coreapi/linphonecore.h | 8 ++++ coreapi/linphonecore_jni.cc | 45 +++++++++++++++++++ .../org/linphone/core/LinphoneCore.java | 11 +++++ .../linphone/core/LinphoneProxyConfig.java | 3 ++ .../common/org/linphone/core/PayloadType.java | 23 ++++++++++ mediastreamer2 | 2 +- 8 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 java/common/org/linphone/core/PayloadType.java diff --git a/build/android/Android.mk b/build/android/Android.mk index 50ad5bef2..e402eca74 100755 --- a/build/android/Android.mk +++ b/build/android/Android.mk @@ -71,7 +71,6 @@ LOCAL_C_INCLUDES += \ LOCAL_LDLIBS += -llog LOCAL_STATIC_LIBRARIES := \ - libmsandroidsnd \ libmediastreamer2 \ libortp \ libspeex \ diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 75bfee8ab..4ae24d0e9 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3777,3 +3777,27 @@ void linphone_core_destroy(LinphoneCore *lc){ ms_free(lc); } +static PayloadType* find_payload_type_from_list(const char* type, int rate,const MSList* from) { + const MSList *elem; + for(elem=from;elem!=NULL;elem=elem->next){ + PayloadType *pt=(PayloadType*)elem->data; + if ((strcmp((char*)type, payload_type_get_mime(pt)) == 0) && rate==pt->clock_rate) { + return pt; + } + } + return NULL; +} + +PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate) { + PayloadType* result = find_payload_type_from_list(type, rate, linphone_core_get_audio_codecs(lc)); + if (result) { + return result; + } else { + result = find_payload_type_from_list(type, rate, linphone_core_get_video_codecs(lc)); + if (result) { + return result; + } + } + //not found + return NULL; +} diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index b780956ff..87305e449 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -573,6 +573,14 @@ bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, PayloadType *pt); int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bool_t enable); +/* + * get payload type from mime type an clock rate + * @ingroup media_parameters + * iterates both audio an video + * return NULL if not found + */ +PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate) ; + const char *linphone_core_get_payload_type_description(LinphoneCore *lc, PayloadType *pt); bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType *pt); diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 7efc94ff5..6d868675a 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -337,6 +337,23 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isMicMuted( JNIEnv* ,jlong lc) { return linphone_core_is_mic_muted((LinphoneCore*)lc); } +extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findPayloadType(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jstring jmime + ,jint rate) { + const char* mime = env->GetStringUTFChars(jmime, NULL); + jlong result = (jlong)linphone_core_find_payload_type((LinphoneCore*)lc,mime,rate); + env->ReleaseStringUTFChars(jmime, mime); + return result; +} +extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jlong pt + ,jboolean enable) { + return linphone_core_enable_payload_type((LinphoneCore*)lc,(PayloadType*)pt,enable); +} @@ -377,6 +394,20 @@ extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getProxy(JNIEn return NULL; } } +extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_setRoute(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jroute) { + const char* route = env->GetStringUTFChars(jroute, NULL); + int err=linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,route); + env->ReleaseStringUTFChars(jroute, route); + return err; +} +extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getRoute(JNIEnv* env,jobject thiz,jlong proxyCfg) { + const char* route = linphone_proxy_config_get_route((LinphoneProxyConfig*)proxyCfg); + if (route) { + return env->NewStringUTF(route); + } else { + return NULL; + } +} extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enableRegister(JNIEnv* env,jobject thiz,jlong proxyCfg,jboolean enableRegister) { linphone_proxy_config_enable_register((LinphoneProxyConfig*)proxyCfg,enableRegister); @@ -553,3 +584,17 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCallLogImpl_isIncoming(JNIEnv ,jlong ptr) { return ((LinphoneCallLog*)ptr)->dir==LinphoneCallIncoming?JNI_TRUE:JNI_FALSE; } + +extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env + ,jobject thiz + ,jlong ptr) { + + PayloadType* pt = (PayloadType*)ptr; + char* value = ms_strdup_printf("[%s] clock [%s], bitrate [%s]" + ,payload_type_get_mime(pt) + ,payload_type_get_rate(pt) + ,payload_type_get_bitrate(pt)); + jstring jvalue =env->NewStringUTF(value); + ms_free(value); + return jvalue; +} diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 3b34ec7d7..bd153c74a 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -185,4 +185,15 @@ public interface LinphoneCore { * */ public void clearCallLogs(); + + + /*** + * get payload type from mime type an clock rate + * + * return null if not found + */ + public PayloadType findPayloadType(String mime,int clockRate); + + public void enablePayloadType(PayloadType pt, boolean enable) throws LinphoneCoreException; + } diff --git a/java/common/org/linphone/core/LinphoneProxyConfig.java b/java/common/org/linphone/core/LinphoneProxyConfig.java index e705ab8fb..236bded39 100644 --- a/java/common/org/linphone/core/LinphoneProxyConfig.java +++ b/java/common/org/linphone/core/LinphoneProxyConfig.java @@ -72,4 +72,7 @@ public interface LinphoneProxyConfig { public String getProxy(); public boolean registerEnabled(); public boolean isRegistered(); + public void setRoute(String routeUri) throws LinphoneCoreException; + public String getRoute(); + } diff --git a/java/common/org/linphone/core/PayloadType.java b/java/common/org/linphone/core/PayloadType.java new file mode 100644 index 000000000..59a64699b --- /dev/null +++ b/java/common/org/linphone/core/PayloadType.java @@ -0,0 +1,23 @@ +/* +PayloadType.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +package org.linphone.core; + +public interface PayloadType { + +} diff --git a/mediastreamer2 b/mediastreamer2 index a6484a846..55d14a76f 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit a6484a8463b62a60d03ef8358b2e305408f3b011 +Subproject commit 55d14a76fa81b5941aec6cd272b3b69688e54e56 From b98b1073cd963a8cd731a5ff4e7fd1ab1d410f1e Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 18 Jun 2010 17:33:43 +0200 Subject: [PATCH 02/32] advance ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 55d14a76f..bc6cdb650 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 55d14a76fa81b5941aec6cd272b3b69688e54e56 +Subproject commit bc6cdb650a9fc76d00380221eb0198ba4bb96812 From f342c26cd83951e319a029f7c3c06091d086d442 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 23 Jun 2010 16:34:12 +0200 Subject: [PATCH 03/32] merge patch to parametrize video codecs in linphonec. fix unterminated calls in some rare cases --- NEWS | 8 ++++ configure.in | 2 +- console/commands.c | 84 ++++++++++++++++++++++++++++++------------ coreapi/linphonecore.c | 3 +- coreapi/sal_eXosip2.c | 3 ++ mediastreamer2 | 2 +- 6 files changed, 76 insertions(+), 26 deletions(-) diff --git a/NEWS b/NEWS index 05b7a5ac6..826dbc65b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +linphone-3.3.2 -- June 23, 2010 + * fix crash when setting firewall address in gtk interface + * fix crash while closing video window on windows + * fix un-sent BYE message in some rare cases. + Requires: + mediastreamer2-2.6.0 + ortp-0.16.3 + linphone-3.3.1 -- June 3, 2010 * fix bugs when carrying non ascii displaynames in SIP messages * fix crash when codecs are incompatible diff --git a/configure.in b/configure.in index 10af6c770..e7edf835e 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([linphone],[3.3.1],[linphone-developers@nongnu.org]) +AC_INIT([linphone],[3.3.2],[linphone-developers@nongnu.org]) AC_CANONICAL_SYSTEM dnl Source packaging numbers diff --git a/console/commands.c b/console/commands.c index 967e03578..b46edc194 100644 --- a/console/commands.c +++ b/console/commands.c @@ -41,6 +41,9 @@ #include #endif +#define AUDIO 0 +#define VIDEO 1 + /*************************************************************************** * * Forward declarations @@ -76,7 +79,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args); static int lpc_cmd_status(LinphoneCore *lc, char *args); static int lpc_cmd_ports(LinphoneCore *lc, char *args); static int lpc_cmd_speak(LinphoneCore *lc, char *args); -static int lpc_cmd_codec(LinphoneCore *lc, char *args); +static int lpc_cmd_acodec(LinphoneCore *lc, char *args); +static int lpc_cmd_vcodec(LinphoneCore *lc, char *args); +static int lpc_cmd_codec(int type, LinphoneCore *lc, char *args); static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args); static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args); static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args); @@ -98,9 +103,9 @@ static int linphonec_friend_add(LinphoneCore *lc, const char *name, const char * #endif static int linphonec_friend_delete(LinphoneCore *lc, int num); static int linphonec_friend_delete(LinphoneCore *lc, int num); -static void linphonec_codec_list(LinphoneCore *lc); -static void linphonec_codec_enable(LinphoneCore *lc, int index); -static void linphonec_codec_disable(LinphoneCore *lc, int index); +static void linphonec_codec_list(int type, LinphoneCore *lc); +static void linphonec_codec_enable(int type, LinphoneCore *lc, int index); +static void linphonec_codec_disable(int type, LinphoneCore *lc, int index); @@ -218,10 +223,14 @@ LPC_COMMAND commands[] = { "'speak ' : speak a text using the specified espeak voice.\n" "Example for english voice: 'speak default Hello my friend !'" }, - { "codec", lpc_cmd_codec, "Codec configuration", - "'codec list' : list codecs\n" - "'codec enable ' : enable available codec\n" - "'codec disable ' : disable codecs" }, + { "codec", lpc_cmd_acodec, "Audio codec configuration", + "'codec list' : list audio codecs\n" + "'codec enable ' : enable available audio codec\n" + "'codec disable ' : disable audio codec" }, + { "vcodec", lpc_cmd_vcodec, "Video codec configuration", + "'vcodec list' : list video codecs\n" + "'vcodec enable ' : enable available video codec\n" + "'vcodec disable ' : disable video codec" }, { "ec", lpc_cmd_echocancellation, "Echo cancellation", "'ec on [] [] []' : turn EC on with given delay, tail length and framesize\n" "'ec off' : turn echo cancellation (EC) off\n" @@ -1690,7 +1699,15 @@ static int lpc_cmd_speak(LinphoneCore *lc, char *args){ return 1; } -static int lpc_cmd_codec(LinphoneCore *lc, char *args){ +static int lpc_cmd_acodec(LinphoneCore *lc, char *args){ + return lpc_cmd_codec(AUDIO, lc, args); +} + +static int lpc_cmd_vcodec(LinphoneCore *lc, char *args){ + return lpc_cmd_codec(VIDEO, lc, args); +} + +static int lpc_cmd_codec(int type, LinphoneCore *lc, char *args){ char *arg1 = args; char *arg2 = NULL; char *ptr = args; @@ -1711,20 +1728,20 @@ static int lpc_cmd_codec(LinphoneCore *lc, char *args){ #ifdef HAVE_READLINE rl_inhibit_completion=1; #endif - if (!strcmp(arg2,"all")) linphonec_codec_enable(lc,-1); - else linphonec_codec_enable(lc,atoi(arg2)); + if (!strcmp(arg2,"all")) linphonec_codec_enable(type,lc,-1); + else linphonec_codec_enable(type,lc,atoi(arg2)); #ifdef HAVE_READLINE rl_inhibit_completion=0; #endif } else if (strcmp(arg1,"list")==0) { - linphonec_codec_list(lc); + linphonec_codec_list(type,lc); } else if (strcmp(arg1,"disable")==0) { - if (!strcmp(arg2,"all")) linphonec_codec_disable(lc,-1); - else linphonec_codec_disable(lc,atoi(arg2)); + if (!strcmp(arg2,"all")) linphonec_codec_disable(type,lc,-1); + else linphonec_codec_disable(type,lc,atoi(arg2)); } else { @@ -1734,12 +1751,19 @@ static int lpc_cmd_codec(LinphoneCore *lc, char *args){ return 1; } -static void linphonec_codec_list(LinphoneCore *lc){ +static void linphonec_codec_list(int type, LinphoneCore *lc){ PayloadType *pt; codecs_config_t *config=&lc->codecs_conf; int index=0; - MSList *node; - for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){ + MSList *node=NULL; + + if (type == AUDIO) { + node=config->audio_codecs; + } else if(type==VIDEO) { + node=config->video_codecs; + } + + for(;node!=NULL;node=ms_list_next(node)){ pt=(PayloadType*)(node->data); linphonec_out("%2d: %s (%d) %s\n", index, pt->mime_type, pt->clock_rate, linphone_core_payload_type_enabled(lc,pt) ? "enabled" : "disabled"); @@ -1747,12 +1771,19 @@ static void linphonec_codec_list(LinphoneCore *lc){ } } -static void linphonec_codec_enable(LinphoneCore *lc, int sel_index){ +static void linphonec_codec_enable(int type, LinphoneCore *lc, int sel_index){ PayloadType *pt; codecs_config_t *config=&lc->codecs_conf; int index=0; - MSList *node; - for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){ + MSList *node=NULL; + + if (type == AUDIO) { + node=config->audio_codecs; + } else if(type==VIDEO) { + node=config->video_codecs; + } + + for(;node!=NULL;node=ms_list_next(node)){ if (index == sel_index || sel_index == -1) { pt=(PayloadType*)(node->data); pt->flags|=PAYLOAD_TYPE_ENABLED; @@ -1762,12 +1793,19 @@ static void linphonec_codec_enable(LinphoneCore *lc, int sel_index){ } } -static void linphonec_codec_disable(LinphoneCore *lc, int sel_index){ +static void linphonec_codec_disable(int type, LinphoneCore *lc, int sel_index){ PayloadType *pt; codecs_config_t *config=&lc->codecs_conf; int index=0; - MSList *node; - for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){ + MSList *node=NULL; + + if (type == AUDIO) { + node=config->audio_codecs; + } else if(type==VIDEO) { + node=config->video_codecs; + } + + for(;node!=NULL;node=ms_list_next(node)){ if (index == sel_index || sel_index == -1) { pt=(PayloadType*)(node->data); pt->flags&=~PAYLOAD_TYPE_ENABLED; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index a6911b301..ccc40a810 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1207,7 +1207,8 @@ int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact) /*result must be an array of chars at least LINPHONE_IPADDR_SIZE */ void linphone_core_get_local_ip(LinphoneCore *lc, const char *dest, char *result){ - if (linphone_core_get_firewall_policy(lc)==LINPHONE_POLICY_USE_NAT_ADDRESS){ + if (linphone_core_get_firewall_policy(lc)==LINPHONE_POLICY_USE_NAT_ADDRESS + && linphone_core_get_nat_address(lc)!=NULL){ strncpy(result,linphone_core_get_nat_address(lc),LINPHONE_IPADDR_SIZE); return; } diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index bd3e7e664..19e3a2196 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -889,6 +889,9 @@ static void call_accepted(Sal *sal, eXosip_event_t *ev){ ms_error("A closed call is accepted ?"); return; } + + op->did=ev->did; + sdp=eXosip_get_sdp_info(ev->response); if (sdp){ op->base.remote_media=sal_media_description_new(); diff --git a/mediastreamer2 b/mediastreamer2 index bc6cdb650..0401519a5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit bc6cdb650a9fc76d00380221eb0198ba4bb96812 +Subproject commit 0401519a5946e9216c836ef6271bb2b3bf688179 From 690fb3a6af9d411cb6a21976a94beb4a6e352db3 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 24 Jun 2010 10:22:18 +0200 Subject: [PATCH 04/32] echo limiter clarified --- console/shell.c | 4 ++++ coreapi/linphonecore.c | 39 +++++++++++++++++++-------------------- mediastreamer2 | 2 +- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/console/shell.c b/console/shell.c index 0f0906439..e61a6e514 100644 --- a/console/shell.c +++ b/console/shell.c @@ -142,7 +142,11 @@ static void spawn_linphonec(int argc, char *argv[]){ } args[j++]=NULL; +#ifdef __uClinux__ pid = vfork(); +#else + pid = fork(); +#endif if (pid < 0){ fprintf(stderr,"Could not fork\n"); exit(-1); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index ccc40a810..5e0555bc7 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2174,8 +2174,8 @@ void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){ const char *type=lp_config_get_string(lc->config,"sound","el_type","mic"); if (strcasecmp(type,"mic")==0) audio_stream_enable_echo_limiter(lc->audiostream,ELControlMic); - else if (strcasecmp(type,"speaker")==0) - audio_stream_enable_echo_limiter(lc->audiostream,ELControlSpeaker); + else if (strcasecmp(type,"full")==0) + audio_stream_enable_echo_limiter(lc->audiostream,ELControlFull); } audio_stream_enable_gain_control(lc->audiostream,TRUE); if (linphone_core_echo_cancellation_enabled(lc)){ @@ -2241,9 +2241,10 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){ static void post_configure_audio_streams(LinphoneCore *lc){ AudioStream *st=lc->audiostream; - float gain=lp_config_get_float(lc->config,"sound","mic_gain",-1); - if (gain!=-1) - audio_stream_set_mic_gain(st,gain); + float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",-1); + float thres = 0; + if (mic_gain!=-1) + audio_stream_set_mic_gain(st,mic_gain); lc->audio_muted=FALSE; float recv_gain = lc->sound_conf.soft_play_lev; if (recv_gain != 0) { @@ -2251,36 +2252,34 @@ static void post_configure_audio_streams(LinphoneCore *lc){ } if (linphone_core_echo_limiter_enabled(lc)){ float speed=lp_config_get_float(lc->config,"sound","el_speed",-1); - float thres=lp_config_get_float(lc->config,"sound","el_thres",-1); + thres=lp_config_get_float(lc->config,"sound","el_thres",-1); float force=lp_config_get_float(lc->config,"sound","el_force",-1); int sustain=lp_config_get_int(lc->config,"sound","el_sustain",-1); MSFilter *f=NULL; - if (st->el_type==ELControlMic){ + if (st->el_type!=ELInactive){ f=st->volsend; if (speed==-1) speed=0.03; - if (force==-1) force=10; - } - else if (st->el_type==ELControlSpeaker){ - f=st->volrecv; - if (speed==-1) speed=0.02; - if (force==-1) force=5; - } - if (speed!=-1) + if (force==-1) force=25; ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed); + ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force); if (thres!=-1) ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres); - if (force!=-1) - ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force); if (sustain!=-1) ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain); - } - if (st->volsend){ + } float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05); float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0); + if (st->volsend){ ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_thres); ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&ng_floorgain); } + if (st->volrecv){ + /* parameters for a limited noise-gate effect, using echo limiter threshold */ + float floorgain = 1/mic_gain; + ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&thres); + ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&floorgain); + } parametrize_equalizer(lc,st); if (lc->vtable.dtmf_received!=NULL){ /* replace by our default action*/ @@ -3007,7 +3006,7 @@ bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc){ void linphone_core_mute_mic(LinphoneCore *lc, bool_t val){ if (lc->audiostream!=NULL){ audio_stream_set_mic_gain(lc->audiostream, - (val==TRUE) ? 0 : 1.0); + (val==TRUE) ? 0 : 1.0); // REVISIT: take mic_gain value if ( linphone_core_get_rtp_no_xmit_on_audio_mute(lc) ){ audio_stream_mute_rtp(lc->audiostream,val); } diff --git a/mediastreamer2 b/mediastreamer2 index 0401519a5..1b3906bb7 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 0401519a5946e9216c836ef6271bb2b3bf688179 +Subproject commit 1b3906bb79d1942854eef377e935fa46dfcf7062 From f194b1b6dc72c00f9296b7a49dd7b5967a048df8 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 25 Jun 2010 11:14:04 +0200 Subject: [PATCH 05/32] advance mediastreamer2 --- NEWS | 2 +- mediastreamer2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 826dbc65b..68bbd71fa 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -linphone-3.3.2 -- June 23, 2010 +linphone-3.3.2 -- June 25, 2010 * fix crash when setting firewall address in gtk interface * fix crash while closing video window on windows * fix un-sent BYE message in some rare cases. diff --git a/mediastreamer2 b/mediastreamer2 index 1b3906bb7..5427df937 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 1b3906bb79d1942854eef377e935fa46dfcf7062 +Subproject commit 5427df9376b8390a9c2c08d482c5324264a6a65e From d32f638f27bb1b91e97c88a2e7f371aae6748d72 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 25 Jun 2010 11:22:45 +0200 Subject: [PATCH 06/32] fix LinphoneAddress.setDisplay with null value --- coreapi/linphonecore_jni.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 6d868675a..7501e25ab 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -562,9 +562,9 @@ extern "C" void Java_org_linphone_core_LinphoneAddressImpl_setDisplayName(JNIEnv ,jobject thiz ,jlong address ,jstring jdisplayName) { - const char* displayName = env->GetStringUTFChars(jdisplayName, NULL); + const char* displayName = jdisplayName!= NULL?env->GetStringUTFChars(jdisplayName, NULL):NULL; linphone_address_set_display_name((LinphoneAddress*)address,displayName); - env->ReleaseStringUTFChars(jdisplayName, displayName); + if (displayName != NULL) env->ReleaseStringUTFChars(jdisplayName, displayName); } From f7dfa70375729c1b24d127c118e817354b1a7b0b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 25 Jun 2010 15:49:47 +0200 Subject: [PATCH 07/32] update mediastreamer2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 5427df937..61c0c75ba 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 5427df9376b8390a9c2c08d482c5324264a6a65e +Subproject commit 61c0c75ba484ed0b09b6354bab240a1a6f922fce From db396ef5e062c12bfbade3b7504576c05212a5ba Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 25 Jun 2010 17:20:06 +0200 Subject: [PATCH 08/32] fix critical bug concerning configuration of MSVolume --- coreapi/linphonecore.c | 40 ++++++++++++++++++++++------------------ coreapi/linphonecore.h | 16 ++++------------ mediastreamer2 | 2 +- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 5e0555bc7..2de23d239 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -620,8 +620,8 @@ static void sound_config_read(LinphoneCore *lc) linphone_core_enable_agc(lc, lp_config_get_int(lc->config,"sound","agc",0)); - gain=lp_config_get_float(lc->config,"sound","soft_play_lev",0); - linphone_core_set_soft_play_level(lc,gain); + gain=lp_config_get_float(lc->config,"sound","playback_gain_db",0); + linphone_core_set_playback_gain_db (lc,gain); } static void sip_config_read(LinphoneCore *lc) @@ -2241,14 +2241,19 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){ static void post_configure_audio_streams(LinphoneCore *lc){ AudioStream *st=lc->audiostream; - float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",-1); + float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",1); float thres = 0; + float recv_gain; + float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05); + float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0); + if (mic_gain!=-1) audio_stream_set_mic_gain(st,mic_gain); lc->audio_muted=FALSE; - float recv_gain = lc->sound_conf.soft_play_lev; + + recv_gain = lc->sound_conf.soft_play_lev; if (recv_gain != 0) { - linphone_core_set_soft_play_level(lc,recv_gain); + linphone_core_set_playback_gain_db (lc,recv_gain); } if (linphone_core_echo_limiter_enabled(lc)){ float speed=lp_config_get_float(lc->config,"sound","el_speed",-1); @@ -2262,14 +2267,13 @@ static void post_configure_audio_streams(LinphoneCore *lc){ if (force==-1) force=25; ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed); ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force); - if (thres!=-1) - ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres); - if (sustain!=-1) - ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain); + if (thres!=-1) + ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres); + if (sustain!=-1) + ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain); + } } - } - float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05); - float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0); + if (st->volsend){ ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_thres); ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&ng_floorgain); @@ -2673,13 +2677,13 @@ void linphone_core_set_ring_level(LinphoneCore *lc, int level){ } /** - * Sets call playback gain in db + * Allow to control play level before entering sound card: gain in db * * @ingroup media_parameters **/ -void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){ - float gain=level; - lc->sound_conf.soft_play_lev=level; +void linphone_core_set_playback_gain_db (LinphoneCore *lc, float gaindb){ + float gain=gaindb; + lc->sound_conf.soft_play_lev=gaindb; AudioStream *st=lc->audiostream; if (!st) return; /*just return*/ @@ -2689,11 +2693,11 @@ void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){ } /** - * Returns call playback gain in db + * Get playback gain in db before entering sound card. * * @ingroup media_parameters **/ -float linphone_core_get_soft_play_level(LinphoneCore *lc) { +float linphone_core_get_playback_gain_db(LinphoneCore *lc) { float gain=0; AudioStream *st=lc->audiostream; if (st->volrecv){ diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 87305e449..28ad13587 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -675,18 +675,10 @@ int linphone_core_get_play_level(LinphoneCore *lc); int linphone_core_get_rec_level(LinphoneCore *lc); void linphone_core_set_ring_level(LinphoneCore *lc, int level); void linphone_core_set_play_level(LinphoneCore *lc, int level); -/** - * Allow to control play level before entering sound card: level in db - * - * @ingroup media_parameters -**/ -void linphone_core_set_soft_play_level(LinphoneCore *lc, float level); -/** - * get play level before entering sound card: level in db - * - * @ingroup media_parameters -**/ -float linphone_core_get_soft_play_level(LinphoneCore *lc); + +void linphone_core_set_playback_gain_db(LinphoneCore *lc, float level); + +float linphone_core_get_playback_gain_db(LinphoneCore *lc); void linphone_core_set_rec_level(LinphoneCore *lc, int level); const char * linphone_core_get_ringer_device(LinphoneCore *lc); const char * linphone_core_get_playback_device(LinphoneCore *lc); diff --git a/mediastreamer2 b/mediastreamer2 index 61c0c75ba..b6b2f3006 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 61c0c75ba484ed0b09b6354bab240a1a6f922fce +Subproject commit b6b2f3006fd2d4331be838fdb34e363f0ea8eed5 From fc856b97ae7e6c8f7346d7a108b20cf73a9fa0f1 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 28 Jun 2010 17:22:44 +0200 Subject: [PATCH 09/32] add EC jni methods --- coreapi/linphonecore_jni.cc | 21 ++++++++++++++----- .../org/linphone/core/LinphoneCore.java | 8 +++++-- mediastreamer2 | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 7501e25ab..3a5511a00 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -292,17 +292,17 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setNetworkStateReachable linphone_core_set_network_reachable((LinphoneCore*)lc,isReachable); } -extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSoftPlayLevel( JNIEnv* env +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPlaybackGain( JNIEnv* env ,jobject thiz ,jlong lc ,jfloat gain) { - linphone_core_set_soft_play_level((LinphoneCore*)lc,gain); + linphone_core_set_playback_gain_db((LinphoneCore*)lc,gain); } -extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getSoftPlayLevel( JNIEnv* env +extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getPlaybackGain( JNIEnv* env ,jobject thiz ,jlong lc) { - return linphone_core_get_soft_play_level((LinphoneCore*)lc); + return linphone_core_get_playback_gain_db((LinphoneCore*)lc); } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_muteMic( JNIEnv* env @@ -354,7 +354,18 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType(JNIEn ,jboolean enable) { return linphone_core_enable_payload_type((LinphoneCore*)lc,(PayloadType*)pt,enable); } - +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jboolean enable) { + linphone_core_enable_echo_cancellation((LinphoneCore*)lc,enable); +} +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isEchoCancellationEnabled(JNIEnv* env + ,jobject thiz + ,jlong lc + ) { + return linphone_core_echo_cancellation_enabled((LinphoneCore*)lc); +} //ProxyConfig diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index bd153c74a..bb78726aa 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -159,12 +159,12 @@ public interface LinphoneCore { * Allow to control play level before entering sound card: * @param level in db */ - public void setSoftPlayLevel(float gain); + public void setPlaybackGain(float gain); /** * get play level before entering sound card: * @return level in db */ - public float getSoftPlayLevel(); + public float getPlaybackGain(); /** * Mutes or unmutes the local microphone. * @param isMuted @@ -196,4 +196,8 @@ public interface LinphoneCore { public void enablePayloadType(PayloadType pt, boolean enable) throws LinphoneCoreException; + public void enableEchoCancellation(boolean enable); + + public boolean isEchoCancellationEnabled(); + } diff --git a/mediastreamer2 b/mediastreamer2 index b6b2f3006..5267b9b3e 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit b6b2f3006fd2d4331be838fdb34e363f0ea8eed5 +Subproject commit 5267b9b3e66519a17d75735e65ae0534ebfe3ff1 From 94fdd26f225d63a2be2fb2bb1ef4e27275431ac7 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 28 Jun 2010 23:00:36 +0200 Subject: [PATCH 10/32] add msilbc for android armv7 --- build/android/Android.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/android/Android.mk b/build/android/Android.mk index e402eca74..47aec3448 100755 --- a/build/android/Android.mk +++ b/build/android/Android.mk @@ -77,7 +77,10 @@ LOCAL_STATIC_LIBRARIES := \ libeXosip2 \ libosip2 \ libgsm -# libmsilbc \ +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) + LOCAL_CFLAGS += -DHAVE_ILBC=1 + LOCAL_STATIC_LIBRARIES += libmsilbc +endif LOCAL_MODULE_CLASS = SHARED_LIBRARIES include $(BUILD_SHARED_LIBRARY) From 27de7063632c0f13183203582fba85de5ca465b1 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 29 Jun 2010 11:25:09 +0200 Subject: [PATCH 11/32] fix unused fmtp when receiving sdp answer --- coreapi/offeranswer.c | 4 ++-- mediastreamer2 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index 2abf7174d..d69a22ddd 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -59,8 +59,8 @@ static MSList *match_payloads(const MSList *local, const MSList *remote){ matched=find_payload_type_best_match(local,p2); if (matched){ matched=payload_type_clone(matched); - if (p2->recv_fmtp) - payload_type_set_send_fmtp(matched,p2->recv_fmtp); + if (p2->send_fmtp) + payload_type_set_send_fmtp(matched,p2->send_fmtp); res=ms_list_append(res,matched); payload_type_set_number(matched,payload_type_get_number(p2)); }else{ diff --git a/mediastreamer2 b/mediastreamer2 index b6b2f3006..83533eea4 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit b6b2f3006fd2d4331be838fdb34e363f0ea8eed5 +Subproject commit 83533eea4df856c55b54dfa8afcb96dde93c05f9 From 754c5bb6891a8ce16ba7877c1a2fbcccab7c7534 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 30 Jun 2010 09:51:47 +0200 Subject: [PATCH 12/32] add ilbc to android --- coreapi/linphonecore_jni.cc | 4 +++- mediastreamer2 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 3a5511a00..958170e24 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -161,9 +161,11 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv* LinphoneCoreData* ldata = new LinphoneCoreData(env,thiz,jlistener,juserdata); #ifdef ANDROID ms_andsnd_register_card(jvm); - // requires an fpu libmsilbc_init(); #endif /*ANDROID*/ +#ifdef HAVE_ILBC + libmsilbc_init(); // requires an fpu +#endif jlong nativePtr = (jlong)linphone_core_new( &ldata->vTable ,userConfig ,factoryConfig diff --git a/mediastreamer2 b/mediastreamer2 index 5267b9b3e..adc5516c1 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 5267b9b3e66519a17d75735e65ae0534ebfe3ff1 +Subproject commit adc5516c11707314ae5e17bb5fcd32373710f510 From 8d869f704ffd9d8456478853bf107d39d513dcb5 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 30 Jun 2010 10:33:58 +0200 Subject: [PATCH 13/32] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index adc5516c1..fb5609804 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit adc5516c11707314ae5e17bb5fcd32373710f510 +Subproject commit fb5609804eb8baf4bb55550230e3aa2b18e57d19 From 26913d3cd5d6cb0fc0fcc204aba46c6bb2254429 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 30 Jun 2010 11:07:07 +0200 Subject: [PATCH 14/32] update ms2 Conflicts: mediastreamer2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 83533eea4..fe1b42af3 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 83533eea4df856c55b54dfa8afcb96dde93c05f9 +Subproject commit fe1b42af3dc102d873fb77ecd72dfc96c3771d2a From ab5503fca8ef3932bb5211396893012c9ef4ef6d Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 30 Jun 2010 12:09:48 +0200 Subject: [PATCH 15/32] add missing sip: for routes --- coreapi/proxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 59d767303..4d31f5071 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -167,7 +167,12 @@ int linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route) ms_free(obj->reg_route); obj->reg_route=NULL; } - obj->reg_route=ms_strdup(route); + if (route!=NULL){ + /*try to prepend 'sip:' */ + if (strstr(route,"sip:")==NULL){ + obj->reg_route=ms_strdup_printf("sip:%s",route); + }else obj->reg_route=ms_strdup(route); + } return 0; } From ca0cf4725e8b71e9d4f70ee9f559020d93273e6b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 30 Jun 2010 12:40:07 +0200 Subject: [PATCH 16/32] add a [sound] dc_removal property item to enable DC removal on mic->rtp MSVolume --- coreapi/linphonecore.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 2de23d239..121b32924 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2246,6 +2246,7 @@ static void post_configure_audio_streams(LinphoneCore *lc){ float recv_gain; float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05); float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0); + int dc_removal=lp_config_get_int(lc->config,"sound","dc_removal",0); if (mic_gain!=-1) audio_stream_set_mic_gain(st,mic_gain); @@ -2255,6 +2256,9 @@ static void post_configure_audio_streams(LinphoneCore *lc){ if (recv_gain != 0) { linphone_core_set_playback_gain_db (lc,recv_gain); } + if (st->volsend){ + ms_filter_call_method(st->volsend,MS_VOLUME_REMOVE_DC,&dc_removal); + } if (linphone_core_echo_limiter_enabled(lc)){ float speed=lp_config_get_float(lc->config,"sound","el_speed",-1); thres=lp_config_get_float(lc->config,"sound","el_thres",-1); From 32eba752db302854c5c22af738a8568c80fafc3c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 1 Jul 2010 14:30:38 +0200 Subject: [PATCH 17/32] ready for release ? --- NEWS | 2 +- mediastreamer2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 68bbd71fa..169f91adc 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -linphone-3.3.2 -- June 25, 2010 +linphone-3.3.2 -- July 1st, 2010 * fix crash when setting firewall address in gtk interface * fix crash while closing video window on windows * fix un-sent BYE message in some rare cases. diff --git a/mediastreamer2 b/mediastreamer2 index fe1b42af3..382ebd73c 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit fe1b42af3dc102d873fb77ecd72dfc96c3771d2a +Subproject commit 382ebd73ca41d70834ee07e7eb6fa5cced6b3ce1 From 0f6e5b355cb45695c86a5a26134a690173972783 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Jul 2010 17:15:47 +0200 Subject: [PATCH 18/32] bugfix in mediastreamer2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 382ebd73c..c80d82259 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 382ebd73ca41d70834ee07e7eb6fa5cced6b3ce1 +Subproject commit c80d82259504474f8742577d2e0ebb1c58f589b4 From dc959b97bd1447d5b434922e7d6822d0d0163966 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 6 Jul 2010 11:37:38 +0200 Subject: [PATCH 19/32] improve a bit processing of errors --- coreapi/callbacks.c | 10 ++++++---- mediastreamer2 | 2 +- po/POTFILES.in | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 531f4542e..6833fba82 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -271,7 +271,7 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de /*char *retrymsg=_("%s. Retry after %i minute(s).");*/ char *msg600=_("User does not want to be disturbed."); char *msg603=_("Call declined."); - char *msg=(char*)details; + const char *msg=details; LinphoneCall *call=lc->call; if (sal_op_get_user_pointer(op)!=lc->call){ @@ -281,11 +281,13 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de if (lc->vtable.show) lc->vtable.show(lc); if (error==SalErrorNoResponse){ + msg=_("No response."); if (lc->vtable.display_status) - lc->vtable.display_status(lc,_("No response.")); + lc->vtable.display_status(lc,msg); }else if (error==SalErrorProtocol){ + msg=details ? details : _("Protocol error."); if (lc->vtable.display_status) - lc->vtable.display_status(lc, details ? details : _("Protocol error.")); + lc->vtable.display_status(lc, msg); }else if (error==SalErrorFailure){ switch(sr){ case SalReasonDeclined: @@ -336,7 +338,7 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de if (call!=NULL) { linphone_call_destroy(call); if (sr!=SalReasonDeclined) gstate_new_state(lc, GSTATE_CALL_ERROR, msg); - else gstate_new_state(lc, GSTATE_CALL_END, NULL); + else gstate_new_state(lc, GSTATE_CALL_END, msg); lc->call=NULL; } } diff --git a/mediastreamer2 b/mediastreamer2 index c80d82259..44d29b3dc 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit c80d82259504474f8742577d2e0ebb1c58f589b4 +Subproject commit 44d29b3dcc1261f9999dfd6d02f86ccee0a18873 diff --git a/po/POTFILES.in b/po/POTFILES.in index 2ca5440ea..2b0f2734f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -71,4 +71,4 @@ mediastreamer2/src/drawdib-display.c mediastreamer2/src/audiomixer.c mediastreamer2/src/chanadapt.c mediastreamer2/src/itc.c - +mediastreamer2/src/extdisplay.c From 61677ff44a00aa7cf4760a6faa34177e4faf4387 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 6 Jul 2010 12:49:41 +0200 Subject: [PATCH 20/32] print error message instead of (null) --- coreapi/linphonecore_jni.cc | 5 +++-- java/common/org/linphone/core/LinphoneCoreListener.java | 3 ++- mediastreamer2 | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 958170e24..fcf3cc1ce 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -83,7 +83,7 @@ public: /*displayStatus(LinphoneCore lc,String message);*/ displayStatusId = env->GetMethodID(listernerClass,"displayStatus","(Lorg/linphone/core/LinphoneCore;Ljava/lang/String;)V"); /*void generalState(LinphoneCore lc,int state); */ - generalStateId = env->GetMethodID(listernerClass,"generalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GeneralState;)V"); + generalStateId = env->GetMethodID(listernerClass,"generalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GeneralState;Ljava/lang/String;)V"); generalStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$GeneralState")); generalStateFromIntId = env->GetStaticMethodID(generalStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$GeneralState;"); @@ -145,7 +145,8 @@ public: env->CallVoidMethod(lcData->listener ,lcData->generalStateId ,lcData->core - ,env->CallStaticObjectMethod(lcData->generalStateClass,lcData->generalStateFromIntId,gstate->new_state)); + ,env->CallStaticObjectMethod(lcData->generalStateClass,lcData->generalStateFromIntId,gstate->new_state), + gstate->message ? env->NewStringUTF(gstate->message) : NULL); } }; diff --git a/java/common/org/linphone/core/LinphoneCoreListener.java b/java/common/org/linphone/core/LinphoneCoreListener.java index f48f8a9eb..be75b946d 100644 --- a/java/common/org/linphone/core/LinphoneCoreListener.java +++ b/java/common/org/linphone/core/LinphoneCoreListener.java @@ -47,5 +47,6 @@ public interface LinphoneCoreListener { * @param state LinphoneCore.GeneralState * @return * */ - public void generalState(LinphoneCore lc,LinphoneCore.GeneralState state); + public void generalState(LinphoneCore lc,LinphoneCore.GeneralState state, String message); } + diff --git a/mediastreamer2 b/mediastreamer2 index 44d29b3dc..7a8923072 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 44d29b3dcc1261f9999dfd6d02f86ccee0a18873 +Subproject commit 7a8923072b42246db45d122798f2ab62e2f46bd0 From 8b565ff7f31e9ae43142771574fd0d68dbbb93cd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Jul 2010 15:46:41 +0200 Subject: [PATCH 21/32] update ortp --- oRTP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oRTP b/oRTP index 18eccd4f3..d4868b641 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 18eccd4f3af64f3bd5293d635a1a169dc77c92ad +Subproject commit d4868b64141773b38ba6e8afe3a371fa57525b2b From f71d25264952373c9115604d8d3df9e276f1ae40 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 9 Jul 2010 12:20:29 +0200 Subject: [PATCH 22/32] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 7a8923072..429baf423 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 7a8923072b42246db45d122798f2ab62e2f46bd0 +Subproject commit 429baf423f2db8673ffa98f7f7d6cbac0c23bde9 From 62dcb3e9da5656d79a09d4a9807d83994832c2a7 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Sun, 11 Jul 2010 16:38:04 +0200 Subject: [PATCH 23/32] add history.png to delivery list --- pixmaps/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am index 6247f4d27..bf2f03a8c 100644 --- a/pixmaps/Makefile.am +++ b/pixmaps/Makefile.am @@ -10,7 +10,7 @@ status-green.png \ status-orange.png \ status-red.png \ status-offline.png \ -contact-orange.png dialer-orange.png \ +contact-orange.png dialer-orange.png history-orange.png\ startcall-green.png stopcall-red.png EXTRA_DIST=$(pixmap_DATA) From 527fdcbda6ea79d874ff13d5e38a341e71b6fe08 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 16 Jul 2010 15:31:17 +0200 Subject: [PATCH 24/32] add sip: when required to server address --- coreapi/proxy.c | 18 ++++++++---------- mediastreamer2 | 2 +- oRTP | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 4d31f5071..154ae06a2 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -90,22 +90,20 @@ bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj){ * - hostnames : sip:sip.example.net **/ int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr){ - LinphoneAddress *addr; - char *try=NULL; + LinphoneAddress *addr=NULL; + char *modified=NULL; if (obj->reg_proxy!=NULL) ms_free(obj->reg_proxy); obj->reg_proxy=NULL; if (server_addr!=NULL && strlen(server_addr)>0){ - addr=linphone_address_new(server_addr); - if (!addr){ - /*try to prepend 'sip:' */ - if (strstr(server_addr,"sip:")==NULL){ - try=ms_strdup_printf("sip:%s",server_addr); - addr=linphone_address_new(try); - ms_free(try); - } + if (strstr(server_addr,"sip:")==NULL){ + modified=ms_strdup_printf("sip:%s",server_addr); + addr=linphone_address_new(modified); + ms_free(modified); } + if (addr==NULL) + addr=linphone_address_new(server_addr); if (addr){ obj->reg_proxy=linphone_address_as_string_uri_only(addr); linphone_address_destroy(addr); diff --git a/mediastreamer2 b/mediastreamer2 index 429baf423..df9cac524 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 429baf423f2db8673ffa98f7f7d6cbac0c23bde9 +Subproject commit df9cac524bbe77240127630fa5d253b19c8fdae7 diff --git a/oRTP b/oRTP index d4868b641..a8076d948 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit d4868b64141773b38ba6e8afe3a371fa57525b2b +Subproject commit a8076d9487ee91d89df221256e0d3371e0fa3f50 From 3e8f9536eeea2e607e7612928f9ca7658bd2ffc4 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Sun, 18 Jul 2010 22:06:58 +0200 Subject: [PATCH 25/32] add mediastreamer2 with iPhone iounit --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index df9cac524..c6d39ca3e 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit df9cac524bbe77240127630fa5d253b19c8fdae7 +Subproject commit c6d39ca3e664ad89a8c437f630817334ada056ca From 5304e69b2e797b761c2122179bcd529f40c4b38d Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 20 Jul 2010 17:02:52 +0200 Subject: [PATCH 26/32] change Linphone version macro to 3.3.x --- build/android/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/android/Android.mk b/build/android/Android.mk index e402eca74..88dcb94c6 100755 --- a/build/android/Android.mk +++ b/build/android/Android.mk @@ -53,7 +53,7 @@ LOCAL_CFLAGS += \ -D_BYTE_ORDER=_LITTLE_ENDIAN \ -DORTP_INET6 \ -DENABLE_TRACE \ - -DLINPHONE_VERSION=\"Linphone-3.1.2\" \ + -DLINPHONE_VERSION=\"Linphone-3.3.x\" \ -DLINPHONE_PLUGINS_DIR=\"\\tmp\" \ -DLOG_DOMAIN=\"Linphone\" From 2b7bd0b0e4c01ae08cb8064d2c70528b9770a807 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 20 Jul 2010 17:38:39 +0200 Subject: [PATCH 27/32] add Android sound card support --- coreapi/linphonecore_jni.cc | 6 +++--- mediastreamer2 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index fcf3cc1ce..67da96a02 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern "C" void libmsilbc_init(); #endif /*ANDROID*/ -extern "C" void ms_andsnd_register_card(JavaVM *jvm) ; +extern "C" void ms_andsnd_set_jvm(JavaVM *jvm) ; static JavaVM *jvm=0; #ifdef ANDROID @@ -44,7 +44,7 @@ static void linphone_android_log_handler(OrtpLogLevel lev, const char *fmt, va_l JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *ajvm, void *reserved) { #ifdef ANDROID - ms_andsnd_register_card(ajvm); + ms_andsnd_set_jvm(ajvm); #endif /*ANDROID*/ jvm=ajvm; return JNI_VERSION_1_2; @@ -161,7 +161,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv* const char* factoryConfig = env->GetStringUTFChars(jfactoryConfig, NULL); LinphoneCoreData* ldata = new LinphoneCoreData(env,thiz,jlistener,juserdata); #ifdef ANDROID - ms_andsnd_register_card(jvm); + ms_andsnd_set_jvm(jvm); #endif /*ANDROID*/ #ifdef HAVE_ILBC diff --git a/mediastreamer2 b/mediastreamer2 index c6d39ca3e..45b7c4ce2 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit c6d39ca3e664ad89a8c437f630817334ada056ca +Subproject commit 45b7c4ce2aa39d313e4cfdd933bf3d795cc6bf24 From 1dc662bf495b150fa456d31b5f18e16d43969b4f Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 21 Jul 2010 14:25:17 +0200 Subject: [PATCH 28/32] init mediastream after call is accepted in case of iPhone build. If mediastream is init to early, linphone issues a SIGPIPE in case of incoming call while in background. fixed error are: Error receiving RTP packet: Socket is not connected. Error receiving RTCP packet: Socket is not connected. linphone process event get a message 15 CALL_ACK Error receiving RTP packet: Socket is not connected. Error receiving RTCP packet: Socket is not connected. Audio MSTicker: We are late of 51 miliseconds. synchronizing timestamp, diff=1520 Error sending rtp packet: Broken pipe ; socket=16 Error sending rtp packet: Broken pipe ; socket=16 Error sending rtp packet: Broken pipe ; socket=16 Error receiving RTP packet: Socket is not connected. Error receiving RTCP packet: Socket is not connected. --- coreapi/callbacks.c | 2 ++ coreapi/linphonecore.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 6833fba82..c94388a9c 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -105,7 +105,9 @@ static void call_received(SalOp *h){ } linphone_call_set_state(call,LCStateRinging); sal_call_notify_ringing(h); +#if !(__IPHONE_OS_VERSION_MIN_REQUIRED >= 40000) linphone_core_init_media_streams(lc,lc->call); +#endif if (lc->vtable.inv_recv) lc->vtable.inv_recv(lc,tmp); ms_free(barmesg); ms_free(tmp); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 121b32924..55b9a7553 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2515,7 +2515,9 @@ int linphone_core_accept_call(LinphoneCore *lc, const char *url) contact=get_fixed_contact(lc,call,cfg); if (contact) sal_op_set_contact(call->op,contact); - +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 + linphone_core_init_media_streams(lc,call); +#endif sal_call_accept(call->op); lc->vtable.display_status(lc,_("Connected.")); gstate_new_state(lc, GSTATE_CALL_IN_CONNECTED, NULL); From 859f06d78a2ae7b1741a14242347220143f211b6 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 22 Jul 2010 17:27:16 +0200 Subject: [PATCH 29/32] update mediastreamer2 with iphone for xcode alldescs --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 45b7c4ce2..d4966d71e 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 45b7c4ce2aa39d313e4cfdd933bf3d795cc6bf24 +Subproject commit d4966d71e98568c25053c9e3ce7dd8dc38cd5f41 From 88b8d036319c53708bd417b741138b0612208dbe Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sat, 24 Jul 2010 22:49:27 +0200 Subject: [PATCH 30/32] update ms2 and ortp --- mediastreamer2 | 2 +- oRTP | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index d4966d71e..4d6503ee3 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit d4966d71e98568c25053c9e3ce7dd8dc38cd5f41 +Subproject commit 4d6503ee370a9343c2df0796eacd8c858dc17b23 diff --git a/oRTP b/oRTP index a8076d948..cb850d469 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit a8076d9487ee91d89df221256e0d3371e0fa3f50 +Subproject commit cb850d4697390dadb480b1eb01211e7f94d8e00b From 484d9f09997127c86a12ea46575dd71257d3b052 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 2 Aug 2010 18:23:44 +0200 Subject: [PATCH 31/32] add set signaling transport to jliblinphone api --- java/common/org/linphone/core/LinphoneCore.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index bb78726aa..c1ca0d4d3 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -70,7 +70,18 @@ public interface LinphoneCore { } } - + static public class Transport { + public final static Transport udp =new Transport("udp"); + public final static Transport tcp =new Transport("tcp"); + private final String mStringValue; + + private Transport(String stringValue) { + mStringValue=stringValue; + } + public String toString() { + return mStringValue; + } + } /** * clear all added proxy config */ @@ -186,6 +197,7 @@ public interface LinphoneCore { */ public void clearCallLogs(); +<<<<<<< master /*** * get payload type from mime type an clock rate @@ -200,4 +212,7 @@ public interface LinphoneCore { public boolean isEchoCancellationEnabled(); +======= + public void setSignalingTransport(Transport aTransport); +>>>>>>> local } From 2cf2a5b104a2cd81b434f44f309cfe7c00c435f6 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 3 Aug 2010 12:31:01 +0200 Subject: [PATCH 32/32] update ms2 and ortp --- mediastreamer2 | 2 +- oRTP | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index 4d6503ee3..4b5164714 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 4d6503ee370a9343c2df0796eacd8c858dc17b23 +Subproject commit 4b5164714c2cf77a284f0213fc79e9b147e8563a diff --git a/oRTP b/oRTP index cb850d469..534074027 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit cb850d4697390dadb480b1eb01211e7f94d8e00b +Subproject commit 534074027a2163694ce6f8a520f0d6f6ac82b15d