diff --git a/build/android/Android.mk b/build/android/Android.mk index 77f38ed34..1b37721f9 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 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); diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index 8ff4fa08e..bc3b8ce7a 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/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/friend.c b/coreapi/friend.c index 0fbac0951..a2dec42ef 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -294,9 +294,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; } diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index e2d56c447..eced4689c 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -621,6 +621,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/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/coreapi/linphonecall.c b/coreapi/linphonecall.c index ba55fd1c2..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; @@ -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/coreapi/linphonecore.c b/coreapi/linphonecore.c index 191e72e78..25d1254c6 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); @@ -1425,6 +1444,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)) @@ -1464,20 +1487,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){ @@ -1527,6 +1548,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 b962c1ab8..412982fc7 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -2738,6 +2738,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 @@ -3872,6 +3882,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 cf9ef144c..eae030973 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*/ @@ -316,6 +306,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) { @@ -347,6 +340,7 @@ public: env->DeleteGlobalRef(subscriptionStateClass); env->DeleteGlobalRef(subscriptionDirClass); env->DeleteGlobalRef(logCollectionUploadStateClass); + env->DeleteGlobalRef(msFactoryClass); } jobject core; @@ -444,6 +438,9 @@ public: jmethodID logCollectionUploadStateId; jmethodID logCollectionUploadStateFromIntId; jmethodID logCollectionUploadProgressId; + + jclass msFactoryClass; + jmethodID msFactoryCtrId; }; /* @@ -1318,42 +1315,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); @@ -1364,7 +1361,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); @@ -1722,6 +1718,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 @@ -2298,9 +2302,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) { @@ -2318,9 +2324,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) { @@ -4973,8 +4981,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) { @@ -6793,6 +6802,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); } 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 8e2d45a6d..d598d6524 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -496,6 +496,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); @@ -555,7 +556,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); @@ -965,7 +966,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; @@ -1012,6 +1014,7 @@ struct _LinphoneCore struct _LinphoneEvent{ + belle_sip_object_t base; LinphoneSubscriptionDir dir; LinphoneCore *lc; SalOp *op; @@ -1019,7 +1022,6 @@ struct _LinphoneEvent{ LinphoneSubscriptionState subscription_state; LinphonePublishState publish_state; void *userdata; - int refcnt; char *name; int expires; bool_t terminating; @@ -1027,6 +1029,7 @@ struct _LinphoneEvent{ bool_t internal; }; +BELLE_SIP_DECLARE_VPTR(LinphoneEvent); LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc); void linphone_tunnel_destroy(LinphoneTunnel *tunnel); @@ -1400,6 +1403,7 @@ BELLE_SIP_TYPE_ID(LinphoneXmlRpcRequestCbs), BELLE_SIP_TYPE_ID(LinphoneXmlRpcSession), BELLE_SIP_TYPE_ID(LinphoneTunnelConfig), BELLE_SIP_TYPE_ID(LinphoneFriendListCbs) +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/include/sal/sal.h b/include/sal/sal.h index d95ad6ae4..ec5cf354c 100644 --- a/include/sal/sal.h +++ b/include/sal/sal.h @@ -851,6 +851,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 7f3a8acf1..3eaf8ecce 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -2285,4 +2285,16 @@ public interface LinphoneCore { * @param isReachable whether media network is reachable. */ 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(); + + /** + * 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 382d0f5de..30dd1d85b 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -959,10 +959,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() { @@ -1637,4 +1637,14 @@ 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); + } + private native void setDnsServers(long nativePtr, String servers[]); + @Override + public void setDnsServers(String servers[]){ + setDnsServers(nativePtr, servers); + } } diff --git a/mediastreamer2 b/mediastreamer2 index dd5ad1b73..43de256e5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit dd5ad1b738989bc6964f889e17f275eea85e11c0 +Subproject commit 43de256e523896f35387b4fa286c80e054591d78 diff --git a/tester/call_tester.c b/tester/call_tester.c index c1a267e36..ddea0e758 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 @@ -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); @@ -1110,7 +1139,14 @@ 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) { + // 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); + if (callee_with_ice){ linphone_core_set_firewall_policy(marie->lc,LinphonePolicyUseIce); } @@ -1127,6 +1163,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 +1176,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 +1221,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) { @@ -2266,6 +2314,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"); @@ -2426,7 +2490,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); } @@ -3564,12 +3628,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)); @@ -3958,14 +4022,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, NULL); + libmsopenh264_init(linphone_core_get_ms_factory(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); @@ -4007,9 +4072,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) { @@ -5765,7 +5827,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"); } @@ -6014,6 +6076,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), @@ -6072,6 +6135,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), 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 +MIID9DCCA12gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCBuzELMAkGA1UEBhMCR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ueYST1IBnfsBAiAk +o1Gahgx4IWQwvjfr+E+LB9eNfWvo+GZ7ZzjWF8ECgYEA9HbBuMH3ADSH1LBJelDF +8acScuiNtSUAIL6hmZ/bq5YJSQi95Ds2mD9RbVIVyks3LM4SfVzo8c5LuiyAN36t +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 BAMMDUplaGFuIE1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8WlX380tSQdlrJKUGwwroccl89fQsbYYmwk0zUZl2C2b5Qob8iznSAH2Xn3/Q +VciYuw126G9B5y8u1cWkpXUCgYAsM8JKaOdQQ+KH7lnBpxmjG/3VT3Eka4uCRRWP +b5DJNuYoCpgFK/WfmbxVdLxphe+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 diff --git a/tester/presence_tester.c b/tester/presence_tester.c index dc962c3ab..eb1692423 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); 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) {