diff --git a/NEWS b/NEWS index 05b7a5ac686ce8e9f38366f1889d0a41c4bd08a2..169f91adc6fd6c3ebb7c4861bc763afbb1825b8e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +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. + 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/build/android/Android.mk b/build/android/Android.mk index 50ad5bef283da54e104122ee83f9b857b45bfb41..7432a77222fff84be3c4e3b0d60bd16e23b7f2c0 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\" @@ -71,14 +71,16 @@ LOCAL_C_INCLUDES += \ LOCAL_LDLIBS += -llog LOCAL_STATIC_LIBRARIES := \ - libmsandroidsnd \ libmediastreamer2 \ libortp \ libspeex \ 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) diff --git a/configure.in b/configure.in index 10af6c7706aacc7c948dc7f2e03e656b18592d0c..e7edf835e5c465488ba6e251cf6b5abc007afeaf 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 e6cdca2006e2a622ab862a036045c01dbfdc5e89..9f10a4831d757cd96d8d8188bbf4403f5961811c 100644 --- a/console/commands.c +++ b/console/commands.c @@ -41,6 +41,9 @@ #include <sys/wait.h> #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_pause(LinphoneCore *lc, char *args); static int lpc_cmd_resume(LinphoneCore *lc, char *args); @@ -100,9 +105,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); @@ -224,10 +229,14 @@ LPC_COMMAND commands[] = { "'speak <voice name> <sentence>' : 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 <index>' : enable available codec\n" - "'codec disable <index>' : disable codecs" }, + { "codec", lpc_cmd_acodec, "Audio codec configuration", + "'codec list' : list audio codecs\n" + "'codec enable <index>' : enable available audio codec\n" + "'codec disable <index>' : disable audio codec" }, + { "vcodec", lpc_cmd_vcodec, "Video codec configuration", + "'vcodec list' : list video codecs\n" + "'vcodec enable <index>' : enable available video codec\n" + "'vcodec disable <index>' : disable video codec" }, { "ec", lpc_cmd_echocancellation, "Echo cancellation", "'ec on [<delay>] [<tail>] [<framesize>]' : turn EC on with given delay, tail length and framesize\n" "'ec off' : turn echo cancellation (EC) off\n" @@ -1854,7 +1863,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; @@ -1875,20 +1892,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 { @@ -1898,12 +1915,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"); @@ -1911,12 +1935,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; @@ -1926,12 +1957,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/console/shell.c b/console/shell.c index 0f0906439c10db1e46322412313cc8d88e226580..e61a6e51467c0d88ad3f9ad9e906b72d1fb64733 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/callbacks.c b/coreapi/callbacks.c index 48e2db00580f23383ea90b3cc86006b9eacd73ac..36f21d5a5667db1912914ad6762de7d6ade6ca06 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -133,8 +133,11 @@ static void call_received(SalOp *h){ } call->state=LinphoneCallRinging; sal_call_notify_ringing(h); - linphone_core_init_media_streams(lc,call); +#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,call); +#endif ms_free(barmesg); ms_free(tmp); } @@ -372,7 +375,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=(LinphoneCall*)sal_op_get_user_pointer(op); LinphoneGeneralStateContext gctx; @@ -380,11 +383,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: diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index fa2e0815c84fd8988a20cd4e2af465971a63049a..54b9d6d08dccb87eb52c7e637959fe4afc52d2c0 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -470,8 +470,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) @@ -1068,7 +1068,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; } @@ -2090,8 +2091,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)){ @@ -2157,46 +2158,53 @@ 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; + 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); 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 (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); - 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); - 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 (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 (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); 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*/ @@ -2445,7 +2453,9 @@ int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call) 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); if (lc->vtable.display_status!=NULL) lc->vtable.display_status(lc,_("Connected.")); @@ -2786,13 +2796,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*/ @@ -2802,11 +2812,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){ @@ -3120,7 +3130,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); } @@ -4017,3 +4027,28 @@ int linphone_core_del_call( LinphoneCore *lc, LinphoneCall *call) lc->calls = the_calls; return 0; } + +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 703703a96f62cc713cf461d262083e0e24cc38ef..4d6fb8f6e2e346610c510dbeac6f84be8587cb8f 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -623,6 +623,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); @@ -717,18 +725,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/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 7efc94ff5e9244e1a6aee9cf7c33cdbb7f624fa8..67da96a025d3e2e7fb6c5d029e2c4a9195be4f56 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; @@ -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); } }; @@ -160,10 +161,12 @@ 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); - // requires an fpu libmsilbc_init(); + ms_andsnd_set_jvm(jvm); #endif /*ANDROID*/ +#ifdef HAVE_ILBC + libmsilbc_init(); // requires an fpu +#endif jlong nativePtr = (jlong)linphone_core_new( &ldata->vTable ,userConfig ,factoryConfig @@ -292,17 +295,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 @@ -337,7 +340,35 @@ 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); +} +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 @@ -377,6 +408,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); @@ -531,9 +576,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); } @@ -553,3 +598,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/coreapi/offeranswer.c b/coreapi/offeranswer.c index 2abf7174dfc03c95152fbd6eea4128d3f3897a45..d69a22ddd5805a566a027e5e09aa6bbe87b409d0 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/coreapi/proxy.c b/coreapi/proxy.c index 3639520f478c4310b980253ff8980ccb6ca4f3d6..e4870c78155e4ceff47eb154a2567d978b37108d 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); @@ -167,7 +165,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; } diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 2a2c85516480425dfb747d8ce84918fc68514437..50454640c8259f467811ee2f143f98152e9e3767 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -907,9 +907,9 @@ static void call_accepted(Sal *sal, eXosip_event_t *ev){ ms_error("A closed call is accepted ?"); return; } - if (op->did==-1){ - op->did=ev->did; - } + + op->did=ev->did; + sdp=eXosip_get_sdp_info(ev->response); if (sdp){ op->base.remote_media=sal_media_description_new(); diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 3b34ec7d7b29493a4e3847884874c491893e3696..c1ca0d4d39d8760414c733863be78c5a12693dcc 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 */ @@ -159,12 +170,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 @@ -185,4 +196,23 @@ public interface LinphoneCore { * */ public void clearCallLogs(); + +<<<<<<< master + + /*** + * 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; + + public void enableEchoCancellation(boolean enable); + + public boolean isEchoCancellationEnabled(); + +======= + public void setSignalingTransport(Transport aTransport); +>>>>>>> local } diff --git a/java/common/org/linphone/core/LinphoneCoreListener.java b/java/common/org/linphone/core/LinphoneCoreListener.java index f48f8a9eb00ba526573091d8863e44901733b39e..be75b946d9b326e54307fd8961af873b24fb41d7 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/java/common/org/linphone/core/LinphoneProxyConfig.java b/java/common/org/linphone/core/LinphoneProxyConfig.java index e705ab8fb0fb9973343387e29285190a47be9b4a..236bded395da6c3aa18497e38a66a4b02437452f 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 0000000000000000000000000000000000000000..59a64699b3a998f32a453d43bb3264455a44e86e --- /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 deleted file mode 160000 index bc6cdb650a9fc76d00380221eb0198ba4bb96812..0000000000000000000000000000000000000000 --- a/mediastreamer2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bc6cdb650a9fc76d00380221eb0198ba4bb96812 diff --git a/oRTP b/oRTP index 18eccd4f3af64f3bd5293d635a1a169dc77c92ad..534074027a2163694ce6f8a520f0d6f6ac82b15d 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 18eccd4f3af64f3bd5293d635a1a169dc77c92ad +Subproject commit 534074027a2163694ce6f8a520f0d6f6ac82b15d diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am index 47d2f51ab350d6eb3c4b5e17dad20b51d3267bcd..b462cf8e74116214e7b0165eb85e6aef9050f2a8 100644 --- a/pixmaps/Makefile.am +++ b/pixmaps/Makefile.am @@ -11,7 +11,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) diff --git a/po/POTFILES.in b/po/POTFILES.in index 2ca5440ea8146fda0c0cdb891ee20387c408aa8e..2b0f2734f9e185649c02db51711ea7a0624b354f 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