From d61fe35f48364cd7964542dc74ea4950b93edf51 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 4 Feb 2016 16:52:59 +0100 Subject: [PATCH 01/24] Add API to force the use of relay when using ICE (for tests purpose) + add test that does just that. --- coreapi/misc.c | 6 ++++++ coreapi/private.h | 4 +++- mediastreamer2 | 2 +- tester/call_tester.c | 36 ++++++++++++++++++++++++++---------- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/coreapi/misc.c b/coreapi/misc.c index 996d3d867..d2fd020f7 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -624,6 +624,10 @@ const struct addrinfo *linphone_core_get_stun_server_addrinfo(LinphoneCore *lc){ return lc->net_conf.stun_addrinfo; } +void linphone_core_enable_forced_ice_relay(LinphoneCore *lc, bool_t enable) { + lc->forced_ice_relay = enable; +} + int linphone_core_gather_ice_candidates(LinphoneCore *lc, LinphoneCall *call) { char local_addr[64]; @@ -650,6 +654,8 @@ int linphone_core_gather_ice_candidates(LinphoneCore *lc, LinphoneCall *call) } linphone_core_notify_display_status(lc, _("ICE local candidates gathering in progress...")); + ice_session_enable_forced_relay(call->ice_session, lc->forced_ice_relay); + /* Gather local host candidates. */ if (linphone_core_get_local_ip_for(AF_INET, NULL, local_addr) < 0) { ms_error("Fail to get local ip"); diff --git a/coreapi/private.h b/coreapi/private.h index 92e9999d3..715378e82 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -486,6 +486,7 @@ void linphone_core_resolve_stun_server(LinphoneCore *lc); LINPHONE_PUBLIC const struct addrinfo *linphone_core_get_stun_server_addrinfo(LinphoneCore *lc); void linphone_core_adapt_to_network(LinphoneCore *lc, int ping_time_ms, LinphoneCallParams *params); int linphone_core_gather_ice_candidates(LinphoneCore *lc, LinphoneCall *call); +LINPHONE_PUBLIC void linphone_core_enable_forced_ice_relay(LinphoneCore *lc, bool_t enable); void linphone_core_update_ice_state_in_call_stats(LinphoneCall *call); void linphone_call_stats_fill(LinphoneCallStats *stats, MediaStream *ms, OrtpEvent *ev); void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call, SalMediaDescription *result); @@ -937,7 +938,8 @@ struct _LinphoneCore bool_t vtables_running; bool_t send_call_stats_periodical_updates; - bool_t pad[2]; + bool_t forced_ice_relay; + bool_t pad; char localip[LINPHONE_IPADDR_SIZE]; int device_rotation; int max_calls; diff --git a/mediastreamer2 b/mediastreamer2 index dd5ad1b73..bc6574e8c 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit dd5ad1b738989bc6964f889e17f275eea85e11c0 +Subproject commit bc6574e8c7d5a385d89c2cb807e4fb9a6c20f612 diff --git a/tester/call_tester.c b/tester/call_tester.c index c1a267e36..deb1f0c88 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -1110,7 +1110,10 @@ static void check_nb_media_starts(LinphoneCoreManager *caller, LinphoneCoreManag } } -static void _call_with_ice_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports) { +static void _call_with_ice_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports, bool_t forced_relay) { + linphone_core_set_user_agent(pauline->lc, "Natted Linphone", NULL); + linphone_core_set_user_agent(marie->lc, "Natted Linphone", NULL); + if (callee_with_ice){ linphone_core_set_firewall_policy(marie->lc,LinphonePolicyUseIce); } @@ -1127,6 +1130,10 @@ static void _call_with_ice_base(LinphoneCoreManager* pauline,LinphoneCoreManager linphone_core_set_text_port(pauline->lc, -1); } + if (forced_relay == TRUE) { + linphone_core_enable_forced_ice_relay(marie->lc, TRUE); + linphone_core_enable_forced_ice_relay(pauline->lc, TRUE); + } if (!BC_ASSERT_TRUE(call(pauline,marie))) return; @@ -1136,24 +1143,28 @@ static void _call_with_ice_base(LinphoneCoreManager* pauline,LinphoneCoreManager BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallStreamsRunning,2)); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallStreamsRunning,2)); - BC_ASSERT_TRUE(check_ice(pauline,marie,LinphoneIceStateHostConnection)); + if (forced_relay == TRUE) { + BC_ASSERT_TRUE(check_ice(pauline, marie, LinphoneIceStateRelayConnection)); + } else { + BC_ASSERT_TRUE(check_ice(pauline,marie,LinphoneIceStateHostConnection)); + } check_nb_media_starts(pauline, marie, 1, 1); } liblinphone_tester_check_rtcp(marie,pauline); /*then close the call*/ end_call(pauline, marie); - } -static void _call_with_ice(bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports) { + +static void _call_with_ice(bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports, bool_t forced_relay) { LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); - _call_with_ice_base(pauline,marie,caller_with_ice,callee_with_ice,random_ports); + _call_with_ice_base(pauline,marie,caller_with_ice,callee_with_ice,random_ports,forced_relay); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } static void call_with_ice(void){ - _call_with_ice(TRUE,TRUE,FALSE); + _call_with_ice(TRUE,TRUE,FALSE,FALSE); } /*ICE is not expected to work in this case, however this should not crash*/ @@ -1177,15 +1188,19 @@ static void call_with_ice_no_sdp(void){ } static void call_with_ice_random_ports(void){ - _call_with_ice(TRUE,TRUE,TRUE); + _call_with_ice(TRUE,TRUE,TRUE,FALSE); +} + +static void call_with_ice_forced_relay(void) { + _call_with_ice(TRUE, TRUE, TRUE, TRUE); } static void ice_to_not_ice(void){ - _call_with_ice(TRUE,FALSE,FALSE); + _call_with_ice(TRUE,FALSE,FALSE,FALSE); } static void not_ice_to_ice(void){ - _call_with_ice(FALSE,TRUE,FALSE); + _call_with_ice(FALSE,TRUE,FALSE,FALSE); } static void call_with_custom_headers(void) { @@ -2426,7 +2441,7 @@ static void call_with_ice_video_to_novideo(void) { linphone_core_set_video_policy(pauline->lc,&vpol); vpol.automatically_initiate=FALSE; linphone_core_set_video_policy(marie->lc,&vpol); - _call_with_ice_base(pauline,marie,TRUE,TRUE,TRUE); + _call_with_ice_base(pauline,marie,TRUE,TRUE,TRUE,FALSE); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } @@ -6072,6 +6087,7 @@ test_t call_tests[] = { TEST_ONE_TAG("Call with ICE", call_with_ice, "ICE"), TEST_ONE_TAG("Call with ICE without SDP", call_with_ice_no_sdp, "ICE"), TEST_ONE_TAG("Call with ICE (random ports)", call_with_ice_random_ports, "ICE"), + TEST_ONE_TAG("Call with ICE (forced relay)", call_with_ice_forced_relay, "ICE"), TEST_ONE_TAG("Call from ICE to not ICE", ice_to_not_ice, "ICE"), TEST_ONE_TAG("Call from not ICE to ICE", not_ice_to_ice, "ICE"), TEST_NO_TAG("Call with custom headers", call_with_custom_headers), From dc52e150b71b5d19d20e45c5b4fc1baccc48a313 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 4 Feb 2016 21:57:32 +0100 Subject: [PATCH 02/24] adapt android jni to MSFactory usage, and add linphone_core_reload_ms_plugins() as a new way of loading plugins after LinphoneCore has been created. This can be used on platforms where dynamic loading of plugins is not permitted, by doing things in this sequence: 1) Create the LinphoneCore as usual 2) call the libms*_init() routines of the plugins by passing them the MSFactory obtained via linphone_core_get_ms_factory() 3) call linphone_core_reload_ms_plugins() --- coreapi/linphonecore.c | 67 ++++++---- coreapi/linphonecore.h | 8 ++ coreapi/linphonecore_jni.cc | 121 ++++++++++-------- .../org/linphone/core/LinphoneCore.java | 6 + .../org/linphone/core/LinphoneCoreImpl.java | 10 +- mediastreamer2 | 2 +- 6 files changed, 132 insertions(+), 82 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 815b1f1f2..9afb4304f 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1158,8 +1158,7 @@ static bool_t linphone_core_codec_supported(LinphoneCore *lc, SalStreamType type } else if (type == SalText) { return TRUE; } - //ms_filter_codec_supported(mime) - return ms_factory_codec_supported (lc->factory, mime ); + return ms_factory_codec_supported(lc->factory, mime); } @@ -1207,24 +1206,44 @@ static bool_t get_codec(LinphoneCore *lc, SalStreamType type, int index, Payload return TRUE; } +static SalStreamType payload_type_get_stream_type(const PayloadType *pt){ + switch(pt->type){ + case PAYLOAD_AUDIO_PACKETIZED: + case PAYLOAD_AUDIO_CONTINUOUS: + return SalAudio; + break; + case PAYLOAD_VIDEO: + return SalVideo; + break; + case PAYLOAD_TEXT: + return SalText; + break; + } + return SalOther; +} + /*this function merges the payload types from the codec default list with the list read from configuration file. * If a new codec becomes supported in Liblinphone or if the list from configuration file is empty or incomplete, all the supported codecs are added * automatically. This 'l' list is entirely destroyed and rewritten.*/ -static MSList *add_missing_codecs(const MSList *default_list, MSList *l){ +static MSList *add_missing_supported_codecs(LinphoneCore *lc, const MSList *default_list, MSList *l){ const MSList *elem; MSList *newlist; + PayloadType *last_inserted = NULL; for(elem=default_list; elem!=NULL; elem=elem->next){ MSList *elem2=ms_list_find(l,elem->data); if (!elem2){ PayloadType *pt=(PayloadType*)elem->data; /*this codec from default list should be inserted in the list*/ - if (!elem->prev){ + + if (!linphone_core_codec_supported(lc, payload_type_get_stream_type(pt), pt->mime_type)) continue; + if (!last_inserted){ l=ms_list_prepend(l,pt); }else{ - const MSList *after=ms_list_find(l,elem->prev->data); + const MSList *after=ms_list_find(l,last_inserted); l=ms_list_insert(l, after->next, pt); } + last_inserted = pt; ms_message("Supported codec %s/%i fmtp=%s automatically added to codec list.", pt->mime_type, pt->clock_rate, pt->recv_fmtp ? pt->recv_fmtp : ""); } @@ -1262,7 +1281,7 @@ static void codecs_config_read(LinphoneCore *lc) } } if( lp_config_get_int(lc->config, "misc", "add_missing_audio_codecs", 1) == 1 ){ - audio_codecs=add_missing_codecs(lc->default_audio_codecs,audio_codecs); + audio_codecs=add_missing_supported_codecs(lc, lc->default_audio_codecs,audio_codecs); } for (i=0;get_codec(lc,SalVideo,i,&pt);i++){ @@ -1271,7 +1290,7 @@ static void codecs_config_read(LinphoneCore *lc) } } if( lp_config_get_int(lc->config, "misc", "add_missing_video_codecs", 1) == 1 ){ - video_codecs=add_missing_codecs(lc->default_video_codecs,video_codecs); + video_codecs=add_missing_supported_codecs(lc, lc->default_video_codecs,video_codecs); } for (i=0;get_codec(lc,SalText,i,&pt);i++){ @@ -1279,7 +1298,7 @@ static void codecs_config_read(LinphoneCore *lc) text_codecs=codec_append_if_new(text_codecs, pt); } } - text_codecs = add_missing_codecs(lc->default_text_codecs, text_codecs); + text_codecs = add_missing_supported_codecs(lc, lc->default_text_codecs, text_codecs); linphone_core_set_audio_codecs(lc,audio_codecs); linphone_core_set_video_codecs(lc,video_codecs); @@ -1462,20 +1481,18 @@ const char * linphone_core_get_version(void){ static void linphone_core_register_payload_type(LinphoneCore *lc, const PayloadType *const_pt, const char *recv_fmtp, bool_t enabled){ MSList **codec_list = const_pt->type==PAYLOAD_VIDEO ? &lc->default_video_codecs : const_pt->type==PAYLOAD_TEXT ? &lc->default_text_codecs : &lc->default_audio_codecs; - if (linphone_core_codec_supported(lc, (const_pt->type == PAYLOAD_VIDEO) ? SalVideo : const_pt->type == PAYLOAD_TEXT ? SalText : SalAudio, const_pt->mime_type)){ - PayloadType *pt=payload_type_clone(const_pt); - int number=-1; - payload_type_set_enable(pt,enabled); - if (recv_fmtp!=NULL) payload_type_set_recv_fmtp(pt,recv_fmtp); - /*Set a number to the payload type from the statically defined (RFC3551) profile, if not static, -1 is returned - and the payload type number will be determined dynamically later, at call time.*/ - payload_type_set_number(pt, - (number=rtp_profile_find_payload_number(&av_profile, pt->mime_type, pt->clock_rate, pt->channels)) - ); - ms_message("Codec %s/%i fmtp=[%s] number=%i, enabled=%i) added to default capabilities.", pt->mime_type, pt->clock_rate, - pt->recv_fmtp ? pt->recv_fmtp : "", number, (int)payload_type_enabled(pt)); - *codec_list=ms_list_append(*codec_list,pt); - } + PayloadType *pt=payload_type_clone(const_pt); + int number=-1; + payload_type_set_enable(pt,enabled); + if (recv_fmtp!=NULL) payload_type_set_recv_fmtp(pt,recv_fmtp); + /*Set a number to the payload type from the statically defined (RFC3551) profile, if not static, -1 is returned + and the payload type number will be determined dynamically later, at call time.*/ + payload_type_set_number(pt, + (number=rtp_profile_find_payload_number(&av_profile, pt->mime_type, pt->clock_rate, pt->channels)) + ); + ms_message("Codec %s/%i fmtp=[%s] number=%i, enabled=%i) added to the list of possible codecs.", pt->mime_type, pt->clock_rate, + pt->recv_fmtp ? pt->recv_fmtp : "", number, (int)payload_type_enabled(pt)); + *codec_list=ms_list_append(*codec_list,pt); } static void linphone_core_register_static_payloads(LinphoneCore *lc){ @@ -1525,6 +1542,12 @@ static void misc_config_read(LinphoneCore *lc) { lc->user_certificates_path=ms_strdup(lp_config_get_string(config,"misc","user_certificates_path",".")); } +void linphone_core_reload_ms_plugins(LinphoneCore *lc, const char *path){ + if (path) ms_factory_set_plugins_dir(lc->factory, path); + ms_factory_init_plugins(lc->factory); + codecs_config_read(lc); +} + static void linphone_core_start(LinphoneCore * lc) { sip_setup_register_all(lc->factory); sound_config_read(lc); diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 0e7fc8100..5d9eb905e 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -3854,6 +3854,14 @@ LINPHONE_PUBLIC void linphone_core_set_user_certificates_path(LinphoneCore *lc, */ LINPHONE_PUBLIC const char *linphone_core_get_user_certificates_path(LinphoneCore *lc); +/** + * Reload mediastreamer2 plugins from specified directory. + * @param[in] lc #LinphoneCore object. + * @param[in] directory the path from where plugins are to be loaded, pass NULL to use default (compile-time determined) plugin directory. + * @ingroup initializing + */ +LINPHONE_PUBLIC void linphone_core_reload_ms_plugins(LinphoneCore *lc, const char *path); + /** * Search from the list of current calls if a remote address match uri * @ingroup call_control diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 94911a48d..48280b4d6 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -39,28 +39,18 @@ extern "C" { #ifdef ANDROID #include -extern "C" void libmsilbc_init(); -#ifdef HAVE_X264 -extern "C" void libmsx264_init(); -#endif -#ifdef HAVE_OPENH264 -extern "C" void libmsopenh264_init(); -#endif -#ifdef HAVE_AMR -extern "C" void libmsamr_init(); -#endif -#ifdef HAVE_SILK -extern "C" void libmssilk_init(); -#endif -#ifdef HAVE_G729 -extern "C" void libmsbcg729_init(); -#endif -#ifdef HAVE_WEBRTC -extern "C" void libmswebrtc_init(); -#endif -#ifdef HAVE_CODEC2 -extern "C" void libmscodec2_init(); -#endif + +/*there are declarations of the init routines of our plugins. + * Since there is no way to dlopen() installed in a non-standard place in the apk, + * we have to invoke the init routines manually*/ +extern "C" void libmsx264_init(MSFactory *factory); +extern "C" void libmsopenh264_init(MSFactory *factory); +extern "C" void libmsamr_init(MSFactory *factory); +extern "C" void libmssilk_init(MSFactory *factory); +extern "C" void libmsbcg729_init(MSFactory *factory); +extern "C" void libmswebrtc_init(MSFactory *factory); +extern "C" void libmscodec2_init(MSFactory *factory); + #include #endif /*ANDROID*/ @@ -309,6 +299,9 @@ public: subscriptionDirClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/SubscriptionDir")); subscriptionDirFromIntId = env->GetStaticMethodID(subscriptionDirClass,"fromInt","(I)Lorg/linphone/core/SubscriptionDir;"); + + msFactoryClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/mediastream/Factory")); + msFactoryCtrId = env->GetMethodID(msFactoryClass,"", "(J)V"); } void setCore(jobject c) { @@ -338,6 +331,7 @@ public: env->DeleteGlobalRef(subscriptionStateClass); env->DeleteGlobalRef(subscriptionDirClass); env->DeleteGlobalRef(logCollectionUploadStateClass); + env->DeleteGlobalRef(msFactoryClass); } jobject core; @@ -428,6 +422,9 @@ public: jmethodID logCollectionUploadStateId; jmethodID logCollectionUploadStateFromIntId; jmethodID logCollectionUploadProgressId; + + jclass msFactoryClass; + jmethodID msFactoryCtrId; }; /* @@ -1236,42 +1233,42 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv* LinphoneCoreData* ldata = new LinphoneCoreData(env, thiz, vTable, jlistener, ljb); linphone_core_v_table_set_user_data(vTable, ldata); - ms_init(); // Initialize mediastreamer2 before loading the plugins - -#ifdef HAVE_ILBC - libmsilbc_init(); // requires an fpu -#endif -#ifdef HAVE_X264 - libmsx264_init(); -#endif -#ifdef HAVE_OPENH264 - libmsopenh264_init(); -#endif -#ifdef HAVE_AMR - libmsamr_init(); -#endif -#ifdef HAVE_SILK - libmssilk_init(); -#endif -#ifdef HAVE_G729 - libmsbcg729_init(); -#endif -#ifdef HAVE_WEBRTC - libmswebrtc_init(); -#endif -#ifdef HAVE_CODEC2 - libmscodec2_init(); -#endif jobject core = env->NewGlobalRef(thiz); ljb->setCore(core); LinphoneCore *lc = linphone_core_new(vTable, userConfig, factoryConfig, ljb); - jlong nativePtr = (jlong)lc; + MSFactory *factory = linphone_core_get_ms_factory(lc); + +#ifdef HAVE_X264 + libmsx264_init(factory); +#endif +#ifdef HAVE_OPENH264 + libmsopenh264_init(factory); +#endif +#ifdef HAVE_AMR + libmsamr_init(factory); +#endif +#ifdef HAVE_SILK + libmssilk_init(factory); +#endif +#ifdef HAVE_G729 + libmsbcg729_init(factory); +#endif +#ifdef HAVE_WEBRTC + libmswebrtc_init(factory); +#endif +#ifdef HAVE_CODEC2 + libmscodec2_init(factory); +#endif + linphone_core_reload_ms_plugins(lc, NULL); + + jlong nativePtr = (jlong)lc; if (userConfig) env->ReleaseStringUTFChars(juserConfig, userConfig); if (factoryConfig) env->ReleaseStringUTFChars(jfactoryConfig, factoryConfig); return nativePtr; } + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_delete(JNIEnv* env, jobject thiz, jlong native_ptr) { LinphoneCore *lc=(LinphoneCore*)native_ptr; LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_core_get_user_data(lc); @@ -1282,7 +1279,6 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_delete(JNIEnv* env, jobj jobject wifi_lock_class = lc->wifi_lock_class; linphone_core_destroy(lc); - ms_exit(); if (wifi_lock) env->DeleteGlobalRef(wifi_lock); if (wifi_lock_class) env->DeleteGlobalRef(wifi_lock_class); @@ -1635,6 +1631,14 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_migrateCallLogs(JNIEnv* linphone_core_migrate_logs_from_rc_to_db((LinphoneCore *)lc); } +extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getMSFactory(JNIEnv* env + ,jobject thiz + ,jlong lc){ + LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_core_get_user_data((LinphoneCore *)lc); + MSFactory *factory = linphone_core_get_ms_factory((LinphoneCore*)lc); + return env->NewObject(ljb->msFactoryClass, ljb->msFactoryCtrId, (jlong)factory); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setMtu(JNIEnv* env ,jobject thiz ,jlong lc @@ -2153,9 +2157,11 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startEchoCalibration(JNI } -extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration(JNIEnv *env, jobject thiz, jlong lc) { +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration(JNIEnv *env, jobject thiz, jlong lcptr) { MSSndCard *sndcard; - MSSndCardManager *m = ms_snd_card_manager_get(); + LinphoneCore *lc = (LinphoneCore*) lcptr; + MSFactory * factory = linphone_core_get_ms_factory(lc); + MSSndCardManager *m = ms_factory_get_snd_card_manager(factory); const char *card = linphone_core_get_capture_device((LinphoneCore*)lc); sndcard = ms_snd_card_manager_get_card(m, card); if (sndcard == NULL) { @@ -2173,9 +2179,11 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration return TRUE; } -extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_hasBuiltInEchoCanceler(JNIEnv *env, jobject thiz, jlong lc) { +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_hasBuiltInEchoCanceler(JNIEnv *env, jobject thiz, jlong lcptr) { MSSndCard *sndcard; - MSSndCardManager *m = ms_snd_card_manager_get(); + LinphoneCore *lc = (LinphoneCore*) lcptr; + MSFactory * factory = linphone_core_get_ms_factory(lc); + MSSndCardManager *m = ms_factory_get_snd_card_manager(factory); const char *card = linphone_core_get_capture_device((LinphoneCore*)lc); sndcard = ms_snd_card_manager_get_card(m, card); if (sndcard == NULL) { @@ -4663,8 +4671,9 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setStaticPicture(JNIEnv env->ReleaseStringUTFChars(path, cpath); } -extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setCpuCountNative(JNIEnv *env, jobject thiz, jint count) { - ms_set_cpu_count(count); +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setCpuCountNative(JNIEnv *env, jobject thiz, jlong coreptr, jint count) { + MSFactory *factory = linphone_core_get_ms_factory((LinphoneCore*)coreptr); + ms_factory_set_cpu_count(factory, count); } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioJittcomp(JNIEnv *env, jobject thiz, jlong lc, jint value) { diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 1b69b4e04..d8083906a 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -2268,4 +2268,10 @@ public interface LinphoneCore { */ public void setMediaNetworkReachable(boolean isReachable); + /** + * Returns the mediastreamer2 (media stack) factory object used by the LinphoneCore. This may be useful to perform + * some advanced media-related configuration options. + **/ + org.linphone.mediastream.Factory getMSFactory(); + } diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 2e18d9b3d..e4cabfaa2 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -947,10 +947,10 @@ class LinphoneCoreImpl implements LinphoneCore { setUserAgent(nativePtr,name,version); } - private native void setCpuCountNative(int count); + private native void setCpuCountNative(long nativePtr, int count); public synchronized void setCpuCount(int count) { - setCpuCountNative(count); + setCpuCountNative(nativePtr, count); } public synchronized int getMissedCallsCount() { @@ -1620,5 +1620,9 @@ class LinphoneCoreImpl implements LinphoneCore { public void setMediaNetworkReachable(boolean isReachable) { setMediaNetworkReachable(nativePtr, isReachable); } - + private native Object getMSFactory(long nativePtr); + @Override + public org.linphone.mediastream.Factory getMSFactory(){ + return (org.linphone.mediastream.Factory) getMSFactory(nativePtr); + } } diff --git a/mediastreamer2 b/mediastreamer2 index bc6574e8c..bcd3042a1 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit bc6574e8c7d5a385d89c2cb807e4fb9a6c20f612 +Subproject commit bcd3042a1984088a78a7517774300b0a6647506d From 1980323a8e37224a71045e2ff12ecb8cd8e9ef72 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 4 Feb 2016 23:02:06 +0100 Subject: [PATCH 03/24] link against webrtc's ilbc codec --- build/android/Android.mk | 51 +++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/build/android/Android.mk b/build/android/Android.mk index 2abfb5eb0..8fa4c5555 100755 --- a/build/android/Android.mk +++ b/build/android/Android.mk @@ -183,33 +183,52 @@ LOCAL_CFLAGS += -DHAVE_CODEC2 LOCAL_STATIC_LIBRARIES += libcodec2 libmscodec2 endif -ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC),00) +ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC)$(BUILD_ILBC),000) LOCAL_CFLAGS += -DHAVE_WEBRTC LOCAL_STATIC_LIBRARIES += libmswebrtc endif + ifneq ($(BUILD_WEBRTC_AECM),0) LOCAL_STATIC_LIBRARIES += \ - libwebrtc_aecm \ + libwebrtc_aecm +ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) +LOCAL_STATIC_LIBRARIES += \ + libwebrtc_aecm_neon +endif +endif + + +ifneq ($(BUILD_WEBRTC_ISAC),0) +LOCAL_STATIC_LIBRARIES += \ + libwebrtc_isacfix +ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) +LOCAL_STATIC_LIBRARIES += \ + libwebrtc_isacfix_neon +endif +endif + +ifneq ($(BUILD_ILBC),0) +LOCAL_STATIC_LIBRARIES += \ + libwebrtc_ilbc +endif + + +ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC)$(BUILD_ILBC),000) + +LOCAL_STATIC_LIBRARIES += \ + libwebrtc_apm_utility \ + libwebrtc_system_wrappers \ libwebrtc_apm_utility \ libwebrtc_spl \ libwebrtc_system_wrappers ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) LOCAL_STATIC_LIBRARIES += \ - libwebrtc_aecm_neon \ - libwebrtc_spl_neon -endif -endif -ifneq ($(BUILD_WEBRTC_ISAC),0) -LOCAL_STATIC_LIBRARIES += \ - libwebrtc_isacfix \ - libwebrtc_spl -ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) -LOCAL_STATIC_LIBRARIES += \ - libwebrtc_isacfix_neon \ libwebrtc_spl_neon endif + endif + ifeq ($(BUILD_G729),1) LOCAL_CFLAGS += -DHAVE_G729 LOCAL_STATIC_LIBRARIES += libbcg729 libmsbcg729 @@ -241,12 +260,6 @@ ifeq ($(BUILD_SRTP), 1) LOCAL_C_INCLUDES += $(SRTP_C_INCLUDE) endif -ifeq ($(BUILD_ILBC), 1) -ifneq ($(TARGET_ARCH_ABI),armeabi) -LOCAL_CFLAGS += -DHAVE_ILBC=1 -LOCAL_STATIC_LIBRARIES += libmsilbc -endif -endif LOCAL_C_INCLUDES += $(LIBLINPHONE_EXTENDED_C_INCLUDES) LOCAL_WHOLE_STATIC_LIBRARIES += $(LIBLINPHONE_EXTENDED_STATIC_LIBS) From 230e9d9fbbd915840cb4bb214e43cc9770894a20 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 5 Feb 2016 08:42:06 +0100 Subject: [PATCH 04/24] remove meaningless assert --- tester/call_tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index deb1f0c88..9cc997126 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -5780,7 +5780,7 @@ static void call_logs_sqlite_storage(void) { linphone_call_log_get_remote_address(call_log), linphone_proxy_config_get_identity_address(linphone_core_get_default_proxy_config(pauline->lc)))); BC_ASSERT_PTR_NOT_NULL(linphone_call_log_get_remote_stats(call_log)); - BC_ASSERT_PTR_NOT_NULL(linphone_call_log_get_start_date(call_log)); + BC_ASSERT_EQUAL(linphone_call_log_get_start_date(call_log), start_time, int, "%d"); BC_ASSERT_EQUAL(linphone_call_log_get_status(call_log), LinphoneCallSuccess, int, "%d"); } From 1ae61a909d999efcbf4a9d64805ba146f44ad357 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 5 Feb 2016 10:06:08 +0100 Subject: [PATCH 05/24] Updated ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index bcd3042a1..6311df09d 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit bcd3042a1984088a78a7517774300b0a6647506d +Subproject commit 6311df09db85a0fb09a48ac06c6893eb2a218425 From 45207ae94fcd5c805be24528929cf4f6b7b1a526 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 5 Feb 2016 10:28:09 +0100 Subject: [PATCH 06/24] submodules: update ms2 [Outgrade submodule] --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 6311df09d..bcd3042a1 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 6311df09db85a0fb09a48ac06c6893eb2a218425 +Subproject commit bcd3042a1984088a78a7517774300b0a6647506d From f207747e7f5a899b8ff139c422921c32b8b5fc8b Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 5 Feb 2016 10:44:30 +0100 Subject: [PATCH 07/24] Fix loading of ms2 plugins in Python module. --- tools/python/apixml2python/handwritten_definitions.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/python/apixml2python/handwritten_definitions.mustache b/tools/python/apixml2python/handwritten_definitions.mustache index 1ecc8fb17..fcbbdb3d3 100644 --- a/tools/python/apixml2python/handwritten_definitions.mustache +++ b/tools/python/apixml2python/handwritten_definitions.mustache @@ -401,6 +401,7 @@ static void pylinphone_init_ms2_plugins(LinphoneCore *lc) { #ifdef ENABLE_WASAPI libmswasapi_init(factory); #endif + linphone_core_reload_ms_plugins(lc, NULL); } static PyObject * pylinphone_Core_class_method_new(PyObject *cls, PyObject *args) { From 74c255f3601a3390e09726572dd699b2dec498e5 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 5 Feb 2016 10:55:18 +0100 Subject: [PATCH 08/24] add test with tcp disabled --- tester/call_tester.c | 78 +++++++++++++++++++++++++++++++--------- tester/presence_tester.c | 2 +- 2 files changed, 63 insertions(+), 17 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index 9cc997126..3fbca71d3 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -160,35 +160,64 @@ void linphone_call_iframe_decoded_cb(LinphoneCall *call,void * user_data) { void liblinphone_tester_check_rtcp(LinphoneCoreManager* caller, LinphoneCoreManager* callee) { LinphoneCall *c1,*c2; MSTimeSpec ts; - + int max_time_to_wait; c1=linphone_core_get_current_call(caller->lc); c2=linphone_core_get_current_call(callee->lc); - + BC_ASSERT_PTR_NOT_NULL(c1); BC_ASSERT_PTR_NOT_NULL(c2); - + if (!c1 || !c2) return; linphone_call_ref(c1); linphone_call_ref(c2); - liblinphone_tester_clock_start(&ts); + if (linphone_core_rtcp_enabled(caller->lc) && linphone_core_rtcp_enabled(callee->lc)) + max_time_to_wait = 15000; + else + max_time_to_wait = 5000; + do { if (linphone_call_get_audio_stats(c1)->round_trip_delay > 0.0 - && linphone_call_get_audio_stats(c2)->round_trip_delay > 0.0 - && (!linphone_call_log_video_enabled(linphone_call_get_call_log(c1)) || linphone_call_get_video_stats(c1)->round_trip_delay>0.0) - && (!linphone_call_log_video_enabled(linphone_call_get_call_log(c2)) || linphone_call_get_video_stats(c2)->round_trip_delay>0.0)) { + && linphone_call_get_audio_stats(c2)->round_trip_delay > 0.0 + && (!linphone_call_log_video_enabled(linphone_call_get_call_log(c1)) || linphone_call_get_video_stats(c1)->round_trip_delay>0.0) + && (!linphone_call_log_video_enabled(linphone_call_get_call_log(c2)) || linphone_call_get_video_stats(c2)->round_trip_delay>0.0)) { break; - + } wait_for_until(caller->lc,callee->lc,NULL,0,20); /*just to sleep while iterating*/ - }while (!liblinphone_tester_clock_elapsed(&ts,15000)); - BC_ASSERT_GREATER(linphone_call_get_audio_stats(c1)->round_trip_delay,0.0,float,"%f"); - BC_ASSERT_GREATER(linphone_call_get_audio_stats(c2)->round_trip_delay,0.0,float,"%f"); - if (linphone_call_log_video_enabled(linphone_call_get_call_log(c1))) { - BC_ASSERT_GREATER(linphone_call_get_video_stats(c1)->round_trip_delay,0.0,float,"%f"); - } - if (linphone_call_log_video_enabled(linphone_call_get_call_log(c2))) { - BC_ASSERT_GREATER(linphone_call_get_video_stats(c2)->round_trip_delay,0.0,float,"%f"); + }while (!liblinphone_tester_clock_elapsed(&ts,max_time_to_wait)); + + if (linphone_core_rtcp_enabled(caller->lc) && linphone_core_rtcp_enabled(callee->lc)) { + BC_ASSERT_GREATER(linphone_call_get_audio_stats(c1)->round_trip_delay,0.0,float,"%f"); + BC_ASSERT_GREATER(linphone_call_get_audio_stats(c2)->round_trip_delay,0.0,float,"%f"); + if (linphone_call_log_video_enabled(linphone_call_get_call_log(c1))) { + BC_ASSERT_GREATER(linphone_call_get_video_stats(c1)->round_trip_delay,0.0,float,"%f"); + } + if (linphone_call_log_video_enabled(linphone_call_get_call_log(c2))) { + BC_ASSERT_GREATER(linphone_call_get_video_stats(c2)->round_trip_delay,0.0,float,"%f"); + } + } else { + if (linphone_core_rtcp_enabled(caller->lc)) { + BC_ASSERT_EQUAL(linphone_call_get_audio_stats(c1)->rtp_stats.sent_rtcp_packets, 0, int, "%i"); + BC_ASSERT_EQUAL(linphone_call_get_audio_stats(c2)->rtp_stats.recv_rtcp_packets, 0, int, "%i"); + if (linphone_call_log_video_enabled(linphone_call_get_call_log(c1))) { + BC_ASSERT_EQUAL(linphone_call_get_video_stats(c1)->rtp_stats.sent_rtcp_packets, 0, int, "%i"); + } + if (linphone_call_log_video_enabled(linphone_call_get_call_log(c2))) { + BC_ASSERT_EQUAL(linphone_call_get_video_stats(c2)->rtp_stats.recv_rtcp_packets, 0, int, "%i"); + } + } + if (linphone_core_rtcp_enabled(callee->lc)) { + BC_ASSERT_EQUAL(linphone_call_get_audio_stats(c2)->rtp_stats.sent_rtcp_packets, 0, int, "%i"); + BC_ASSERT_EQUAL(linphone_call_get_audio_stats(c1)->rtp_stats.recv_rtcp_packets, 0, int, "%i"); + if (linphone_call_log_video_enabled(linphone_call_get_call_log(c1))) { + BC_ASSERT_EQUAL(linphone_call_get_video_stats(c1)->rtp_stats.recv_rtcp_packets, 0, int, "%i"); + } + if (linphone_call_log_video_enabled(linphone_call_get_call_log(c2))) { + BC_ASSERT_EQUAL(linphone_call_get_video_stats(c2)->rtp_stats.sent_rtcp_packets, 0, int, "%i"); + } + } + } linphone_call_unref(c1); linphone_call_unref(c2); @@ -2281,6 +2310,22 @@ static void video_call(void) { linphone_core_manager_destroy(pauline); } +static void video_call_without_rtcp(void) { + LpConfig *lp; + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + + lp = linphone_core_get_config(marie->lc); + lp_config_set_int(lp,"rtp","rtcp_enabled",0); + + lp = linphone_core_get_config(pauline->lc); + lp_config_set_int(lp,"rtp","rtcp_enabled",0); + + video_call_base(marie,pauline,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} + static void video_call_disable_implicit_AVPF_on_callee(void) { LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); @@ -6029,6 +6074,7 @@ test_t call_tests[] = { TEST_NO_TAG("Simple video call AVPF to implicit AVPF", video_call_AVPF_to_implicit_AVPF), TEST_NO_TAG("Simple video call implicit AVPF to AVPF", video_call_implicit_AVPF_to_AVPF), TEST_NO_TAG("Simple video call", video_call), + TEST_NO_TAG("Simple video call without rtcp",video_call_without_rtcp), TEST_NO_TAG("Simple ZRTP video call", video_call_zrtp), TEST_NO_TAG("Simple DTLS video call", video_call_dtls), TEST_NO_TAG("Simple video call using policy", video_call_using_policy), diff --git a/tester/presence_tester.c b/tester/presence_tester.c index 5c95563c1..d529e6888 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -196,7 +196,7 @@ static bool_t subscribe_to_callee_presence(LinphoneCoreManager* caller_mgr,Linph char* identity=linphone_address_as_string_uri_only(callee_mgr->identity); - LinphoneFriend* friend=linphone_friend_new_with_address(identity); + LinphoneFriend* friend=linphone_core_create_friend_with_address(caller_mgr->lc,identity); linphone_friend_edit(friend); linphone_friend_enable_subscribes(friend,TRUE); linphone_friend_done(friend); From 4c2de4f59a8753b0fe2397920413d3e40418fbd9 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 5 Feb 2016 11:30:10 +0100 Subject: [PATCH 09/24] Disable dummy STUN packets sending when ICE is activated. --- coreapi/linphonecall.c | 9 +++++---- mediastreamer2 | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index ba55fd1c2..7bcd3e7fe 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2215,9 +2215,8 @@ static void _linphone_call_prepare_ice_for_stream(LinphoneCall *call, int stream ice_session_add_check_list(call->ice_session, cl, stream_index); ms_message("Created new ICE check list for stream [%i]",stream_index); } - if (cl){ - ms->ice_check_list = cl; - ice_check_list_set_rtp_session(ms->ice_check_list, ms->sessions.rtp_session); + if (cl) { + media_stream_set_ice_check_list(ms, cl); } } } @@ -4401,7 +4400,9 @@ void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index){ if (ms){ /* Ensure there is no dangling ICE check list. */ - if (call->ice_session == NULL) ms->ice_check_list = NULL; + if (call->ice_session == NULL) { + media_stream_set_ice_check_list(ms, NULL); + } switch(ms->type){ case MSAudio: diff --git a/mediastreamer2 b/mediastreamer2 index bcd3042a1..5bf8cb076 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit bcd3042a1984088a78a7517774300b0a6647506d +Subproject commit 5bf8cb0768e7f4ef78e1cac27e365602fc00648e From 79b104fbbc0f43ffcf49553dace1016f61ce6b15 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 5 Feb 2016 16:35:33 +0100 Subject: [PATCH 10/24] Update ms2 submodule. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 5bf8cb076..fe26a41fe 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 5bf8cb0768e7f4ef78e1cac27e365602fc00648e +Subproject commit fe26a41febbfdee062e4db7872e9f979850aa746 From 7fca3be419ac2160a5b5e193e331ee2d56d48dc2 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 5 Feb 2016 17:10:38 +0100 Subject: [PATCH 11/24] On invalidate, only notify friend with an already known presence model --- coreapi/friend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/friend.c b/coreapi/friend.c index 0ba8af361..c5e515e20 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -252,9 +252,9 @@ void linphone_friend_invalidate_subscription(LinphoneFriend *lf){ /* Notify application that we no longer know the presence activity */ if (lf->presence != NULL) { linphone_presence_model_unref(lf->presence); + lf->presence = linphone_presence_model_new_with_activity(LinphonePresenceActivityOffline,"unknown activity"); + linphone_core_notify_notify_presence_received(lc,lf); } - lf->presence = linphone_presence_model_new_with_activity(LinphonePresenceActivityOffline,"unknown activity"); - linphone_core_notify_notify_presence_received(lc,lf); lf->initial_subscribes_sent=FALSE; } From a110765526b7305d8131eab2110c252b526b2fe1 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 5 Feb 2016 17:11:36 +0100 Subject: [PATCH 12/24] update test certificates with 2048bits rosa key --- tester/certificates/altname/agent.pem | 115 ++++++++++--------------- tester/certificates/cn/agent.pem | 116 ++++++++++---------------- tester/certificates/cn/openssl-cn.cnf | 2 +- 3 files changed, 91 insertions(+), 142 deletions(-) diff --git a/tester/certificates/altname/agent.pem b/tester/certificates/altname/agent.pem index edb7c9fa1..405ece5cb 100644 --- a/tester/certificates/altname/agent.pem +++ b/tester/certificates/altname/agent.pem @@ -1,75 +1,52 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQDHZG78iwkkxJeq3ZPuQwY9DfdcNCvHXayW+5p5VUULV50ohJKt -JJzhp5ysq4VH7q/dmOnMnbYTACnqVSlph88zRdQJd/g0h6T4DyWa5Jxe+R1hwLWV -fgeSXstCK8m9SwxKqnqA5mPZxfARXg3r4XWkUK2A1lWIXCkZU3MMD4JJ4QIDAQAB -AoGAGgyi+1dmwGj2r5n3I5+aBwv2DxO5zHgOfkMssUFUneC6ZXq8duZboJd3Po/B -/93NGBRMJzFLgjv5PeYWXPUjOoJT7eg0aDJKX/uMKSvzhyIL/bUJPfyo2GCmkAr5 -CF5EBFFjlsui2kSFusxbQmyzZkkIl3OYdlTBdQFsmEROk8kCQQD3aW1ZPbDkSxsi -09VZBWVW95LojcxYQeqjPTs8EAB2jKmR4aw8KGKCz+yBGwiSdukDZ/p3IftuifHk -J+3a6kqnAkEAzlBKjM8xVWprTp/3p1DMYNA+KNsXuf08xGB/zegpU561FjUzK7U4 -QKyDSIaRgSv4WAJbIauwaZdydM6Q0DnANwJBAKEQGQeHiaiU3E2H6dPSF27OLO0H -ooeyIbWzHuSy5hpG5/z4FM/02myePzCtEJ+ImZiGEB+OF8iWNMp60/U3oPECQAoR -RPIGEkQ2wzG9AJq7iJ2Yy8+2kTvULajvhI0JrSqVbgS9Z9fUKgCN6oIZfvQsrxus -UcIc3KjqaP1mLw7aIpUCQH5S0B+GOwKa8+RbuRcgBvksqkRwRZn6jawoNJJSBCDn -gQJ5B9PvJXppTsbnulSD2srhUqCR1pzGfnl8bYV8b8Q= ------END RSA PRIVATE KEY----- -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 9 (0x9) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=FR, ST=Some-State, L=Grenoble, O=Belledonne Communications, OU=LAB, CN=Jehan Monnier/emailAddress=jehan.monnier@belledonne-communications.com - Validity - Not Before: Sep 25 16:12:35 2014 GMT - Not After : Sep 22 16:12:35 2024 GMT - Subject: C=FR, ST=France, L=Grenoble, O=Belledonne Communications, OU=LAB, CN=Jehan Monnier/emailAddress=jehan.monnier@belledonne-communications.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) - Modulus: - 00:c7:64:6e:fc:8b:09:24:c4:97:aa:dd:93:ee:43: - 06:3d:0d:f7:5c:34:2b:c7:5d:ac:96:fb:9a:79:55: - 45:0b:57:9d:28:84:92:ad:24:9c:e1:a7:9c:ac:ab: - 85:47:ee:af:dd:98:e9:cc:9d:b6:13:00:29:ea:55: - 29:69:87:cf:33:45:d4:09:77:f8:34:87:a4:f8:0f: - 25:9a:e4:9c:5e:f9:1d:61:c0:b5:95:7e:07:92:5e: - cb:42:2b:c9:bd:4b:0c:4a:aa:7a:80:e6:63:d9:c5: - f0:11:5e:0d:eb:e1:75:a4:50:ad:80:d6:55:88:5c: - 29:19:53:73:0c:0f:82:49:e1 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: - CA:FALSE - X509v3 Key Usage: - Digital Signature, Non Repudiation, Key Encipherment - X509v3 Subject Alternative Name: - DNS:altname.linphone.org, DNS:*.wildcard2.linphone.org - Signature Algorithm: sha1WithRSAEncryption - 56:f5:23:64:4c:8d:85:6e:05:d6:42:a3:41:b2:6a:ab:a1:cd: - be:ae:4a:38:c5:23:4c:62:2c:06:4d:49:b7:fc:ad:86:1d:9b: - c0:7e:33:80:fa:7d:31:8b:ca:9c:28:44:b2:1c:f1:ed:73:5b: - d3:80:72:b0:6c:0b:20:2b:e5:2b:02:c6:be:14:ad:55:34:2f: - 6f:8e:bb:7b:61:ce:9c:af:85:a7:b0:cd:d1:4e:1e:17:e9:7e: - 61:ed:50:60:9a:de:d0:7a:6d:a5:ee:04:9a:5c:41:94:21:e5: - 05:61:a8:17:ab:eb:b4:cc:7f:90:9b:3a:0e:ca:31:fb:65:40: - 11:2d -----BEGIN CERTIFICATE----- -MIIDPzCCAqigAwIBAgIBCTANBgkqhkiG9w0BAQUFADCBuzELMAkGA1UEBhMCRlIx +MIID9DCCA12gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCBuzELMAkGA1UEBhMCRlIx EzARBgNVBAgMClNvbWUtU3RhdGUxETAPBgNVBAcMCEdyZW5vYmxlMSIwIAYDVQQK DBlCZWxsZWRvbm5lIENvbW11bmljYXRpb25zMQwwCgYDVQQLDANMQUIxFjAUBgNV BAMMDUplaGFuIE1vbm5p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+4Cf8WlX380tSQdlrJKUGwwroccl89fQsbYYmwk0zUZl2C2b5Qob8iznSAH2Xn3/Q +VciYuw126G9B5y8u1cWkpXUCgYAsM8JKaOdQQ+KH7lnBpxmjG/3VT3Eka4uCRRWP +b5DJNuYoCpgFK/WfmbxVdLxphe+b15yREG2xCE/uOeWFB8dWAsKLwXwHD4e+NM9r +4CNYdDJ7b8noEy4FwCJjMEDK0jThGQ6me2HOlPclOaPt0XSrG1ZtCwklmcUIHVsY +3kxWgQKBgQCAJNaC8M9MDtkzZitUJPKITwWOj8OY97t2651I/hArsVP6Eqt9P33F +ZUigatOQuTi0FDpA3jEFk4Lw8OAHb2j7YQOZan8UKWrUUwZNsiEir7x2yRnNKXGf +CJe50Wc2y1BCDDz7bEfRemHtNJwWzHbMF7QnINwxOb8GsqJgDaKwLw== +-----END RSA PRIVATE KEY----- + diff --git a/tester/certificates/cn/agent.pem b/tester/certificates/cn/agent.pem index 978221639..ed5b0507a 100644 --- a/tester/certificates/cn/agent.pem +++ b/tester/certificates/cn/agent.pem @@ -1,80 +1,52 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQDHZG78iwkkxJeq3ZPuQwY9DfdcNCvHXayW+5p5VUULV50ohJKt -JJzhp5ysq4VH7q/dmOnMnbYTACnqVSlph88zRdQJd/g0h6T4DyWa5Jxe+R1hwLWV -fgeSXstCK8m9SwxKqnqA5mPZxfARXg3r4XWkUK2A1lWIXCkZU3MMD4JJ4QIDAQAB -AoGAGgyi+1dmwGj2r5n3I5+aBwv2DxO5zHgOfkMssUFUneC6ZXq8duZboJd3Po/B -/93NGBRMJzFLgjv5PeYWXPUjOoJT7eg0aDJKX/uMKSvzhyIL/bUJPfyo2GCmkAr5 -CF5EBFFjlsui2kSFusxbQmyzZkkIl3OYdlTBdQFsmEROk8kCQQD3aW1ZPbDkSxsi -09VZBWVW95LojcxYQeqjPTs8EAB2jKmR4aw8KGKCz+yBGwiSdukDZ/p3IftuifHk -J+3a6kqnAkEAzlBKjM8xVWprTp/3p1DMYNA+KNsXuf08xGB/zegpU561FjUzK7U4 -QKyDSIaRgSv4WAJbIauwaZdydM6Q0DnANwJBAKEQGQeHiaiU3E2H6dPSF27OLO0H -ooeyIbWzHuSy5hpG5/z4FM/02myePzCtEJ+ImZiGEB+OF8iWNMp60/U3oPECQAoR -RPIGEkQ2wzG9AJq7iJ2Yy8+2kTvULajvhI0JrSqVbgS9Z9fUKgCN6oIZfvQsrxus -UcIc3KjqaP1mLw7aIpUCQH5S0B+GOwKa8+RbuRcgBvksqkRwRZn6jawoNJJSBCDn -gQJ5B9PvJXppTsbnulSD2srhUqCR1pzGfnl8bYV8b8Q= ------END RSA PRIVATE KEY----- - -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 6 (0x6) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=FR, ST=Some-State, L=Grenoble, O=Belledonne Communications, OU=LAB, CN=Jehan Monnier/emailAddress=jehan.monnier@belledonne-communications.com - Validity - Not Before: Sep 23 16:13:11 2013 GMT - Not After : Sep 21 16:13:11 2023 GMT - Subject: C=FR, ST=France, L=Grenoble, O=Belledonne Communications, OU=LAB, CN=sip2.linphone.org, CN=*.wildcard1.linphone.org/emailAddress=jehan.monnier@belledonne-communications.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) - Modulus: - 00:c7:64:6e:fc:8b:09:24:c4:97:aa:dd:93:ee:43: - 06:3d:0d:f7:5c:34:2b:c7:5d:ac:96:fb:9a:79:55: - 45:0b:57:9d:28:84:92:ad:24:9c:e1:a7:9c:ac:ab: - 85:47:ee:af:dd:98:e9:cc:9d:b6:13:00:29:ea:55: - 29:69:87:cf:33:45:d4:09:77:f8:34:87:a4:f8:0f: - 25:9a:e4:9c:5e:f9:1d:61:c0:b5:95:7e:07:92:5e: - cb:42:2b:c9:bd:4b:0c:4a:aa:7a:80:e6:63:d9:c5: - f0:11:5e:0d:eb:e1:75:a4:50:ad:80:d6:55:88:5c: - 29:19:53:73:0c:0f:82:49:e1 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: - CA:FALSE - Netscape Comment: - OpenSSL Generated Certificate - X509v3 Subject Key Identifier: - 32:19:16:F0:DD:2C:34:8F:FE:12:5D:4F:E0:0C:EE:C5:06:C8:B1:8C - X509v3 Authority Key Identifier: - keyid:06:5F:5D:C7:16:AF:62:F8:2D:6E:71:03:88:A0:D6:1D:2B:04:7F:BA - - Signature Algorithm: sha1WithRSAEncryption - af:2e:d2:9a:b9:e0:ca:c8:e3:25:eb:30:0b:5e:02:e9:43:2d: - 84:09:11:d1:be:8e:a4:86:bf:c7:19:aa:18:c3:55:b2:07:c5: - 68:ff:c6:39:f7:2b:da:27:85:34:8b:7b:6c:92:8f:ba:aa:9d: - 44:f3:0c:47:88:7a:0c:b1:e0:c7:6f:eb:af:d2:ab:d0:6d:25: - d5:ff:40:37:69:2b:bd:f2:6e:4a:42:32:29:98:27:c7:ec:34: - 25:eb:22:6f:83:50:82:1c:08:88:77:ec:31:82:c2:0c:77:b1: - 2b:c9:7d:6c:ff:95:d0:10:cf:8e:9f:2e:eb:a1:a6:40:fc:c0: - ec:83 -----BEGIN CERTIFICATE----- -MIIDjDCCAvWgAwIBAgIBBjANBgkqhkiG9w0BAQUFADCBuzELMAkGA1UEBhMCRlIx +MIIEEDCCA3mgAwIBAgIBCjANBgkqhkiG9w0BAQsFADCBuzELMAkGA1UEBhMCRlIx EzARBgNVBAgMClNvbWUtU3RhdGUxETAPBgNVBAcMCEdyZW5vYmxlMSIwIAYDVQQK DBlCZWxsZWRvbm5lIENvbW11bmljYXRpb25zMQwwCgYDVQQLDANMQUIxFjAUBgNV BAMMDUplaGFuIE1vbm5pZXIxOjA4BgkqhkiG9w0BCQEWK2plaGFuLm1vbm5pZXJA -YmVsbGVkb25uZS1jb21tdW5pY2F0aW9ucy5jb20wHhcNMTMwOTIzMTYxMzExWhcN -MjMwOTIxMTYxMzExWjCB3jELMAkGA1UEBh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Lxphe+b15yREG2xCE/uOeWFB8dWAsKLwXwHD4e+NM9r +4CNYdDJ7b8noEy4FwCJjMEDK0jThGQ6me2HOlPclOaPt0XSrG1ZtCwklmcUIHVsY +3kxWgQKBgQCAJNaC8M9MDtkzZitUJPKITwWOj8OY97t2651I/hArsVP6Eqt9P33F +ZUigatOQuTi0FDpA3jEFk4Lw8OAHb2j7YQOZan8UKWrUUwZNsiEir7x2yRnNKXGf +CJe50Wc2y1BCDDz7bEfRemHtNJwWzHbMF7QnINwxOb8GsqJgDaKwLw== +-----END RSA PRIVATE KEY----- + diff --git a/tester/certificates/cn/openssl-cn.cnf b/tester/certificates/cn/openssl-cn.cnf index 908f6ed4c..3130609e5 100644 --- a/tester/certificates/cn/openssl-cn.cnf +++ b/tester/certificates/cn/openssl-cn.cnf @@ -103,7 +103,7 @@ emailAddress = optional #################################################################### [ req ] -default_bits = 1024 +default_bits = 2048 default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes From 8e3c8818367e62d7c14cad14623800693679d945 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 5 Feb 2016 17:50:14 +0100 Subject: [PATCH 13/24] Fix build on Windows. --- coreapi/private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/private.h b/coreapi/private.h index 715378e82..acea2859a 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -546,7 +546,7 @@ int linphone_core_start_accept_call_update(LinphoneCore *lc, LinphoneCall *call, void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call); bool_t linphone_core_incompatible_security(LinphoneCore *lc, SalMediaDescription *md); extern SalCallbacks linphone_sal_callbacks; -bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc); +LINPHONE_PUBLIC bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc); bool_t linphone_core_symmetric_rtp_enabled(LinphoneCore*lc); void linphone_core_queue_task(LinphoneCore *lc, belle_sip_source_func_t task_fun, void *data, const char *task_description); From 20ce36c6c7d70ebdb08f056454903a29d5f8606f Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 5 Feb 2016 18:04:58 +0100 Subject: [PATCH 14/24] Update ms2 submodule. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index fe26a41fe..97ee2fdb8 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit fe26a41febbfdee062e4db7872e9f979850aa746 +Subproject commit 97ee2fdb8365480d95f366529db41f5291bd1fbf From d3e3740a64b1f4d2d3b0313b5564216d9d6e4862 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sat, 6 Feb 2016 11:51:06 +0100 Subject: [PATCH 15/24] fix crashes around presence and publish. Documentation was not consistent with actual code was doing. LinphoneEvent becomes a true belle_sip_object_t, which now evidences memory leaks. update ms2 --- coreapi/event.c | 39 +++++++++++++++++++++++++++++++++------ coreapi/event.h | 6 ++---- coreapi/friendlist.c | 1 + coreapi/private.h | 6 ++++-- coreapi/proxy.c | 1 + mediastreamer2 | 2 +- 6 files changed, 42 insertions(+), 13 deletions(-) diff --git a/coreapi/event.c b/coreapi/event.c index 07e373b73..8f00111d8 100644 --- a/coreapi/event.c +++ b/coreapi/event.c @@ -20,6 +20,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "private.h" #include "lpconfig.h" +const char * linphone_subscription_dir_to_string(LinphoneSubscriptionDir dir){ + switch(dir){ + case LinphoneSubscriptionIncoming: + return "LinphoneSubscriptionIncoming"; + case LinphoneSubscriptionOutgoing: + return "LinphoneSubscriptionOutgoing"; + case LinphoneSubscriptionInvalidDir: + return "LinphoneSubscriptionInvalidDir"; + } + return "INVALID"; +} LinphoneSubscriptionState linphone_subscription_state_from_sal(SalSubscribeStatus ss){ switch(ss){ @@ -58,11 +69,10 @@ LINPHONE_PUBLIC const char *linphone_publish_state_to_string(LinphonePublishStat } static LinphoneEvent * linphone_event_new_base(LinphoneCore *lc, LinphoneSubscriptionDir dir, const char *name, SalOp *op){ - LinphoneEvent *lev=ms_new0(LinphoneEvent,1); + LinphoneEvent *lev=belle_sip_object_new(LinphoneEvent); lev->lc=lc; lev->dir=dir; lev->op=op; - lev->refcnt=1; lev->name=ms_strdup(name); sal_op_set_user_pointer(lev->op,lev); return lev; @@ -343,7 +353,7 @@ void linphone_event_terminate(LinphoneEvent *lev){ LinphoneEvent *linphone_event_ref(LinphoneEvent *lev){ - lev->refcnt++; + belle_sip_object_ref(lev); return lev; } @@ -351,12 +361,10 @@ static void linphone_event_destroy(LinphoneEvent *lev){ if (lev->op) sal_op_release(lev->op); ms_free(lev->name); - ms_free(lev); } void linphone_event_unref(LinphoneEvent *lev){ - lev->refcnt--; - if (lev->refcnt==0) linphone_event_destroy(lev); + belle_sip_object_unref(lev); } LinphoneSubscriptionDir linphone_event_get_subscription_dir(LinphoneEvent *lev){ @@ -391,3 +399,22 @@ LinphoneCore *linphone_event_get_core(const LinphoneEvent *lev){ return lev->lc; } +static belle_sip_error_code _linphone_event_marshall(belle_sip_object_t *obj, char* buff, size_t buff_size, size_t *offset) { + LinphoneEvent *ev = (LinphoneEvent*)obj; + belle_sip_error_code err = BELLE_SIP_OK; + + err = belle_sip_snprintf(buff, buff_size, offset, "%s of %s", ev->dir == LinphoneSubscriptionIncoming ? + "Incoming Subscribe" : (ev->dir == LinphoneSubscriptionOutgoing ? "Outgoing subscribe" : "Publish"), ev->name); + + return err; +} + +BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneEvent); + +BELLE_SIP_INSTANCIATE_VPTR(LinphoneEvent, belle_sip_object_t, + (belle_sip_object_destroy_t) linphone_event_destroy, + NULL, // clone + _linphone_event_marshall, + FALSE +); + diff --git a/coreapi/event.h b/coreapi/event.h index b9033f8c7..d84d6d180 100644 --- a/coreapi/event.h +++ b/coreapi/event.h @@ -278,10 +278,8 @@ LINPHONE_PUBLIC const char *linphone_event_get_custom_header(LinphoneEvent *ev, /** * Terminate an incoming or outgoing subscription that was previously acccepted, or a previous publication. - * This function does not unref the object. The core will unref() if it does not need this object anymore. - * - * For subscribed event, when the subscription is terminated normally or because of an error, the core will unref. - * For published events, no unref is performed. This is because it is allowed to re-publish an expired publish, as well as retry it in case of error. + * The LinphoneEvent shall not be used anymore after this operation, unless the application explicitely took a reference on the object with + * linphone_event_ref(). **/ LINPHONE_PUBLIC void linphone_event_terminate(LinphoneEvent *lev); diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index fd0841782..aba3546ff 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -408,6 +408,7 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon linphone_event_unref(list->event); } list->event = linphone_core_create_subscribe(list->lc, address, "presence", expires); + linphone_event_ref(list->event); linphone_event_set_internal(list->event, TRUE); linphone_event_add_custom_header(list->event, "Require", "recipient-list-subscribe"); linphone_event_add_custom_header(list->event, "Supported", "eventlist"); diff --git a/coreapi/private.h b/coreapi/private.h index acea2859a..a041c8126 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -982,6 +982,7 @@ struct _LinphoneCore struct _LinphoneEvent{ + belle_sip_object_t base; LinphoneSubscriptionDir dir; LinphoneCore *lc; SalOp *op; @@ -989,7 +990,6 @@ struct _LinphoneEvent{ LinphoneSubscriptionState subscription_state; LinphonePublishState publish_state; void *userdata; - int refcnt; char *name; int expires; bool_t terminating; @@ -997,6 +997,7 @@ struct _LinphoneEvent{ bool_t internal; }; +BELLE_SIP_DECLARE_VPTR(LinphoneEvent); LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc); void linphone_tunnel_destroy(LinphoneTunnel *tunnel); @@ -1335,7 +1336,8 @@ BELLE_SIP_TYPE_ID(LinphoneFriendList), BELLE_SIP_TYPE_ID(LinphoneXmlRpcRequest), BELLE_SIP_TYPE_ID(LinphoneXmlRpcRequestCbs), BELLE_SIP_TYPE_ID(LinphoneXmlRpcSession), -BELLE_SIP_TYPE_ID(LinphoneTunnelConfig) +BELLE_SIP_TYPE_ID(LinphoneTunnelConfig), +BELLE_SIP_TYPE_ID(LinphoneEvent) BELLE_SIP_DECLARE_TYPES_END diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 90c5def90..08e56194d 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -1093,6 +1093,7 @@ int linphone_proxy_config_send_publish(LinphoneProxyConfig *proxy, LinphonePrese , linphone_proxy_config_get_identity_address(proxy) , "presence" , linphone_proxy_config_get_publish_expires(proxy)); + linphone_event_ref(proxy->long_term_event); } proxy->long_term_event->internal = TRUE; diff --git a/mediastreamer2 b/mediastreamer2 index 97ee2fdb8..b77a99786 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 97ee2fdb8365480d95f366529db41f5291bd1fbf +Subproject commit b77a997867d77ec22a4a51dcd415c294298da8f6 From 285af5570a363bf43f729b5a824e8ff1cafc0936 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 7 Feb 2016 11:10:54 +0100 Subject: [PATCH 16/24] fix crash on android --- mediastreamer2 | 2 +- tester/call_tester.c | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index b77a99786..bd281bd79 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit b77a997867d77ec22a4a51dcd415c294298da8f6 +Subproject commit bd281bd79b204f268017b0c5b1750b016261c685 diff --git a/tester/call_tester.c b/tester/call_tester.c index 3fbca71d3..47cca6b3a 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -39,7 +39,7 @@ static char *create_filepath(const char *dir, const char *filename, const char * // prototype definition for call_recording() #ifdef ANDROID #ifdef HAVE_OPENH264 -extern void libmsopenh264_init(void); +extern void libmsopenh264_init(MSFactory *factory); #endif #endif @@ -4018,14 +4018,15 @@ static void record_call(const char *filename, bool_t enableVideo, const char *vi int dummy=0, i; bool_t call_succeeded = FALSE; -#if defined(HAVE_OPENH264) && defined(ANDROID) - ms_init(); - libmsopenh264_init(); -#endif - - marie = linphone_core_manager_new("marie_h264_rc"); pauline = linphone_core_manager_new("pauline_h264_rc"); + +#if defined(HAVE_OPENH264) && defined(ANDROID) + libmsopenh264_init(linphone_core_get_ms_factory(marie->lc)); + linphone_core_reload_ms_plugins(marie->lc); + libmsopenh264_init(linphone_core_get_ms_factory(pauline->lc)); + linphone_core_reload_ms_plugins(pauline->lc); +#endif marieParams = linphone_core_create_call_params(marie->lc, NULL); paulineParams = linphone_core_create_call_params(pauline->lc, NULL); @@ -4067,9 +4068,6 @@ static void record_call(const char *filename, bool_t enableVideo, const char *vi linphone_call_params_destroy(marieParams); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); -#if defined(HAVE_OPENH264) && defined(ANDROID) - ms_exit(); -#endif } static void audio_call_recording_test(void) { From 947d39f9ba8090a93f474949bc89d1d5a1174158 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 7 Feb 2016 11:18:47 +0100 Subject: [PATCH 17/24] fix too short timeouts for redirect test --- coreapi/help/notify.c | 2 +- tester/call_tester.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coreapi/help/notify.c b/coreapi/help/notify.c index bd96511f6..1a266c4d7 100644 --- a/coreapi/help/notify.c +++ b/coreapi/help/notify.c @@ -161,7 +161,7 @@ int main(int argc, char *argv[]){ } } - linphone_core_get_default_proxy(lc,&proxy_cfg); /* get default proxy config*/ + proxy_cfg = linphone_core_get_default_proxy_config(lc); /* get default proxy config*/ linphone_proxy_config_edit(proxy_cfg); /*start editing proxy configuration*/ linphone_proxy_config_enable_register(proxy_cfg,FALSE); /*de-activate registration for this proxy config*/ linphone_proxy_config_done(proxy_cfg); /*initiate REGISTER with expire = 0*/ diff --git a/tester/call_tester.c b/tester/call_tester.c index 47cca6b3a..29236cffb 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -3624,12 +3624,12 @@ static void call_redirect(void){ /* pauline should have ended the call */ BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallEnd,1,1000)); /* the call should still be ringing on marie's side */ - BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallOutgoingRinging, 1,1000)); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallOutgoingRinging, 1, int, "%i"); linphone_core_accept_call(laure->lc, linphone_core_get_current_call(laure->lc)); - BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallStreamsRunning, 1,1000)); - BC_ASSERT_TRUE(wait_for_list(lcs, &laure->stat.number_of_LinphoneCallStreamsRunning, 1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallStreamsRunning, 1,5000)); + BC_ASSERT_TRUE(wait_for_list(lcs, &laure->stat.number_of_LinphoneCallStreamsRunning, 1,5000)); BC_ASSERT_PTR_EQUAL(marie_call, linphone_core_get_current_call(marie->lc)); From db89a5c66563860045a32e6b8514c0c30a7b358d Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 7 Feb 2016 11:20:42 +0100 Subject: [PATCH 18/24] fix android test --- tester/call_tester.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index 29236cffb..94bdeba04 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -4023,9 +4023,9 @@ static void record_call(const char *filename, bool_t enableVideo, const char *vi #if defined(HAVE_OPENH264) && defined(ANDROID) libmsopenh264_init(linphone_core_get_ms_factory(marie->lc)); - linphone_core_reload_ms_plugins(marie->lc); + linphone_core_reload_ms_plugins(marie->lc, NULL); libmsopenh264_init(linphone_core_get_ms_factory(pauline->lc)); - linphone_core_reload_ms_plugins(pauline->lc); + linphone_core_reload_ms_plugins(pauline->lc, NULL); #endif marieParams = linphone_core_create_call_params(marie->lc, NULL); paulineParams = linphone_core_create_call_params(pauline->lc, NULL); From a0646a0f9d4913b30d0d0e80c2a1424f3cb9ee39 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 7 Feb 2016 22:35:36 +0100 Subject: [PATCH 19/24] add method to configure dns servers --- coreapi/bellesip_sal/sal_impl.c | 15 +++++++++++++++ coreapi/linphonecore.c | 4 ++++ coreapi/linphonecore.h | 10 ++++++++++ include/sal/sal.h | 1 + java/common/org/linphone/core/LinphoneCore.java | 6 ++++++ java/impl/org/linphone/core/LinphoneCoreImpl.java | 5 +++++ 6 files changed, 41 insertions(+) diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index 96a59b838..106ae2adf 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -816,6 +816,7 @@ bool_t sal_nat_helper_enabled(Sal *sal) { void sal_set_dns_timeout(Sal* sal,int timeout) { belle_sip_stack_set_dns_timeout(sal->stack, timeout); } + int sal_get_dns_timeout(const Sal* sal) { return belle_sip_stack_get_dns_timeout(sal->stack); } @@ -823,12 +824,26 @@ int sal_get_dns_timeout(const Sal* sal) { void sal_set_transport_timeout(Sal* sal,int timeout) { belle_sip_stack_set_transport_timeout(sal->stack, timeout); } + int sal_get_transport_timeout(const Sal* sal) { return belle_sip_stack_get_transport_timeout(sal->stack); } + +void sal_set_dns_servers(Sal *sal, const MSList *servers){ + belle_sip_list_t *l = NULL; + + /*we have to convert the MSList into a belle_sip_list_t first*/ + for (; servers != NULL; servers = servers->next){ + l = belle_sip_list_append(l, servers->data); + } + belle_sip_stack_set_dns_servers(sal->stack, l); + belle_sip_list_free(l); +} + void sal_enable_dns_srv(Sal *sal, bool_t enable) { belle_sip_stack_enable_dns_srv(sal->stack, (unsigned char)enable); } + bool_t sal_dns_srv_enabled(const Sal *sal) { return (bool_t)belle_sip_stack_dns_srv_enabled(sal->stack); } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 9afb4304f..f4c7e4e07 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1442,6 +1442,10 @@ int linphone_core_get_sip_transport_timeout(LinphoneCore *lc) { return sal_get_transport_timeout(lc->sal); } +void linphone_core_set_dns_servers(LinphoneCore *lc, const MSList *servers){ + sal_set_dns_servers(lc->sal, servers); +} + void linphone_core_enable_dns_srv(LinphoneCore *lc, bool_t enable) { sal_enable_dns_srv(lc->sal, enable); if (linphone_core_ready(lc)) diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 5d9eb905e..c14178aab 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -2720,6 +2720,16 @@ LINPHONE_PUBLIC void linphone_core_enable_dns_srv(LinphoneCore *lc, bool_t enabl */ LINPHONE_PUBLIC bool_t linphone_core_dns_srv_enabled(const LinphoneCore *lc); +/** + * Forces liblinphone to use the supplied list of dns servers, instead of system's ones. + * @param[in] lc #LinphoneCore object. + * @param[in] a #MSList of strings containing the IP addresses of DNS servers to be used. + * Setting to NULL restores default behaviour, which is to use the DNS server list provided by the system. + * The list is copied internally. + * @ingroup media_parameters + */ +LINPHONE_PUBLIC void linphone_core_set_dns_servers(LinphoneCore *lc, const MSList *servers); + /** * Returns the list of available audio codecs. * @param[in] lc The LinphoneCore object diff --git a/include/sal/sal.h b/include/sal/sal.h index fa42fe24c..e24007175 100644 --- a/include/sal/sal.h +++ b/include/sal/sal.h @@ -850,6 +850,7 @@ LINPHONE_PUBLIC void sal_set_dns_timeout(Sal* sal,int timeout); LINPHONE_PUBLIC int sal_get_dns_timeout(const Sal* sal); LINPHONE_PUBLIC void sal_set_transport_timeout(Sal* sal,int timeout); LINPHONE_PUBLIC int sal_get_transport_timeout(const Sal* sal); +void sal_set_dns_servers(Sal *sal, const MSList *servers); LINPHONE_PUBLIC void sal_enable_dns_srv(Sal *sal, bool_t enable); LINPHONE_PUBLIC bool_t sal_dns_srv_enabled(const Sal *sal); LINPHONE_PUBLIC void sal_set_dns_user_hosts_file(Sal *sal, const char *hosts_file); diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index d8083906a..1ef29b191 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -2274,4 +2274,10 @@ public interface LinphoneCore { **/ org.linphone.mediastream.Factory getMSFactory(); + /** + * Overrides the list of DNS servers to use. + * Passing null restores the default behaviour, which is to use the dns server list provided by the system. + **/ + public void setDnsServers(String servers[]); + } diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index e4cabfaa2..b29fe7d73 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -1625,4 +1625,9 @@ class LinphoneCoreImpl implements LinphoneCore { public org.linphone.mediastream.Factory getMSFactory(){ return (org.linphone.mediastream.Factory) getMSFactory(nativePtr); } + private native void setDnsServers(long nativePtr, String servers[]); + @Override + public void setDnsServers(String servers[]){ + setDnsServers(nativePtr, servers); + } } From 4fe85734d468779dd483dd0fa535179b1cb42690 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 7 Feb 2016 23:02:48 +0100 Subject: [PATCH 20/24] add JNI implementation for LinphoneCore.setDnsServers() --- coreapi/linphonecore_jni.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 48280b4d6..bd1ba17fc 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -6492,6 +6492,25 @@ extern "C" jboolean JNICALL Java_org_linphone_core_LinphoneCoreImpl_videoMultica return linphone_core_video_multicast_enabled((LinphoneCore*)ptr); } +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_setDnsServers(JNIEnv *env, jobject thiz, jlong lc, jobjectArray servers){ + MSList *l = NULL; + + if (servers != NULL){ + int count = env->GetArrayLength(servers); + + for (int i=0; i < count; i++) { + jstring server = (jstring) env->GetObjectArrayElement(servers, i); + const char *str = env->GetStringUTFChars(server, NULL); + if (str){ + l = ms_list_append(l, ms_strdup(str)); + env->ReleaseStringUTFChars(server, str); + } + } + } + linphone_core_set_dns_servers((LinphoneCore*)lc, l); + ms_list_free_with_data(l, ms_free); +} + JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_enableDnsSrv(JNIEnv *env, jobject thiz, jlong lc, jboolean yesno) { linphone_core_enable_dns_srv((LinphoneCore *)lc, yesno); } From 9c4bdf946aa0829533d8a656fca89b0e3ad3d14f Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 8 Feb 2016 10:44:14 +0100 Subject: [PATCH 21/24] account_creator.c: apply transport --- coreapi/account_creator.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index 0e1960c0e..dac1a2861 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -155,7 +155,7 @@ static LinphoneAccountCreatorStatus validate_uri(const char* username, const cha status = LinphoneAccountCreatorDomainInvalid; } - if (display_name && linphone_address_set_display_name(addr, display_name) != 0) { + if (display_name && (!strlen(display_name) || linphone_address_set_display_name(addr, display_name) != 0)) { status = LinphoneAccountCreatorDisplayNameInvalid; } linphone_address_unref(addr); @@ -411,16 +411,23 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr LinphoneProxyConfig *cfg = linphone_core_create_proxy_config(creator->core); char *identity_str = ms_strdup_printf("sip:%s@%s", creator->username, creator->domain); LinphoneAddress *identity = linphone_address_new(identity_str); + char *route = NULL; + char *domain = NULL; + ms_free(identity_str); if (creator->display_name) { linphone_address_set_display_name(identity, creator->display_name); } - - linphone_proxy_config_set_identity(cfg, linphone_address_as_string(identity)); - linphone_proxy_config_set_server_addr(cfg, creator->domain); - linphone_proxy_config_set_route(cfg, creator->route); + if (creator->route) { + route = ms_strdup_printf("%s;transport=%s", creator->route, linphone_transport_to_string(creator->transport)); + } + if (creator->domain) { + domain = ms_strdup_printf("%s;transport=%s", creator->domain, linphone_transport_to_string(creator->transport)); + } + linphone_proxy_config_set_identity_address(cfg, identity); + linphone_proxy_config_set_server_addr(cfg, domain); + linphone_proxy_config_set_route(cfg, route); linphone_proxy_config_enable_publish(cfg, FALSE); linphone_proxy_config_enable_register(cfg, TRUE); - ms_free(identity_str); if (strcmp(creator->domain, "sip.linphone.org") == 0) { linphone_proxy_config_enable_avpf(cfg, TRUE); From df758a5f1fc42be582e1818666b8ae920e842c43 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 8 Feb 2016 11:01:23 +0100 Subject: [PATCH 22/24] Force STUN server resolution for ICE tests. --- tester/call_tester.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tester/call_tester.c b/tester/call_tester.c index 94bdeba04..ddea0e758 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -1140,6 +1140,10 @@ static void check_nb_media_starts(LinphoneCoreManager *caller, LinphoneCoreManag } static void _call_with_ice_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports, bool_t forced_relay) { + // Force STUN server resolution to prevent DNS resolution issues on some machines + linphone_core_get_stun_server_addrinfo(pauline->lc); + linphone_core_get_stun_server_addrinfo(marie->lc); + linphone_core_set_user_agent(pauline->lc, "Natted Linphone", NULL); linphone_core_set_user_agent(marie->lc, "Natted Linphone", NULL); From b655775220a61b48e6721139bbd81215423bf179 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 8 Feb 2016 14:04:52 +0100 Subject: [PATCH 23/24] -enable ice message integrity check by default. -Can be disabled for backward compatibility with Linphone prior to December 2014 --- coreapi/linphonecall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 7bcd3e7fe..f2b0cfad1 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1106,7 +1106,7 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr if (linphone_core_get_firewall_policy(call->core) == LinphonePolicyUseIce) { call->ice_session = ice_session_new(); /*for backward compatibility purposes, shall be enabled by default in futur*/ - ice_session_enable_message_integrity_check(call->ice_session,lp_config_get_int(lc->config,"net","ice_session_enable_message_integrity_check",0)); + ice_session_enable_message_integrity_check(call->ice_session,lp_config_get_int(lc->config,"net","ice_session_enable_message_integrity_check",1)); ice_session_set_role(call->ice_session, IR_Controlling); } if (linphone_core_get_firewall_policy(call->core) == LinphonePolicyUseStun) { @@ -1338,7 +1338,7 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro if (md){ call->ice_session = ice_session_new(); /*for backward compatibility purposes, shall be enabled by default in futur*/ - ice_session_enable_message_integrity_check(call->ice_session,lp_config_get_int(lc->config,"net","ice_session_enable_message_integrity_check",0)); + ice_session_enable_message_integrity_check(call->ice_session,lp_config_get_int(lc->config,"net","ice_session_enable_message_integrity_check",1)); ice_session_set_role(call->ice_session, IR_Controlled); }else{ fpol=LinphonePolicyNoFirewall; From cda8dc6b46c6a724fe49af274768aef360f4044a Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 8 Feb 2016 17:01:54 +0100 Subject: [PATCH 24/24] Updated ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index bd281bd79..43de256e5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit bd281bd79b204f268017b0c5b1750b016261c685 +Subproject commit 43de256e523896f35387b4fa286c80e054591d78