diff --git a/configure.ac b/configure.ac index ac2f1b546..477c7a17e 100644 --- a/configure.ac +++ b/configure.ac @@ -1101,12 +1101,6 @@ else ],[foo=bar],[$CUNIT_LIBS]) fi -case "$target_os" in - *linux*) - # Eliminate -lstdc++ addition to postdeps for cross compiles. - postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` - ;; -esac dnl ################################################## diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index 96be8a14d..0dc338351 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -126,7 +126,7 @@ else liblinphone_la_SOURCES+=vcard_stubs.c vcard.h endif -liblinphone_la_LDFLAGS=-version-info $(LIBLINPHONE_SO_VERSION) -no-undefined +liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined if HAVE_LD_OUTPUT_DEF liblinphone_la_LDFLAGS += -Wl,--output-def,liblinphone-$(LIBLINPHONE_SO_CURRENT).def diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index 4646806f0..740345fa0 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -132,12 +132,12 @@ void linphone_account_creator_set_user_data(LinphoneAccountCreator *creator, voi static LinphoneAccountCreatorStatus validate_uri(const char* username, const char* domain, const char* route, const char* display_name) { LinphoneProxyConfig* proxy = linphone_proxy_config_new(); LinphoneAddress* addr; - - linphone_proxy_config_set_identity(proxy, "sip:user@domain.com"); + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorOK; + linphone_proxy_config_set_identity(proxy, "sip:userame@domain.com"); if (route && linphone_proxy_config_set_route(proxy, route) != 0) { - linphone_proxy_config_destroy(proxy); - return LinphoneAccountCreatorRouteInvalid; + status = LinphoneAccountCreatorRouteInvalid; + goto end; } if (username) { @@ -145,24 +145,23 @@ static LinphoneAccountCreatorStatus validate_uri(const char* username, const cha } else { addr = linphone_address_clone(linphone_proxy_config_get_identity_address(proxy)); } - linphone_proxy_config_destroy(proxy); if (addr == NULL) { - return LinphoneAccountCreatorUsernameInvalid; + status = LinphoneAccountCreatorUsernameInvalid; } - if (domain) { - ms_error("TODO: detect invalid domain"); - linphone_address_set_domain(addr, domain); + if (domain && linphone_address_set_domain(addr, domain) != 0) { + status = LinphoneAccountCreatorDomainInvalid; } - if (display_name) { - ms_error("TODO: detect invalid display name"); - linphone_address_set_display_name(addr, display_name); + if (display_name && linphone_address_set_display_name(addr, display_name) != 0) { + status = LinphoneAccountCreatorDisplayNameInvalid; } linphone_address_unref(addr); - return LinphoneAccountCreatorOK; +end: + linphone_proxy_config_destroy(proxy); + return status; } static bool_t is_matching_regex(const char *entry, const char* regex) { diff --git a/coreapi/address.c b/coreapi/address.c index 79ed08d60..13fc15d3a 100644 --- a/coreapi/address.c +++ b/coreapi/address.c @@ -89,37 +89,51 @@ const char *linphone_address_get_domain(const LinphoneAddress *u){ /** * Sets the display name. **/ -void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name){ +int linphone_address_set_display_name(LinphoneAddress *u, const char *display_name){ sal_address_set_display_name(u,display_name); + return 0; } /** * Sets the username. **/ -void linphone_address_set_username(LinphoneAddress *uri, const char *username){ +int linphone_address_set_username(LinphoneAddress *uri, const char *username){ sal_address_set_username(uri,username); + return 0; } /** * Sets the domain. **/ -void linphone_address_set_domain(LinphoneAddress *uri, const char *host){ - sal_address_set_domain(uri,host); +int linphone_address_set_domain(LinphoneAddress *uri, const char *host){ + if (host) { + char *identity = ms_strdup_printf("sip:%s", host); + LinphoneAddress* test = linphone_address_new(identity); + ms_free(identity); + if (test) { + sal_address_set_domain(uri,host); + linphone_address_destroy(test); + return 0; + } + } + return -1; } /** * Sets the port number. **/ -void linphone_address_set_port(LinphoneAddress *uri, int port){ +int linphone_address_set_port(LinphoneAddress *uri, int port){ sal_address_set_port(uri,port); + return 0; } /** * Set a transport. **/ -void linphone_address_set_transport(LinphoneAddress *uri, LinphoneTransportType tp){ +int linphone_address_set_transport(LinphoneAddress *uri, LinphoneTransportType tp){ sal_address_set_transport(uri,(SalTransport)tp); + return 0; } /** diff --git a/coreapi/conference.cc b/coreapi/conference.cc index 6cc888a2f..0c7406152 100644 --- a/coreapi/conference.cc +++ b/coreapi/conference.cc @@ -845,7 +845,7 @@ int linphone_conference_get_participant_count(const LinphoneConference *obj) { } MSList *linphone_conference_get_participants(const LinphoneConference *obj) { - const list participants = ((Conference *)obj)->getParticipants(); + const list &participants = ((Conference *)obj)->getParticipants(); MSList *participants_list = NULL; for(list::const_iterator it=participants.begin();it!=participants.end();it++) { LinphoneAddress *uri = linphone_address_clone(it->getUri()); diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 714e0d50d..9eaa4bdb1 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -438,10 +438,11 @@ LINPHONE_PUBLIC const char *linphone_address_get_display_name(const LinphoneAddr LINPHONE_PUBLIC const char *linphone_address_get_username(const LinphoneAddress *u); LINPHONE_PUBLIC const char *linphone_address_get_domain(const LinphoneAddress *u); LINPHONE_PUBLIC int linphone_address_get_port(const LinphoneAddress *u); -LINPHONE_PUBLIC void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name); -LINPHONE_PUBLIC void linphone_address_set_username(LinphoneAddress *uri, const char *username); -LINPHONE_PUBLIC void linphone_address_set_domain(LinphoneAddress *uri, const char *host); -LINPHONE_PUBLIC void linphone_address_set_port(LinphoneAddress *uri, int port); +LINPHONE_PUBLIC int linphone_address_set_display_name(LinphoneAddress *u, const char *display_name); +LINPHONE_PUBLIC int linphone_address_set_username(LinphoneAddress *uri, const char *username); +LINPHONE_PUBLIC int linphone_address_set_domain(LinphoneAddress *uri, const char *host); +LINPHONE_PUBLIC int linphone_address_set_port(LinphoneAddress *uri, int port); +LINPHONE_PUBLIC int linphone_address_set_transport(LinphoneAddress *uri,LinphoneTransportType type); /*remove tags, params etc... so that it is displayable to the user*/ LINPHONE_PUBLIC void linphone_address_clean(LinphoneAddress *uri); LINPHONE_PUBLIC bool_t linphone_address_is_secure(const LinphoneAddress *addr); @@ -449,7 +450,6 @@ LINPHONE_PUBLIC bool_t linphone_address_get_secure(const LinphoneAddress *addr); LINPHONE_PUBLIC void linphone_address_set_secure(LinphoneAddress *addr, bool_t enabled); LINPHONE_PUBLIC bool_t linphone_address_is_sip(const LinphoneAddress *uri); LINPHONE_PUBLIC LinphoneTransportType linphone_address_get_transport(const LinphoneAddress *uri); -LINPHONE_PUBLIC void linphone_address_set_transport(LinphoneAddress *uri,LinphoneTransportType type); LINPHONE_PUBLIC const char *linphone_address_get_method_param(const LinphoneAddress *addr); LINPHONE_PUBLIC void linphone_address_set_method_param(LinphoneAddress *addr, const char *method); LINPHONE_PUBLIC char *linphone_address_as_string(const LinphoneAddress *u); @@ -3926,9 +3926,10 @@ LINPHONE_PUBLIC int linphone_core_stop_conference_recording(LinphoneCore *lc); LINPHONE_PUBLIC LinphoneConference *linphone_core_get_conference(LinphoneCore *lc); /** * Get URIs of all participants of one conference + * The returned MSList contains URIs of all participant. That list must be + * freed after use and each URI must be unref with linphone_address_unref() * @param obj A #LinphoneConference - * @return A #MSList containing URIs of all participant. That list must be - * freed after utilisation and each URI must be unref with linphone_address_unref() + * @return \mslist{LinphoneAddress} */ LINPHONE_PUBLIC MSList *linphone_conference_get_participants(const LinphoneConference *obj); /** diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index e429327a8..c66c4618e 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -4350,11 +4350,11 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv return (jint)linphone_core_get_conference_size((LinphoneCore *) pCore); } -extern "C" jobject Jave_org_linphone_core_LinphoneCoreImpl_getConference(JNIEnv *env, jobject thiz, jlong pCore) { +extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getConference(JNIEnv *env, jobject thiz, jlong pCore) { jclass conference_class = env->FindClass("org/linphone/core/LinphoneConferenceImpl"); jmethodID conference_constructor = env->GetMethodID(conference_class, "", "(J)V"); LinphoneConference *conf = linphone_core_get_conference((LinphoneCore *)pCore); - if(conf) return env->NewObject(conference_class, conference_constructor, conf); + if(conf) return env->NewObject(conference_class, conference_constructor, (jlong)conf); else return NULL; } @@ -4496,7 +4496,7 @@ extern "C" jobject Java_org_linphone_core_LinphoneCallImpl_getConference(JNIEnv jclass conference_class = env->FindClass("org/linphone/core/LinphoneConferenceImpl"); jmethodID conference_constructor = env->GetMethodID(conference_class, "", "(J)V"); LinphoneConference *conf = linphone_call_get_conference((LinphoneCall *)ptr); - if(conf) return env->NewObject(conference_class, conference_constructor, conf); + if(conf) return env->NewObject(conference_class, conference_constructor, (jlong)conf); return NULL; } @@ -6781,11 +6781,10 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getNortpTimeout(J -JNIEXPORT jobjectArray JNICALL Java_org_linphone_core_LinphoneConferenceImpl_getParticipants(JNIEnv *env, jobject thiz, jlong pconference) { +extern "C" jobjectArray Java_org_linphone_core_LinphoneConferenceImpl_getParticipants(JNIEnv *env, jobject thiz, jlong pconference) { MSList *participants, *it; jclass addr_class = env->FindClass("org/linphone/core/LinphoneAddressImpl"); - jclass addr_list_class = env->FindClass("[Lorg/linphone/core/LinphoneAddressImpl;"); - jmethodID addr_constructor = env->GetMethodID(addr_class, "", "(J)"); + jmethodID addr_constructor = env->GetMethodID(addr_class, "", "(J)V"); jobjectArray jaddr_list; int i; @@ -6793,13 +6792,14 @@ JNIEXPORT jobjectArray JNICALL Java_org_linphone_core_LinphoneConferenceImpl_get jaddr_list = env->NewObjectArray(ms_list_size(participants), addr_class, NULL); for(it=participants, i=0; it; it=ms_list_next(it), i++) { LinphoneAddress *addr = (LinphoneAddress *)it->data; - jobject jaddr = env->NewObject(addr_class, addr_constructor, addr); + jobject jaddr = env->NewObject(addr_class, addr_constructor, (jlong)addr); env->SetObjectArrayElement(jaddr_list, i, jaddr); } + ms_list_free(participants); return jaddr_list; } -JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneConferenteImpl_removeParticipant(JNIEnv *env, jobject thiz, jlong pconference, jobject uri) { +extern "C" jint Java_org_linphone_core_LinphoneConferenteImpl_removeParticipant(JNIEnv *env, jobject thiz, jlong pconference, jobject uri) { jfieldID native_ptr_attr = env->GetFieldID(env->GetObjectClass(uri), "nativePtr", "J"); LinphoneAddress *addr = (LinphoneAddress *)env->GetLongField(uri, native_ptr_attr); return linphone_conference_remove_participant((LinphoneConference *)pconference, addr); diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index 9973bde9c..83bd411b7 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -818,13 +818,13 @@ bool_t lp_config_relative_file_exists(const LpConfig *lpconfig, const char *file if (lpconfig->filename == NULL) { return FALSE; } else { - char *filename = ms_strdup(lpconfig->filename); - const char *dir = _lp_config_dirname(filename); + char *conf_path = ms_strdup(lpconfig->filename); + const char *dir = _lp_config_dirname(conf_path); char *filepath = ms_strdup_printf("%s/%s", dir, filename); char *realfilepath = lp_realpath(filepath, NULL); FILE *file; - ms_free(filename); + ms_free(conf_path); ms_free(filepath); if(realfilepath == NULL) return FALSE; @@ -912,7 +912,7 @@ int lp_config_read_relative_file(const LpConfig *lpconfig, const char *filename, return 0; err: - ms_free(filepath); + ms_free(dup_config_file); ms_free(filepath); if(realfilepath) ms_free(realfilepath); return -1; diff --git a/mediastreamer2 b/mediastreamer2 index 8472cad77..66ad948e8 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 8472cad77bcc4b0ef3b0a02d2aa962d54f873d1a +Subproject commit 66ad948e85e77f1d92545bb5e12823cd5a489d6a diff --git a/tester/multi_call_tester.c b/tester/multi_call_tester.c index 61135aecd..3807f095c 100644 --- a/tester/multi_call_tester.c +++ b/tester/multi_call_tester.c @@ -185,6 +185,7 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag LinphoneCall* marie_call_pauline; LinphoneCall* pauline_called_by_marie; LinphoneCall* marie_call_laure; + LinphoneConference *conference; const MSList* calls; bool_t is_remote_conf; MSList* lcs=ms_list_append(NULL,marie->lc); @@ -258,6 +259,14 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag BC_ASSERT_EQUAL(linphone_core_get_media_encryption(marie->lc),linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)),int,"%d"); } + BC_ASSERT_PTR_NOT_NULL(conference = linphone_core_get_conference(marie->lc)); + if(conference) { + MSList *participants = linphone_conference_get_participants(conference); + BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), linphone_core_get_conference_size(marie->lc), int, "%d"); + BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), ms_list_size(participants), int, "%d"); + ms_list_free_with_data(participants, (void(*)(void *))linphone_address_destroy); + } + linphone_core_terminate_conference(marie->lc); BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,is_remote_conf?2:1,10000));