From ad71bf10d2d78dd35711d2016db5e25e3df87ac2 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 15 May 2014 14:23:05 +0200 Subject: [PATCH 01/11] fix compilation issue on MS2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index fc3a434df..79c18b751 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit fc3a434df7845f20e0fc3415f25bbad4598fe3be +Subproject commit 79c18b75112262460fff45493e70733a2c35333c From f27a2387d4964d3631c6c1b721f5bccae5375870 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 15 May 2014 17:13:17 +0200 Subject: [PATCH 02/11] Add list of transient messages for messages that are still transitioning to either "delivered" or "error" state. This allows the get_history() call to return pointers that are valid when the chat_state_changed callback is called. --- coreapi/chat.c | 4 ++ coreapi/message_storage.c | 106 ++++++++++++++++++++++++-------------- coreapi/private.h | 1 + 3 files changed, 72 insertions(+), 39 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index 1c97389fe..fb2a34159 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -159,6 +159,7 @@ static void linphone_chat_room_delete_remote_composing_refresh_timer(LinphoneCha */ void linphone_chat_room_destroy(LinphoneChatRoom *cr){ LinphoneCore *lc=cr->lc; + ms_list_free_with_data(cr->transient_messages, (void (*)(void*))linphone_chat_message_unref); linphone_chat_room_delete_composing_idle_timer(cr); linphone_chat_room_delete_composing_refresh_timer(cr); linphone_chat_room_delete_remote_composing_refresh_timer(cr); @@ -212,6 +213,9 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM msg->from=linphone_address_new(identity); msg->storage_id=linphone_chat_message_store(msg); + // add to transient list + cr->transient_messages = ms_list_append(cr->transient_messages, linphone_chat_message_ref(msg)); + if (cr->is_composing == LinphoneIsComposingActive) { cr->is_composing = LinphoneIsComposingIdle; } diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index 360f28f0a..c7cc86e71 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -39,42 +39,61 @@ static const char *days[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"}; static const char *months[]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}; +static inline LinphoneChatMessage* get_transient_message(LinphoneChatRoom* cr, unsigned int storage_id){ + MSList* transients = cr->transient_messages; + LinphoneChatMessage* chat; + while( transients ){ + chat = (LinphoneChatMessage*)transients->data; + if(chat->storage_id == storage_id){ + return linphone_chat_message_ref(chat); + } + transients = transients->next; + } + return NULL; +} + static void create_chat_message(char **argv, void *data){ LinphoneChatRoom *cr = (LinphoneChatRoom *)data; - LinphoneChatMessage* new_message = linphone_chat_room_create_message(cr,argv[4]); LinphoneAddress *from; struct tm ret={0}; char tmp1[80]={0}; char tmp2[80]={0}; - - if(atoi(argv[3])==LinphoneChatMessageIncoming){ - new_message->dir=LinphoneChatMessageIncoming; - from=linphone_address_new(argv[2]); - } else { - new_message->dir=LinphoneChatMessageOutgoing; - from=linphone_address_new(argv[1]); - } - linphone_chat_message_set_from(new_message,from); - linphone_address_destroy(from); + unsigned int storage_id = atoi(argv[0]); - if(argv[5]!=NULL){ - int i,j; - sscanf(argv[5],"%3c %3c%d%d:%d:%d %d",tmp1,tmp2,&ret.tm_mday, - &ret.tm_hour,&ret.tm_min,&ret.tm_sec,&ret.tm_year); - ret.tm_year-=1900; - for(i=0;i<7;i++) { - if(strcmp(tmp1,days[i])==0) ret.tm_wday=i; + // check if the message exists in the transient list, in which case we should return that one. + LinphoneChatMessage* new_message = get_transient_message(cr, storage_id); + if( new_message == NULL ){ + new_message = linphone_chat_room_create_message(cr, argv[4]); + + if(atoi(argv[3])==LinphoneChatMessageIncoming){ + new_message->dir=LinphoneChatMessageIncoming; + from=linphone_address_new(argv[2]); + } else { + new_message->dir=LinphoneChatMessageOutgoing; + from=linphone_address_new(argv[1]); } - for(j=0;j<12;j++) { - if(strcmp(tmp2,months[j])==0) ret.tm_mon=j; + linphone_chat_message_set_from(new_message,from); + linphone_address_destroy(from); + + if(argv[5]!=NULL){ + int i,j; + sscanf(argv[5],"%3c %3c%d%d:%d:%d %d",tmp1,tmp2,&ret.tm_mday, + &ret.tm_hour,&ret.tm_min,&ret.tm_sec,&ret.tm_year); + ret.tm_year-=1900; + for(i=0;i<7;i++) { + if(strcmp(tmp1,days[i])==0) ret.tm_wday=i; + } + for(j=0;j<12;j++) { + if(strcmp(tmp2,months[j])==0) ret.tm_mon=j; + } + ret.tm_isdst=-1; } - ret.tm_isdst=-1; + new_message->time=argv[5]!=NULL ? mktime(&ret) : time(NULL); + new_message->is_read=atoi(argv[6]); + new_message->state=atoi(argv[7]); + new_message->storage_id=storage_id; + new_message->external_body_url=argv[8]?ms_strdup(argv[8]):NULL; } - new_message->time=argv[5]!=NULL ? mktime(&ret) : time(NULL); - new_message->is_read=atoi(argv[6]); - new_message->state=atoi(argv[7]); - new_message->storage_id=atoi(argv[0]); - new_message->external_body_url=argv[8]?ms_strdup(argv[8]):NULL; cr->messages_hist=ms_list_prepend(cr->messages_hist,new_message); } @@ -149,18 +168,27 @@ void linphone_chat_message_store_state(LinphoneChatMessage *msg){ msg->state,msg->message,my_ctime_r(&msg->time,time_str)); linphone_sql_request(lc->db,buf); sqlite3_free(buf); + + + } + + if( msg->state == LinphoneChatMessageStateDelivered + || msg->state == LinphoneChatMessageStateNotDelivered ){ + // message is not transient anymore, we can remove it from our transient list: + msg->chat_room->transient_messages = ms_list_remove(msg->chat_room->transient_messages, msg); + linphone_chat_message_unref(msg); } } void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr){ LinphoneCore *lc=linphone_chat_room_get_lc(cr); int read=1; - + if (lc->db==NULL) return ; char *peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr)); char *buf=sqlite3_mprintf("update history set read=%i where remoteContact = %Q;", - read,peer); + read,peer); linphone_sql_request(lc->db,buf); sqlite3_free(buf); ms_free(peer); @@ -168,7 +196,7 @@ void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr){ void linphone_chat_room_update_url(LinphoneChatRoom *cr, LinphoneChatMessage *msg) { LinphoneCore *lc=linphone_chat_room_get_lc(cr); - + if (lc->db==NULL) return ; char *buf=sqlite3_mprintf("update history set url=%Q where id=%i;",msg->external_body_url,msg->storage_id); @@ -179,9 +207,9 @@ void linphone_chat_room_update_url(LinphoneChatRoom *cr, LinphoneChatMessage *ms int linphone_chat_room_get_unread_messages_count(LinphoneChatRoom *cr){ LinphoneCore *lc=linphone_chat_room_get_lc(cr); int numrows=0; - + if (lc->db==NULL) return 0; - + char *peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr)); char *buf=sqlite3_mprintf("select count(*) from history where remoteContact = %Q and read = 0;",peer); sqlite3_stmt *selectStatement; @@ -199,9 +227,9 @@ int linphone_chat_room_get_unread_messages_count(LinphoneChatRoom *cr){ void linphone_chat_room_delete_message(LinphoneChatRoom *cr, LinphoneChatMessage *msg) { LinphoneCore *lc=cr->lc; - + if (lc->db==NULL) return ; - + char *buf=sqlite3_mprintf("delete from history where id = %i;", msg->storage_id); linphone_sql_request(lc->db,buf); sqlite3_free(buf); @@ -209,9 +237,9 @@ void linphone_chat_room_delete_message(LinphoneChatRoom *cr, LinphoneChatMessage void linphone_chat_room_delete_history(LinphoneChatRoom *cr){ LinphoneCore *lc=cr->lc; - + if (lc->db==NULL) return ; - + char *peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr)); char *buf=sqlite3_mprintf("delete from history where remoteContact = %Q;",peer); linphone_sql_request(lc->db,buf); @@ -224,7 +252,7 @@ MSList *linphone_chat_room_get_history(LinphoneChatRoom *cr,int nb_message){ MSList *ret; char *buf; char *peer; - + if (lc->db==NULL) return NULL; peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr)); cr->messages_hist = NULL; @@ -248,7 +276,7 @@ void linphone_create_table(sqlite3* db){ char* errmsg=NULL; int ret; ret=sqlite3_exec(db,"CREATE TABLE if not exists history (id INTEGER PRIMARY KEY AUTOINCREMENT, localContact TEXT NOT NULL, remoteContact TEXT NOT NULL, direction INTEGER, message TEXT, time TEXT NOT NULL, read INTEGER, status INTEGER);", - 0,0,&errmsg); + 0,0,&errmsg); if(ret != SQLITE_OK) { ms_error("Error in creation: %s.\n", errmsg); sqlite3_free(errmsg); @@ -269,7 +297,7 @@ void linphone_update_table(sqlite3* db) { void linphone_message_storage_init_chat_rooms(LinphoneCore *lc) { char *buf; - + if (lc->db==NULL) return; buf=sqlite3_mprintf("SELECT remoteContact FROM history Group By remoteContact;"); linphone_sql_request_all(lc->db,buf,lc); @@ -301,7 +329,7 @@ void linphone_core_message_storage_close(LinphoneCore *lc){ } } -#else +#else unsigned int linphone_chat_message_store(LinphoneChatMessage *cr){ return 0; diff --git a/coreapi/private.h b/coreapi/private.h index e8294620b..e3a97b8e5 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -451,6 +451,7 @@ struct _LinphoneChatRoom{ LinphoneAddress *peer_url; void * user_data; MSList *messages_hist; + MSList *transient_messages; LinphoneIsComposingState remote_is_composing; LinphoneIsComposingState is_composing; belle_sip_source_t *remote_composing_refresh_timer; From 51a5189c76025f8ec7e36a878fd0e65680b9f4cf Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 15 May 2014 17:13:28 +0200 Subject: [PATCH 03/11] Fix leak in JNI --- coreapi/linphonecore_jni.cc | 472 ++++++++++++++++++------------------ 1 file changed, 237 insertions(+), 235 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 4124f3092..f6478c5fe 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -109,7 +109,7 @@ static void linphone_android_ortp_log_handler(OrtpLogLevel lev, const char *fmt, const char *levname="undef"; vsnprintf(str, sizeof(str) - 1, fmt, args); str[sizeof(str) - 1] = '\0'; - + int prio; switch(lev){ case ORTP_DEBUG: prio = ANDROID_LOG_DEBUG; levname="debug"; break; @@ -207,7 +207,7 @@ public: callStateFromIntId = env->GetStaticMethodID(callStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCall$State;"); transferStateId = env->GetMethodID(listenerClass,"transferState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;Lorg/linphone/core/LinphoneCall$State;)V"); - + /*callStatsUpdated(LinphoneCore lc, LinphoneCall call, LinphoneCallStats stats);*/ callStatsUpdatedId = env->GetMethodID(listenerClass, "callStatsUpdated", "(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;Lorg/linphone/core/LinphoneCallStats;)V"); @@ -224,7 +224,7 @@ public: /*void newSubscriptionRequest(LinphoneCore lc, LinphoneFriend lf, String url)*/ newSubscriptionRequestId = env->GetMethodID(listenerClass,"newSubscriptionRequest","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneFriend;Ljava/lang/String;)V"); - + authInfoRequestedId = env->GetMethodID(listenerClass,"authInfoRequested","(Lorg/linphone/core/LinphoneCore;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); /*void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf);*/ @@ -244,8 +244,8 @@ public: "(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneEvent;Lorg/linphone/core/PublishState;)V"); notifyRecvId = env->GetMethodID(listenerClass,"notifyReceived", "(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneEvent;Ljava/lang/String;Lorg/linphone/core/LinphoneContent;)V"); - - + + proxyClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneProxyConfigImpl")); proxyCtrId = env->GetMethodID(proxyClass,"", "(Lorg/linphone/core/LinphoneCoreImpl;J)V"); @@ -268,22 +268,22 @@ public: callStatsId = env->GetMethodID(callStatsClass, "", "(JJ)V"); callSetAudioStatsId = env->GetMethodID(callClass, "setAudioStats", "(Lorg/linphone/core/LinphoneCallStats;)V"); callSetVideoStatsId = env->GetMethodID(callClass, "setVideoStats", "(Lorg/linphone/core/LinphoneCallStats;)V"); - + infoMessageClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneInfoMessageImpl")); infoMessageCtor = env->GetMethodID(infoMessageClass,"", "(J)V"); - + linphoneEventClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneEventImpl")); linphoneEventCtrId = env->GetMethodID(linphoneEventClass,"", "(J)V"); - + subscriptionStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/SubscriptionState")); subscriptionStateFromIntId = env->GetStaticMethodID(subscriptionStateClass,"fromInt","(I)Lorg/linphone/core/SubscriptionState;"); - + publishStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/PublishState")); publishStateFromIntId = env->GetStaticMethodID(publishStateClass,"fromInt","(I)Lorg/linphone/core/PublishState;"); - + subscriptionDirClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/SubscriptionDir")); subscriptionDirFromIntId = env->GetStaticMethodID(subscriptionDirClass,"fromInt","(I)Lorg/linphone/core/SubscriptionDir;"); - + configuringStateId = env->GetMethodID(listenerClass,"configuringStatus","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$RemoteProvisioningState;Ljava/lang/String;)V"); configuringStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$RemoteProvisioningState")); configuringStateFromIntId = env->GetStaticMethodID(configuringStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$RemoteProvisioningState;"); @@ -330,7 +330,7 @@ public: jmethodID authInfoRequestedId; jmethodID publishStateId; jmethodID notifyRecvId; - + jclass configuringStateClass; jmethodID configuringStateId; jmethodID configuringStateFromIntId; @@ -378,19 +378,19 @@ public: jclass addressClass; jmethodID addressCtrId; - + jclass infoMessageClass; jmethodID infoMessageCtor; - + jclass linphoneEventClass; jmethodID linphoneEventCtrId; - + jclass subscriptionStateClass; jmethodID subscriptionStateFromIntId; - + jclass publishStateClass; jmethodID publishStateFromIntId; - + jclass subscriptionDirClass; jmethodID subscriptionDirFromIntId; @@ -464,7 +464,7 @@ public: if (call!=NULL){ void *up=linphone_call_get_user_pointer(call); - + if (up==NULL){ jobj=env->NewObject(callClass,callCtrId,(jlong)call); jobj=env->NewGlobalRef(jobj); @@ -568,7 +568,7 @@ public: ,env->NewObject(lcData->addressClass,lcData->addressCtrId,(jlong)from) ,message ? env->NewStringUTF(message) : NULL); } - static void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *msg) { + static void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *msg) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); if (result != 0) { @@ -580,7 +580,7 @@ public: ,lcData->messageReceivedId ,lcData->core ,env->NewObject(lcData->chatRoomClass,lcData->chatRoomCtrId,(jlong)room) - ,env->NewObject(lcData->chatMessageClass,lcData->chatMessageCtrId,(jlong)msg)); + ,env->NewObject(lcData->chatMessageClass,lcData->chatMessageCtrId,(jlong)msg)); } static void is_composing_received(LinphoneCore *lc, LinphoneChatRoom *room) { JNIEnv *env = 0; @@ -737,7 +737,7 @@ public: ,content ? create_java_linphone_content(env,content) : NULL ); } - + static void configuringStatus(LinphoneCore *lc, LinphoneConfiguringState status, const char *message) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); @@ -782,7 +782,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv* libmsbcg729_init(); #endif #ifdef HAVE_ISAC - libmsisac_init(); + libmsisac_init(); #endif jlong nativePtr = (jlong)linphone_core_new( &ldata->vTable @@ -824,13 +824,13 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCallImpl_sendInfoMessage(J } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_stopRinging(JNIEnv* env, jobject thiz, jlong lc) { - linphone_core_stop_ringing((LinphoneCore*)lc); + linphone_core_stop_ringing((LinphoneCore*)lc); } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setChatDatabasePath(JNIEnv* env, jobject thiz, jlong lc, jstring jpath) { - const char* path = env->GetStringUTFChars(jpath, NULL); - linphone_core_set_chat_database_path((LinphoneCore*)lc, path); - env->ReleaseStringUTFChars(jpath, path); + const char* path = env->GetStringUTFChars(jpath, NULL); + linphone_core_set_chat_database_path((LinphoneCore*)lc, path); + env->ReleaseStringUTFChars(jpath, path); } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPrimaryContact(JNIEnv* env, jobject thiz, jlong lc, jstring jdisplayname, jstring jusername) { @@ -838,10 +838,10 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPrimaryContact(JNIEnv const char* username = jusername ? env->GetStringUTFChars(jusername, NULL) : NULL; LinphoneAddress *parsed = linphone_core_get_primary_contact_parsed((LinphoneCore*)lc); - if (parsed != NULL) { - linphone_address_set_display_name(parsed, displayname); - linphone_address_set_username(parsed, username); - char *contact = linphone_address_as_string(parsed); + if (parsed != NULL) { + linphone_address_set_display_name(parsed, displayname); + linphone_address_set_username(parsed, username); + char *contact = linphone_address_as_string(parsed); linphone_core_set_primary_contact((LinphoneCore*)lc, contact); } @@ -851,7 +851,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPrimaryContact(JNIEnv extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getPrimaryContactUsername(JNIEnv* env, jobject thiz, jlong lc) { LinphoneAddress* identity = linphone_core_get_primary_contact_parsed((LinphoneCore*)lc); - const char * username = linphone_address_get_username(identity); + const char * username = linphone_address_get_username(identity); return username ? env->NewStringUTF(username) : NULL; } @@ -880,7 +880,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getDefaultProxyConfig( } extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_getProxyConfigList(JNIEnv* env, jobject thiz, jlong lc) { - const MSList* proxies = linphone_core_get_proxy_config_list((LinphoneCore*)lc); + const MSList* proxies = linphone_core_get_proxy_config_list((LinphoneCore*)lc); int proxyCount = ms_list_size(proxies); jlongArray jProxies = env->NewLongArray(proxyCount); jlong *jInternalArray = env->GetLongArrayElements(jProxies, NULL); @@ -932,14 +932,14 @@ extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_getAuthInfosList(J extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findAuthInfos(JNIEnv* env, jobject thiz, jlong lc, jstring jusername, jstring jrealm, jstring jdomain) { const char* username = env->GetStringUTFChars(jusername, NULL); - const char* realm = jrealm ? env->GetStringUTFChars(jrealm, NULL) : NULL; - const char* domain = jdomain ? env->GetStringUTFChars(jdomain, NULL) : NULL; - const LinphoneAuthInfo *authInfo = linphone_core_find_auth_info((LinphoneCore*)lc, realm, username, domain); - - if (realm) + const char* realm = jrealm ? env->GetStringUTFChars(jrealm, NULL) : NULL; + const char* domain = jdomain ? env->GetStringUTFChars(jdomain, NULL) : NULL; + const LinphoneAuthInfo *authInfo = linphone_core_find_auth_info((LinphoneCore*)lc, realm, username, domain); + + if (realm) env->ReleaseStringUTFChars(jrealm, realm); - if (domain) - env->ReleaseStringUTFChars(jdomain, domain); + if (domain) + env->ReleaseStringUTFChars(jdomain, domain); env->ReleaseStringUTFChars(jusername, username); return (jlong) authInfo; @@ -1204,7 +1204,7 @@ extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_listVideoPayloadTy codecs = codecs->next; } - env->ReleaseLongArrayElements(jCodecs, jInternalArray, 0); + env->ReleaseLongArrayElements(jCodecs, jInternalArray, 0); return jCodecs; } @@ -1287,7 +1287,7 @@ extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getCurrentCall(JNIEnv ,jlong lc ) { LinphoneCoreData *lcdata=(LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)lc); - + return lcdata->getCall(env,linphone_core_get_current_call((LinphoneCore*)lc)); } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addFriend(JNIEnv* env @@ -1340,7 +1340,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getOrCreateChatRoom(JNI ,jstring jto) { const char* to = env->GetStringUTFChars(jto, NULL); - LinphoneChatRoom* lResult = linphone_core_get_or_create_chat_room((LinphoneCore*)lc,to); + LinphoneChatRoom* lResult = linphone_core_get_or_create_chat_room((LinphoneCore*)lc,to); env->ReleaseStringUTFChars(jto, to); return (jlong)lResult; } @@ -1746,12 +1746,12 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneAuthInfoImpl_getRealm */ JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneAuthInfoImpl_getDomain (JNIEnv *env , jobject, jlong auth_info) { - const char* domain = linphone_auth_info_get_domain((LinphoneAuthInfo*)auth_info); - if (domain) { - return env->NewStringUTF(domain); - } else { - return NULL; - } + const char* domain = linphone_auth_info_get_domain((LinphoneAuthInfo*)auth_info); + if (domain) { + return env->NewStringUTF(domain); + } else { + return NULL; + } } /* @@ -1800,10 +1800,10 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneAuthInfoImpl_setRealm */ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneAuthInfoImpl_setDomain (JNIEnv *env, jobject, jlong auth_info, jstring jdomain) { - const char* domain = jdomain ? env->GetStringUTFChars(jdomain, NULL) : NULL; - linphone_auth_info_set_domain((LinphoneAuthInfo*)auth_info, domain); - if (domain) - env->ReleaseStringUTFChars(jdomain, domain); + const char* domain = jdomain ? env->GetStringUTFChars(jdomain, NULL) : NULL; + linphone_auth_info_set_domain((LinphoneAuthInfo*)auth_info, domain); + if (domain) + env->ReleaseStringUTFChars(jdomain, domain); } /* @@ -2087,7 +2087,7 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getLocalLateRate( extern "C" void Java_org_linphone_core_LinphoneCallStatsImpl_updateStats(JNIEnv *env, jobject thiz, jlong call_ptr, jint mediatype) { if (mediatype==LINPHONE_CALL_STATS_AUDIO) linphone_call_get_audio_stats((LinphoneCall*)call_ptr); - else + else linphone_call_get_video_stats((LinphoneCall*)call_ptr); } @@ -2248,7 +2248,7 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isEchoLimiterEnabled extern "C" jobject Java_org_linphone_core_LinphoneCallImpl_getReplacedCall( JNIEnv* env ,jobject thiz ,jlong ptr) { - LinphoneCoreData *lcd=(LinphoneCoreData*)linphone_core_get_user_data(linphone_call_get_core((LinphoneCall*)ptr)); + LinphoneCoreData *lcd=(LinphoneCoreData*)linphone_core_get_user_data(linphone_call_get_core((LinphoneCall*)ptr)); return lcd->getCall(env,linphone_call_get_replaced_call((LinphoneCall*)ptr)); } @@ -2367,22 +2367,24 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getFriendByAddress(JNIE } //LinphoneChatRoom extern "C" jlongArray Java_org_linphone_core_LinphoneChatRoomImpl_getHistory(JNIEnv* env - ,jobject thiz - ,jlong ptr - ,jint limit) { - MSList* history = linphone_chat_room_get_history((LinphoneChatRoom*)ptr, limit); - int historySize = ms_list_size(history); - jlongArray jHistory = env->NewLongArray(historySize); - jlong *jInternalArray = env->GetLongArrayElements(jHistory, NULL); + ,jobject thiz + ,jlong ptr + ,jint limit) { + MSList* history = linphone_chat_room_get_history((LinphoneChatRoom*)ptr, limit); + int historySize = ms_list_size(history); + jlongArray jHistory = env->NewLongArray(historySize); + jlong *jInternalArray = env->GetLongArrayElements(jHistory, NULL); - for (int i = 0; i < historySize; i++) { - jInternalArray[i] = (unsigned long) (history->data); - history = history->next; - } + for (int i = 0; i < historySize; i++) { + jInternalArray[i] = (unsigned long) (history->data); + history = history->next; + } - env->ReleaseLongArrayElements(jHistory, jInternalArray, 0); + ms_list_free(history); - return jHistory; + env->ReleaseLongArrayElements(jHistory, jInternalArray, 0); + + return jHistory; } extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_getPeerAddress(JNIEnv* env ,jobject thiz @@ -2400,37 +2402,37 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatM return (jlong) chatMessage; } extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatMessage2(JNIEnv* env - ,jobject thiz - ,jlong ptr - ,jstring jmessage - ,jstring jurl - ,jint state - ,jlong time - ,jboolean read - ,jboolean incoming) { - const char* message = jmessage?env->GetStringUTFChars(jmessage, NULL):NULL; - const char* url = jurl?env->GetStringUTFChars(jurl, NULL):NULL; + ,jobject thiz + ,jlong ptr + ,jstring jmessage + ,jstring jurl + ,jint state + ,jlong time + ,jboolean read + ,jboolean incoming) { + const char* message = jmessage?env->GetStringUTFChars(jmessage, NULL):NULL; + const char* url = jurl?env->GetStringUTFChars(jurl, NULL):NULL; - LinphoneChatMessage *chatMessage = linphone_chat_room_create_message_2( - (LinphoneChatRoom *)ptr, message, url, (LinphoneChatMessageState)state, - (time_t)time, read, incoming); + LinphoneChatMessage *chatMessage = linphone_chat_room_create_message_2( + (LinphoneChatRoom *)ptr, message, url, (LinphoneChatMessageState)state, + (time_t)time, read, incoming); - if (jmessage != NULL) - env->ReleaseStringUTFChars(jmessage, message); - if (jurl != NULL) - env->ReleaseStringUTFChars(jurl, url); + if (jmessage != NULL) + env->ReleaseStringUTFChars(jmessage, message); + if (jurl != NULL) + env->ReleaseStringUTFChars(jurl, url); - return (jlong) chatMessage; + return (jlong) chatMessage; } extern "C" jint Java_org_linphone_core_LinphoneChatRoomImpl_getUnreadMessagesCount(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - return (jint) linphone_chat_room_get_unread_messages_count((LinphoneChatRoom*)ptr); + ,jobject thiz + ,jlong ptr) { + return (jint) linphone_chat_room_get_unread_messages_count((LinphoneChatRoom*)ptr); } extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_deleteHistory(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - linphone_chat_room_delete_history((LinphoneChatRoom*)ptr); + ,jobject thiz + ,jlong ptr) { + linphone_chat_room_delete_history((LinphoneChatRoom*)ptr); } JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneChatRoomImpl_compose(JNIEnv *env, jobject thiz, jlong ptr) { linphone_chat_room_compose((LinphoneChatRoom *)ptr); @@ -2439,34 +2441,34 @@ JNIEXPORT jboolean JNICALL Java_org_linphone_core_LinphoneChatRoomImpl_isRemoteC return (jboolean)linphone_chat_room_is_remote_composing((LinphoneChatRoom *)ptr); } extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_deleteMessage(JNIEnv* env - ,jobject thiz - ,jlong room - ,jlong msg) { - linphone_chat_room_delete_message((LinphoneChatRoom*)room, (LinphoneChatMessage*)msg); + ,jobject thiz + ,jlong room + ,jlong msg) { + linphone_chat_room_delete_message((LinphoneChatRoom*)room, (LinphoneChatMessage*)msg); } extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_markAsRead(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - linphone_chat_room_mark_as_read((LinphoneChatRoom*)ptr); + ,jobject thiz + ,jlong ptr) { + linphone_chat_room_mark_as_read((LinphoneChatRoom*)ptr); } extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_updateUrl(JNIEnv* env - ,jobject thiz - ,jlong room - ,jlong msg) { - linphone_chat_room_update_url((LinphoneChatRoom*)room, (LinphoneChatMessage*)msg); + ,jobject thiz + ,jlong room + ,jlong msg) { + linphone_chat_room_update_url((LinphoneChatRoom*)room, (LinphoneChatMessage*)msg); } extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_destroy(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - linphone_chat_room_destroy((LinphoneChatRoom*)ptr); + ,jobject thiz + ,jlong ptr) { + linphone_chat_room_destroy((LinphoneChatRoom*)ptr); } extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_store(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - linphone_chat_message_store((LinphoneChatMessage*)ptr); + ,jobject thiz + ,jlong ptr) { + linphone_chat_message_store((LinphoneChatMessage*)ptr); } extern "C" jstring Java_org_linphone_core_LinphoneChatMessageImpl_getText(JNIEnv* env @@ -2540,51 +2542,51 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatMessageImpl_getTime(JNIEnv* } extern "C" jint Java_org_linphone_core_LinphoneChatMessageImpl_getStatus(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - return (jint) linphone_chat_message_get_state((LinphoneChatMessage*)ptr); + ,jobject thiz + ,jlong ptr) { + return (jint) linphone_chat_message_get_state((LinphoneChatMessage*)ptr); } extern "C" jboolean Java_org_linphone_core_LinphoneChatMessageImpl_isRead(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - return (jboolean) linphone_chat_message_is_read((LinphoneChatMessage*)ptr); + ,jobject thiz + ,jlong ptr) { + return (jboolean) linphone_chat_message_is_read((LinphoneChatMessage*)ptr); } extern "C" jboolean Java_org_linphone_core_LinphoneChatMessageImpl_isOutgoing(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - return (jboolean) linphone_chat_message_is_outgoing((LinphoneChatMessage*)ptr); + ,jobject thiz + ,jlong ptr) { + return (jboolean) linphone_chat_message_is_outgoing((LinphoneChatMessage*)ptr); } extern "C" jint Java_org_linphone_core_LinphoneChatMessageImpl_getStorageId(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - return (jint) linphone_chat_message_get_storage_id((LinphoneChatMessage*)ptr); + ,jobject thiz + ,jlong ptr) { + return (jint) linphone_chat_message_get_storage_id((LinphoneChatMessage*)ptr); } extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_unref(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - linphone_chat_message_unref((LinphoneChatMessage*)ptr); + ,jobject thiz + ,jlong ptr) { + linphone_chat_message_unref((LinphoneChatMessage*)ptr); } extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_getChatRooms(JNIEnv* env - ,jobject thiz - ,jlong ptr) { - MSList* chats = linphone_core_get_chat_rooms((LinphoneCore*)ptr); - int chatsSize = ms_list_size(chats); - jlongArray jChats = env->NewLongArray(chatsSize); - jlong *jInternalArray = env->GetLongArrayElements(jChats, NULL); + ,jobject thiz + ,jlong ptr) { + MSList* chats = linphone_core_get_chat_rooms((LinphoneCore*)ptr); + int chatsSize = ms_list_size(chats); + jlongArray jChats = env->NewLongArray(chatsSize); + jlong *jInternalArray = env->GetLongArrayElements(jChats, NULL); - for (int i = 0; i < chatsSize; i++) { - jInternalArray[i] = (unsigned long) (chats->data); - chats = chats->next; - } + for (int i = 0; i < chatsSize; i++) { + jInternalArray[i] = (unsigned long) (chats->data); + chats = chats->next; + } - env->ReleaseLongArrayElements(jChats, jInternalArray, 0); + env->ReleaseLongArrayElements(jChats, jInternalArray, 0); - return jChats; + return jChats; } extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendMessage(JNIEnv* env @@ -2615,7 +2617,7 @@ static void chat_room_impl_callback(LinphoneChatMessage* msg, LinphoneChatMessag method, jmessage, env->CallStaticObjectMethod(lcData->chatMessageStateClass,lcData->chatMessageStateFromIntId,(jint)state)); - + if (state == LinphoneChatMessageStateDelivered || state == LinphoneChatMessageStateNotDelivered) { env->DeleteGlobalRef(listener); env->DeleteGlobalRef(jmessage); @@ -2878,10 +2880,10 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_setPreferredVideo extern "C" jintArray Java_org_linphone_core_LinphoneCoreImpl_getPreferredVideoSize(JNIEnv *env, jobject thiz, jlong lc){ MSVideoSize vsize = linphone_core_get_preferred_video_size((LinphoneCore *)lc); - jintArray arr = env->NewIntArray(2); + jintArray arr = env->NewIntArray(2); int tVsize [2]= {vsize.width,vsize.height}; - env->SetIntArrayRegion(arr, 0, 2, tVsize); - return arr; + env->SetIntArrayRegion(arr, 0, 2, tVsize); + return arr; } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDownloadBandwidth(JNIEnv *env, jobject thiz, jlong lc, jint bw){ @@ -2974,8 +2976,8 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSignalingTransportPor } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableIpv6(JNIEnv* env,jobject thiz - ,jlong lc, jboolean enable) { - linphone_core_enable_ipv6((LinphoneCore*)lc,enable); + ,jlong lc, jboolean enable) { + linphone_core_enable_ipv6((LinphoneCore*)lc,enable); } extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isIpv6Enabled(JNIEnv* env,jobject thiz, jlong lc) { @@ -2983,7 +2985,7 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isIpv6Enabled(JNIEnv } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_adjustSoftwareVolume(JNIEnv* env,jobject thiz - ,jlong ptr, jint db) { + ,jlong ptr, jint db) { linphone_core_set_playback_gain_db((LinphoneCore *) ptr, db); } @@ -3343,7 +3345,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getUpnpExternalIpaddr * Method: subscribe * Signature: (JJLjava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; */ -JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_subscribe(JNIEnv *env, jobject jcore, jlong coreptr, jlong addrptr, +JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_subscribe(JNIEnv *env, jobject jcore, jlong coreptr, jlong addrptr, jstring jevname, jint expires, jstring jtype, jstring jsubtype, jbyteArray jdata, jstring jencoding){ LinphoneCore *lc=(LinphoneCore*)coreptr; LinphoneAddress *addr=(LinphoneAddress*)addrptr; @@ -3352,7 +3354,7 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_subscribe(JNIE jobject jev=NULL; const char *evname=env->GetStringUTFChars(jevname,NULL); LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc); - + if (jtype){ content.type=(char*)env->GetStringUTFChars(jtype,NULL); content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL); @@ -3388,7 +3390,7 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_publish(JNIEnv jobject jev=NULL; const char *evname=env->GetStringUTFChars(jevname,NULL); LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc); - + if (jtype){ content.type=(char*)env->GetStringUTFChars(jtype,NULL); content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL); @@ -3412,8 +3414,8 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_publish(JNIEnv // LpConfig extern "C" jlong Java_org_linphone_core_LpConfigImpl_newLpConfigImpl(JNIEnv *env, jobject thiz, jstring file) { - const char *cfile = env->GetStringUTFChars(file, NULL); - LpConfig *lp = lp_config_new(cfile); + const char *cfile = env->GetStringUTFChars(file, NULL); + LpConfig *lp = lp_config_new(cfile); env->ReleaseStringUTFChars(file, cfile); return (jlong) lp; } @@ -3430,112 +3432,112 @@ extern "C" void Java_org_linphone_core_LpConfigImpl_delete(JNIEnv *env, jobject extern "C" void Java_org_linphone_core_LpConfigImpl_setInt(JNIEnv *env, jobject thiz, jlong lpc, jstring section, jstring key, jint value) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - lp_config_set_int((LpConfig *)lpc, csection, ckey, (int) value); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + lp_config_set_int((LpConfig *)lpc, csection, ckey, (int) value); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); } extern "C" jint Java_org_linphone_core_LpConfigImpl_getInt(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jint defaultValue) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - int returnValue = lp_config_get_int((LpConfig *)lpc, csection, ckey, (int) defaultValue); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); - return (jint) returnValue; + jstring section, jstring key, jint defaultValue) { + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + int returnValue = lp_config_get_int((LpConfig *)lpc, csection, ckey, (int) defaultValue); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); + return (jint) returnValue; } extern "C" void Java_org_linphone_core_LpConfigImpl_setFloat(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jfloat value) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - lp_config_set_float((LpConfig *)lpc, csection, ckey, (float) value); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); + jstring section, jstring key, jfloat value) { + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + lp_config_set_float((LpConfig *)lpc, csection, ckey, (float) value); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); } extern "C" jfloat Java_org_linphone_core_LpConfigImpl_getFloat(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jfloat defaultValue) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - float returnValue = lp_config_get_float((LpConfig *)lpc, csection, ckey, (float) defaultValue); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); - return (jfloat) returnValue; + jstring section, jstring key, jfloat defaultValue) { + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + float returnValue = lp_config_get_float((LpConfig *)lpc, csection, ckey, (float) defaultValue); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); + return (jfloat) returnValue; } extern "C" void Java_org_linphone_core_LpConfigImpl_setBool(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jboolean value) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - lp_config_set_int((LpConfig *)lpc, csection, ckey, value ? 1 : 0); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); + jstring section, jstring key, jboolean value) { + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + lp_config_set_int((LpConfig *)lpc, csection, ckey, value ? 1 : 0); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); } extern "C" jboolean Java_org_linphone_core_LpConfigImpl_getBool(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jboolean defaultValue) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - int returnValue = lp_config_get_int((LpConfig *)lpc, csection, ckey, defaultValue ? 1 : 0); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); - return (jboolean) returnValue == 1; + jstring section, jstring key, jboolean defaultValue) { + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + int returnValue = lp_config_get_int((LpConfig *)lpc, csection, ckey, defaultValue ? 1 : 0); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); + return (jboolean) returnValue == 1; } extern "C" void Java_org_linphone_core_LpConfigImpl_setString(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jstring value) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - const char *cvalue = value ? env->GetStringUTFChars(value, NULL) : NULL; - lp_config_set_string((LpConfig *)lpc, csection, ckey, cvalue); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); - if (value) env->ReleaseStringUTFChars(value, cvalue); + jstring section, jstring key, jstring value) { + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + const char *cvalue = value ? env->GetStringUTFChars(value, NULL) : NULL; + lp_config_set_string((LpConfig *)lpc, csection, ckey, cvalue); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); + if (value) env->ReleaseStringUTFChars(value, cvalue); } extern "C" jstring Java_org_linphone_core_LpConfigImpl_getString(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jstring defaultValue) { + jstring section, jstring key, jstring defaultValue) { const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - const char *cvalue = defaultValue ? env->GetStringUTFChars(defaultValue, NULL) : NULL; + const char *ckey = env->GetStringUTFChars(key, NULL); + const char *cvalue = defaultValue ? env->GetStringUTFChars(defaultValue, NULL) : NULL; const char *returnValue = lp_config_get_string((LpConfig *)lpc, csection, ckey, cvalue); - jstring jreturnValue = NULL; - if (returnValue) - jreturnValue = env->NewStringUTF(returnValue); + jstring jreturnValue = NULL; + if (returnValue) + jreturnValue = env->NewStringUTF(returnValue); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); if (cvalue) - env->ReleaseStringUTFChars(defaultValue, cvalue); + env->ReleaseStringUTFChars(defaultValue, cvalue); - return jreturnValue; + return jreturnValue; } extern "C" void Java_org_linphone_core_LpConfigImpl_setIntRange(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jint min, jint max) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - lp_config_set_range((LpConfig *)lpc, csection, ckey, min, max); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); + jstring section, jstring key, jint min, jint max) { + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + lp_config_set_range((LpConfig *)lpc, csection, ckey, min, max); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); } extern "C" jintArray Java_org_linphone_core_LpConfigImpl_getIntRange(JNIEnv *env, jobject thiz, jlong lpc, - jstring section, jstring key, jint defaultmin, jint defaultmax) { - const char *csection = env->GetStringUTFChars(section, NULL); - const char *ckey = env->GetStringUTFChars(key, NULL); - int *values = (int*)calloc(2, sizeof(int)); - lp_config_get_range((LpConfig *)lpc, csection, ckey, &values[0], &values[1], defaultmin, defaultmax); - jintArray returnValues = env->NewIntArray(2); - env->SetIntArrayRegion(returnValues, 0, 2, values); - ms_free(values); - env->ReleaseStringUTFChars(section, csection); - env->ReleaseStringUTFChars(key, ckey); - return returnValues; + jstring section, jstring key, jint defaultmin, jint defaultmax) { + const char *csection = env->GetStringUTFChars(section, NULL); + const char *ckey = env->GetStringUTFChars(key, NULL); + int *values = (int*)calloc(2, sizeof(int)); + lp_config_get_range((LpConfig *)lpc, csection, ckey, &values[0], &values[1], defaultmin, defaultmax); + jintArray returnValues = env->NewIntArray(2); + env->SetIntArrayRegion(returnValues, 0, 2, values); + ms_free(values); + env->ReleaseStringUTFChars(section, csection); + env->ReleaseStringUTFChars(key, ckey); + return returnValues; } static jobject create_java_linphone_content(JNIEnv *env, const LinphoneContent *content){ @@ -3543,19 +3545,19 @@ static jobject create_java_linphone_content(JNIEnv *env, const LinphoneContent * jmethodID ctor; jstring jtype, jsubtype, jencoding; jbyteArray jdata=NULL; - + contentClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneContentImpl")); ctor = env->GetMethodID(contentClass,"", "(Ljava/lang/String;Ljava/lang/String;[BLjava/lang/String;)V"); - + jtype=env->NewStringUTF(content->type); jsubtype=env->NewStringUTF(content->subtype); jencoding=content->encoding ? env->NewStringUTF(content->encoding) : NULL; - + if (content->data){ jdata=env->NewByteArray(content->size); env->SetByteArrayRegion(jdata,0,content->size,(jbyte*)content->data); } - + jobject jobj=env->NewObject(contentClass,ctor,jtype, jsubtype, jdata,jencoding); env->DeleteGlobalRef(contentClass); return jobj; @@ -3581,7 +3583,7 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneInfoMessageImpl_getCont */ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneInfoMessageImpl_setContent(JNIEnv *env, jobject jobj, jlong infoptr, jstring jtype, jstring jsubtype, jstring jdata){ LinphoneContent content={0}; - + content.type=(char*)env->GetStringUTFChars(jtype,NULL); content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL); content.data=(void*)env->GetStringUTFChars(jdata,NULL); @@ -3629,7 +3631,7 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneInfoMessageImpl_delete(JNI JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreFactoryImpl__1setLogHandler(JNIEnv *env, jobject jfactory, jobject jhandler){ static int init_done=FALSE; - + if (!init_done){ handler_class=(jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneLogHandler")); loghandler_id=env->GetMethodID(handler_class,"log", "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V"); @@ -3685,7 +3687,7 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_notify(JNIEnv *e LinphoneContent content={0}; LinphoneEvent *ev=(LinphoneEvent*)evptr; jint err; - + if (jtype){ content.type=(char*)env->GetStringUTFChars(jtype,NULL); content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL); @@ -3693,9 +3695,9 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_notify(JNIEnv *e content.data=(void*)env->GetByteArrayElements(jdata,NULL); content.size=env->GetArrayLength(jdata); } - + err=linphone_event_notify(ev,content.type ? &content : NULL); - + if (jtype){ env->ReleaseStringUTFChars(jtype,content.type); env->ReleaseStringUTFChars(jsubtype,content.subtype); @@ -3714,7 +3716,7 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updateSubscribe( LinphoneContent content={0}; LinphoneEvent *ev=(LinphoneEvent*)evptr; jint err; - + if (jtype){ content.type=(char*)env->GetStringUTFChars(jtype,NULL); content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL); @@ -3722,9 +3724,9 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updateSubscribe( content.data=(void*)env->GetByteArrayElements(jdata,NULL); content.size=env->GetArrayLength(jdata); } - + err=linphone_event_update_subscribe(ev,content.type ? &content : NULL); - + if (jtype){ env->ReleaseStringUTFChars(jtype,content.type); env->ReleaseStringUTFChars(jsubtype,content.subtype); @@ -3743,7 +3745,7 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updatePublish(JN LinphoneContent content={0}; LinphoneEvent *ev=(LinphoneEvent*)evptr; jint err; - + if (jtype){ content.type=(char*)env->GetStringUTFChars(jtype,NULL); content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL); @@ -3751,9 +3753,9 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updatePublish(JN content.data=(void*)env->GetByteArrayElements(jdata,NULL); content.size=env->GetArrayLength(jdata); } - + err=linphone_event_update_publish(ev,content.type ? &content : NULL); - + if (jtype){ env->ReleaseStringUTFChars(jtype,content.type); env->ReleaseStringUTFChars(jsubtype,content.subtype); From 1ffb06aecc3fd851b940e01f0346d87f5b59946c Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 15 May 2014 17:20:52 +0200 Subject: [PATCH 04/11] Enable detection of SQLite3 without PKG_CONFIG --- configure.ac | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index ba4ae31a0..676f7f98e 100644 --- a/configure.ac +++ b/configure.ac @@ -767,23 +767,31 @@ AC_ARG_ENABLE(msg-storage, [enable_msg_storage=auto] ) - AM_CONDITIONAL(BUILD_MSG_STORAGE, test x$enable_msg_storage = xtrue) + if test x$enable_msg_storage != xfalse; then - PKG_CHECK_MODULES(SQLITE3,[ sqlite3 >= 3.6.0],[ + PKG_CHECK_MODULES(SQLITE3,[sqlite3 >= 3.6.0],[found_sqlite=yes],[found_sqlite=no]) + if test "$found_sqlite" = "no"; then + dnl Check the lib presence in case the PKG-CONFIG version is not found + AC_CHECK_LIB(sqlite3, sqlite3_open, [SQLITE3_LIBS+=" -lsqlite3 " + found_sqlite=yes], + [AC_MSG_ERROR([No pkg-config or alternate SQLITE found, needed for message storage.])] + ) + fi + if test "$found_sqlite" = "yes"; then SQLITE3_CFLAGS+="-DMSG_STORAGE_ENABLED" - AC_SUBST(SQLITE3_CFLAGS) - AC_SUBST(SQLITE3_LIBS) - enable_msg_storage=true - ],[ - if test x$enable_msg_storage = xtrue; then - AC_MSG_ERROR([sqlite3 required for message storage not found.]) + else + if test x$enable_msg_storage = xtrue; then + AC_MSG_ERROR([sqlite3, required for message storage, not found]) + enable_msg_storage=false fi - enable_msg_storage=false - ] ) + fi + AC_SUBST(SQLITE3_CFLAGS) + AC_SUBST(SQLITE3_LIBS) fi + PKG_CHECK_MODULES(BELLESIP, [belle-sip >= 1.3.1]) From 7eefcf399ff39b8805e38b3726a19dedc89c95eb Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 15 May 2014 18:07:13 +0200 Subject: [PATCH 05/11] add more test for invite without sdp --- tester/call_tester.c | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index fb9571205..81fcf787c 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -587,10 +587,7 @@ static bool_t check_ice(LinphoneCoreManager* caller, LinphoneCoreManager* callee return success; } -static void _call_with_ice(bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); - +static void _call_with_ice_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports) { if (callee_with_ice){ linphone_core_set_firewall_policy(marie->lc,LinphonePolicyUseIce); linphone_core_set_stun_server(marie->lc,"stun.linphone.org"); @@ -624,14 +621,31 @@ static void _call_with_ice(bool_t caller_with_ice, bool_t callee_with_ice, bool_ CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallEnd,1)); CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallEnd,1)); +} +static void _call_with_ice(bool_t caller_with_ice, bool_t callee_with_ice, bool_t random_ports) { + LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + _call_with_ice_base(pauline,marie,caller_with_ice,callee_with_ice,random_ports); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } - static void call_with_ice(void){ _call_with_ice(TRUE,TRUE,FALSE); } +static void call_with_ice_no_sdp(void){ +#ifdef 0 + LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + + linphone_core_enable_sdp_200_ack(pauline->lc,TRUE); + _call_with_ice_base(pauline,marie,TRUE,TRUE,FALSE); + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +#endif +} + static void call_with_ice_random_ports(void){ _call_with_ice(TRUE,TRUE,TRUE); } @@ -909,9 +923,7 @@ static void call_with_declined_video(void) { linphone_core_manager_destroy(pauline); } -static void video_call(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); +static void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie) { LinphoneCallParams* callee_params; LinphoneCallParams* caller_params; LinphoneCall* marie_call; @@ -946,6 +958,19 @@ static void video_call(void) { CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallEnd,1)); } +} +static void video_call(void) { + LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + video_call_base(marie,pauline); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} +static void video_call_no_sdp(void) { + LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + linphone_core_enable_sdp_200_ack(pauline->lc,TRUE); + video_call_base(pauline,marie); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } @@ -2122,6 +2147,7 @@ test_t call_tests[] = { { "SRTP call with declined srtp", call_with_declined_srtp }, #ifdef VIDEO_ENABLED { "Simple video call",video_call}, + { "Video call without SDP",video_call_no_sdp}, { "SRTP ice video call", srtp_video_ice_call }, { "ZRTP ice video call", zrtp_video_ice_call }, { "Call with video added", call_with_video_added }, @@ -2144,6 +2170,7 @@ test_t call_tests[] = { { "Unattended call transfer with error", unattended_call_transfer_with_error }, { "Call transfer existing call outgoing call", call_transfer_existing_call_outgoing_call }, { "Call with ICE", call_with_ice }, + { "Call with ICE without SDP", call_with_ice_no_sdp }, { "Call with ICE (random ports)", call_with_ice_random_ports }, { "Call from ICE to not ICE",ice_to_not_ice}, { "Call from not ICE to ICE",not_ice_to_ice}, From 44bafb091aac9602e5b3a0e30b93801a93d61a7e Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 15 May 2014 19:13:51 +0200 Subject: [PATCH 06/11] fix crash with ICE in case of no incoming SDP --- coreapi/linphonecall.c | 2 +- tester/call_tester.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 5202108b7..a424e4e4c 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -637,7 +637,7 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro linphone_call_init_media_streams(call); switch (linphone_core_get_firewall_policy(call->core)) { case LinphonePolicyUseIce: - linphone_call_prepare_ice(call,TRUE); + linphone_call_prepare_ice(call,md!=NULL); break; case LinphonePolicyUseStun: call->ping_time=linphone_core_run_stun_tests(call->core,call); diff --git a/tester/call_tester.c b/tester/call_tester.c index 81fcf787c..bbbc05f23 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -634,7 +634,6 @@ static void call_with_ice(void){ } static void call_with_ice_no_sdp(void){ -#ifdef 0 LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); @@ -643,7 +642,6 @@ static void call_with_ice_no_sdp(void){ linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); -#endif } static void call_with_ice_random_ports(void){ From a53e77b669594790116c7c40e74ae1d139c98858 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 16 May 2014 10:09:45 +0200 Subject: [PATCH 07/11] Update oRTP submodule for AVPF fixes. --- oRTP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oRTP b/oRTP index c93363ac0..519fabfed 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit c93363ac023c2122bfdfb8b0d99b811dffbad827 +Subproject commit 519fabfed1b38c9cde977d4c7a8a7c2bb642e0cb From eb6462663a6116117a2b6a6ae92b80d672d94c54 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 16 May 2014 22:13:48 +0200 Subject: [PATCH 08/11] adapt to lastest belle-sip and fix bad naming of variables. --- coreapi/remote_provisioning.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/coreapi/remote_provisioning.c b/coreapi/remote_provisioning.c index 3eb848b71..8c57b47ef 100644 --- a/coreapi/remote_provisioning.c +++ b/coreapi/remote_provisioning.c @@ -84,11 +84,11 @@ static int linphone_remote_provisioning_load_file( LinphoneCore* lc, const char* static void belle_request_process_response_event(void *ctx, const belle_http_response_event_t *event) { LinphoneCore *lc = (LinphoneCore *)ctx; - belle_sip_message_t *body = BELLE_SIP_MESSAGE(event->response); - const char *message = belle_sip_message_get_body(body); + belle_sip_message_t *message = BELLE_SIP_MESSAGE(event->response); + const char *body = belle_sip_message_get_body(message); if (belle_http_response_get_status_code(event->response) == 200) { - linphone_remote_provisioning_apply(lc, message); + linphone_remote_provisioning_apply(lc, body); } else { linphone_configuring_terminated(lc, LinphoneConfiguringFailed, "http error"); } @@ -118,14 +118,17 @@ int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char return linphone_remote_provisioning_load_file(lc, file_path); } else { belle_generic_uri_t *uri=belle_generic_uri_parse(remote_provisioning_uri); - belle_http_request_listener_callbacks_t belle_request_listener = { - belle_request_process_response_event, - belle_request_process_io_error, - belle_request_process_timeout, - belle_request_process_auth_requested - }; - belle_http_request_listener_t *listener = belle_http_request_listener_create_from_callbacks(&belle_request_listener, lc); + belle_http_request_listener_callbacks_t belle_request_listener={0}; + belle_http_request_listener_t *listener; belle_http_request_t *request; + + belle_request_listener.process_response=belle_request_process_response_event; + belle_request_listener.process_auth_requested=belle_request_process_auth_requested; + belle_request_listener.process_io_error=belle_request_process_io_error; + belle_request_listener.process_timeout=belle_request_process_timeout; + + listener = belle_http_request_listener_create_from_callbacks(&belle_request_listener, lc); + if (uri==NULL) { belle_sip_error("Invalid provisioning URI [%s]",remote_provisioning_uri); From a6aa0a50a5266911780ad5cbd995d057673ac452 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 16 May 2014 22:29:46 +0200 Subject: [PATCH 09/11] fix ICE call without SDP test --- coreapi/linphonecall.c | 17 ++++++++++++----- mediastreamer2 | 2 +- tester/call_tester.c | 12 +++++++++++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index a424e4e4c..27ce04a3a 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -583,6 +583,7 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro LinphoneCall *call=ms_new0(LinphoneCall,1); char *from_str; const SalMediaDescription *md; + LinphoneFirewallPolicy fpol; call->dir=LinphoneCallIncoming; sal_op_set_user_pointer(op,call); @@ -628,16 +629,22 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro // In this case WE chose the media parameters according to policy. call->params.has_video &= linphone_core_media_description_contains_video_stream(md); } + fpol=linphone_core_get_firewall_policy(call->core); /*create the ice session now if ICE is required*/ - if (linphone_core_get_firewall_policy(call->core)==LinphonePolicyUseIce){ - call->ice_session = ice_session_new(); - ice_session_set_role(call->ice_session, IR_Controlled); + if (fpol==LinphonePolicyUseIce){ + if (md){ + call->ice_session = ice_session_new(); + ice_session_set_role(call->ice_session, IR_Controlled); + }else{ + fpol=LinphonePolicyNoFirewall; + ms_warning("ICE not supported for incoming INVITE without SDP."); + } } /*reserve the sockets immediately*/ linphone_call_init_media_streams(call); - switch (linphone_core_get_firewall_policy(call->core)) { + switch (fpol) { case LinphonePolicyUseIce: - linphone_call_prepare_ice(call,md!=NULL); + linphone_call_prepare_ice(call,TRUE); break; case LinphonePolicyUseStun: call->ping_time=linphone_core_run_stun_tests(call->core,call); diff --git a/mediastreamer2 b/mediastreamer2 index 79c18b751..ae94af9ab 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 79c18b75112262460fff45493e70733a2c35333c +Subproject commit ae94af9abbfb56bedcd37485bc38934ebbbc9c87 diff --git a/tester/call_tester.c b/tester/call_tester.c index bbbc05f23..d20cf1fd6 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -633,12 +633,22 @@ static void call_with_ice(void){ _call_with_ice(TRUE,TRUE,FALSE); } +/*ICE is not expected to work in this case, however this should not crash*/ static void call_with_ice_no_sdp(void){ LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); linphone_core_enable_sdp_200_ack(pauline->lc,TRUE); - _call_with_ice_base(pauline,marie,TRUE,TRUE,FALSE); + + linphone_core_set_firewall_policy(marie->lc,LinphonePolicyUseIce); + linphone_core_set_stun_server(marie->lc,"stun.linphone.org"); + + linphone_core_set_firewall_policy(pauline->lc,LinphonePolicyUseIce); + linphone_core_set_stun_server(pauline->lc,"stun.linphone.org"); + + call(pauline,marie); + + liblinphone_tester_check_rtcp(marie,pauline); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); From e7a1d7f52cbc3400e0117e89fc362e589fccd641 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 19 May 2014 10:46:42 +0200 Subject: [PATCH 10/11] Fix configure.ac to allow message_storage=auto --- configure.ac | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 676f7f98e..b3c66dc98 100644 --- a/configure.ac +++ b/configure.ac @@ -773,18 +773,15 @@ if test x$enable_msg_storage != xfalse; then PKG_CHECK_MODULES(SQLITE3,[sqlite3 >= 3.6.0],[found_sqlite=yes],[found_sqlite=no]) if test "$found_sqlite" = "no"; then dnl Check the lib presence in case the PKG-CONFIG version is not found - AC_CHECK_LIB(sqlite3, sqlite3_open, [SQLITE3_LIBS+=" -lsqlite3 " - found_sqlite=yes], - [AC_MSG_ERROR([No pkg-config or alternate SQLITE found, needed for message storage.])] - ) + AC_CHECK_LIB(sqlite3, sqlite3_open, [SQLITE3_LIBS+=" -lsqlite3 "; found_sqlite=yes], [foo=bar]) fi if test "$found_sqlite" = "yes"; then SQLITE3_CFLAGS+="-DMSG_STORAGE_ENABLED" else if test x$enable_msg_storage = xtrue; then AC_MSG_ERROR([sqlite3, required for message storage, not found]) - enable_msg_storage=false fi + enable_msg_storage=false fi AC_SUBST(SQLITE3_CFLAGS) From 0e7ef89a6b9f015a5a05f8a6b2674218121c3af0 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 19 May 2014 11:44:07 +0200 Subject: [PATCH 11/11] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index ae94af9ab..77022250a 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit ae94af9abbfb56bedcd37485bc38934ebbbc9c87 +Subproject commit 77022250a04459648101c3b4152d83158bbe0e63