From 7d4a50043e3f39735f85d9491470d9c5d8229252 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 12 Apr 2013 08:58:57 +0200 Subject: [PATCH 01/13] fix various compilation issue --- gtk/logging.c | 1 + oRTP | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/logging.c b/gtk/logging.c index 15bef85e0..26027251f 100644 --- a/gtk/logging.c +++ b/gtk/logging.c @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #endif +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" extern gchar *linphone_logfile; diff --git a/oRTP b/oRTP index 9f51aa254..1172caa98 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 9f51aa254fc5c24834614612036485406a8d06a7 +Subproject commit 1172caa98c7fc70d98bf6e508699a9bead5e9592 From e2b864ace969ba2052b4ecf792eaf0bdccce347a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 12 Apr 2013 10:26:57 +0200 Subject: [PATCH 02/13] Set UTC time in received chat messages. --- coreapi/sal_eXosip2.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 1bbbe36e6..75ee46298 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -1771,6 +1771,26 @@ static bool_t comes_from_local_if(osip_message_t *msg){ 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 int utc_offset() { + time_t ref = 24 * 60 * 60L; + struct tm * timeptr; + int gmtime_hours; + + /* get the local reference time for Jan 2, 1900 00:00 UTC */ + timeptr = localtime(&ref); + gmtime_hours = timeptr->tm_hour; + + /* if the local time is the "day before" the UTC, subtract 24 hours + from the hours to get the UTC offset */ + if (timeptr->tm_mday < 2) gmtime_hours -= 24; + + return gmtime_hours; +} + +time_t mktime_utc(struct tm *timeptr) { + return mktime(timeptr) + utc_offset() * 3600; +} + static void text_received(Sal *sal, eXosip_event_t *ev){ osip_body_t *body=NULL; char *from=NULL,*msg=NULL; @@ -1842,7 +1862,7 @@ static void text_received(Sal *sal, eXosip_event_t *ev){ salmsg.text=msg; salmsg.url=external_body_size>0 ? unquoted_external_body_url : NULL; salmsg.message_id=message_id; - salmsg.time=date!=NULL ? mktime(&ret) : time(NULL); + salmsg.time=date!=NULL ? mktime_utc(&ret) : time(NULL); sal->callbacks.text_received(op,&salmsg); sal_op_release(op); osip_free(from); From f8f00c09e333a0e80e80d4cc49d14388d4d03667 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 16 Apr 2013 13:00:34 +0200 Subject: [PATCH 03/13] fix memory leak in gtk fix indentation (had spaces instead of tabs) update ms2 --- gtk/chat.c | 90 +++++++++++++++++++++++++------------------------- mediastreamer2 | 2 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/gtk/chat.c b/gtk/chat.c index 4fa1c917c..58f1a23ce 100644 --- a/gtk/chat.c +++ b/gtk/chat.c @@ -148,12 +148,13 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from, gtk_text_buffer_insert_with_tags_by_name(buffer,&iter," : ",-1,"bold",me ? "bg":NULL,NULL); gtk_text_buffer_get_end_iter(buffer,&iter); gtk_text_buffer_insert(buffer,&iter,"\n",-1); + ms_free(from_message); g_object_set_data(G_OBJECT(w),"from_message",from_str); } - gtk_text_buffer_get_end_iter(buffer,&iter); + gtk_text_buffer_get_end_iter(buffer,&iter); gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,linphone_chat_message_get_text(msg),-1,"margin",me ? "bg":NULL,NULL); - gtk_text_buffer_get_end_iter(buffer,&iter); - gtk_text_buffer_insert(buffer,&iter,"\n",-1);; + gtk_text_buffer_get_end_iter(buffer,&iter); + gtk_text_buffer_insert(buffer,&iter,"\n",-1); gtk_text_buffer_get_end_iter(buffer,&iter); t=linphone_chat_message_get_time(msg); switch (linphone_chat_message_get_state (msg)){ @@ -260,9 +261,9 @@ static void on_chat_state_changed(LinphoneChatMessage *msg, LinphoneChatMessageS } void linphone_gtk_send_text(){ - GtkWidget *main_window=linphone_gtk_get_main_window(); + GtkWidget *main_window=linphone_gtk_get_main_window(); GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list"); - GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview"); + GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview"); GtkWidget *entry=linphone_gtk_get_widget(w,"text_entry"); const gchar *entered; LinphoneChatRoom *cr=g_object_get_data(G_OBJECT(w),"cr"); @@ -271,7 +272,7 @@ void linphone_gtk_send_text(){ LinphoneChatMessage *msg; msg=linphone_chat_room_create_message(cr,entered); linphone_chat_room_send_message2(cr,msg,on_chat_state_changed,NULL); - linphone_gtk_push_text(w,linphone_gtk_get_used_identity(), + linphone_gtk_push_text(w,linphone_chat_message_get_from(msg), TRUE,cr,msg,FALSE); gtk_entry_set_text(GTK_ENTRY(entry),""); } @@ -438,58 +439,57 @@ void linphone_gtk_chat_close(GtkWidget *button){ } -void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, - LinphoneChatMessage *msg){ +void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room, + LinphoneChatMessage *msg ) { GtkWidget *main_window=linphone_gtk_get_main_window(); - GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list"); - GtkWidget *w; + GtkWidget *friendlist=linphone_gtk_get_widget ( main_window,"contact_list" ); + GtkWidget *w; gboolean send=TRUE; - GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch"); - char *from=linphone_address_as_string(linphone_chat_message_get_from(msg)); - - w=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview"); - if(w!=NULL){ - char *from_chatview=(char *)g_object_get_data(G_OBJECT(friendlist),"from"); - if(g_strcmp0(from,from_chatview)==0){ + GtkNotebook *notebook= ( GtkNotebook * ) linphone_gtk_get_widget ( main_window,"viewswitch" ); + char *from=linphone_address_as_string ( linphone_chat_message_get_from ( msg ) ); + + w= ( GtkWidget* ) g_object_get_data ( G_OBJECT ( friendlist ),"chatview" ); + if ( w!=NULL ) { + char *from_chatview= ( char * ) g_object_get_data ( G_OBJECT ( friendlist ),"from" ); + if ( g_strcmp0 ( from,from_chatview ) ==0 ) { send=TRUE; } else { - if(!linphone_gtk_friend_list_is_contact(linphone_chat_message_get_from(msg))){ - linphone_gtk_chat_add_contact(linphone_chat_message_get_from(msg)); - } + if ( !linphone_gtk_friend_list_is_contact ( linphone_chat_message_get_from ( msg ) ) ) { + linphone_gtk_chat_add_contact ( linphone_chat_message_get_from ( msg ) ); + } send=FALSE; - } - } else { + } + } else { send=FALSE; - if(!linphone_gtk_friend_list_is_contact(linphone_chat_message_get_from(msg))){ - linphone_gtk_chat_add_contact(linphone_chat_message_get_from(msg)); - } - w=linphone_gtk_init_chatroom(room,linphone_chat_message_get_from(msg)); - g_object_set_data(G_OBJECT(friendlist),"chatview",(gpointer)w); - g_object_set_data(G_OBJECT(friendlist),"from",from); - } - get_display_name(linphone_chat_message_get_from(msg)); - - #ifdef HAVE_GTK_OSXs + if ( !linphone_gtk_friend_list_is_contact ( linphone_chat_message_get_from ( msg ) ) ) { + linphone_gtk_chat_add_contact ( linphone_chat_message_get_from ( msg ) ); + } + w=linphone_gtk_init_chatroom ( room,linphone_chat_message_get_from ( msg ) ); + g_object_set_data ( G_OBJECT ( friendlist ),"chatview", ( gpointer ) w ); + g_object_set_data ( G_OBJECT ( friendlist ),"from",from ); + } + +#ifdef HAVE_GTK_OSXs /* Notified when a new message is sent */ - linphone_gtk_status_icon_set_blinking(TRUE); - #else - if(!gtk_window_is_active(GTK_WINDOW(main_window))){ - if(!GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"is_notified"))){ - linphone_gtk_notify(NULL,linphone_chat_message_get_text(msg)); - g_object_set_data(G_OBJECT(w),"is_notified",GINT_TO_POINTER(TRUE)); + linphone_gtk_status_icon_set_blinking ( TRUE ); +#else + if ( !gtk_window_is_active ( GTK_WINDOW ( main_window ) ) ) { + if ( !GPOINTER_TO_INT ( g_object_get_data ( G_OBJECT ( w ),"is_notified" ) ) ) { + linphone_gtk_notify ( NULL,linphone_chat_message_get_text ( msg ) ); + g_object_set_data ( G_OBJECT ( w ),"is_notified",GINT_TO_POINTER ( TRUE ) ); } else { - g_object_set_data(G_OBJECT(w),"is_notified",GINT_TO_POINTER(FALSE)); + g_object_set_data ( G_OBJECT ( w ),"is_notified",GINT_TO_POINTER ( FALSE ) ); } } - #endif - if(send){ - if(gtk_notebook_get_current_page(notebook)!=gtk_notebook_page_num(notebook,w)){ +#endif + if ( send ) { + if ( gtk_notebook_get_current_page ( notebook ) !=gtk_notebook_page_num ( notebook,w ) ) { linphone_gtk_show_friends(); } else { - linphone_chat_room_mark_as_read(room); + linphone_chat_room_mark_as_read ( room ); } - linphone_gtk_push_text(w,linphone_chat_message_get_from(msg), - FALSE,room,msg,FALSE); + linphone_gtk_push_text ( w,linphone_chat_message_get_from ( msg ), + FALSE,room,msg,FALSE ); } else { linphone_gtk_show_friends(); } diff --git a/mediastreamer2 b/mediastreamer2 index 4f93003c1..25b0496db 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 4f93003c1eade1442fdedd8dee10f18c98ec47c3 +Subproject commit 25b0496dbc62183f195528481fe44c73e0d201e9 From 1f9b0812a080b91ff4d1e2dc67b612996370e23d Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 17 Apr 2013 15:49:34 +0200 Subject: [PATCH 04/13] fix publish request, whose request uri must identify the resources for which the event is to be published. --- coreapi/sal_eXosip2.c | 8 ++++---- coreapi/sal_eXosip2.h | 2 ++ coreapi/sal_eXosip2_presence.c | 11 +++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 75ee46298..e577b6422 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -2317,7 +2317,7 @@ static void register_set_contact(osip_message_t *msg, const char *contact){ osip_uri_uparam_add(ct->url,osip_strdup("line"),line); } -static void sal_register_add_route(osip_message_t *msg, const char *proxy){ +void sal_message_add_route(osip_message_t *msg, const char *proxy){ osip_route_t *route; osip_list_special_free(&msg->routes,(void (*)(void*))osip_route_free); @@ -2364,7 +2364,7 @@ int sal_register(SalOp *h, const char *proxy, const char *from, int expires){ h->rid=eXosip_register_build_initial_register(from,domain,NULL,expires,&msg); if (msg){ if (contact) register_set_contact(msg,contact); - sal_register_add_route(msg,proxy); + sal_message_add_route(msg,proxy); sal_add_register(h->base.root,h); }else{ ms_error("Could not build initial register."); @@ -2374,7 +2374,7 @@ int sal_register(SalOp *h, const char *proxy, const char *from, int expires){ }else{ eXosip_lock(); eXosip_register_build_register(h->rid,expires,&msg); - sal_register_add_route(msg,proxy); + sal_message_add_route(msg,proxy); } if (msg){ eXosip_register_send_register(h->rid,msg); @@ -2412,7 +2412,7 @@ int sal_register_refresh(SalOp *op, int expires){ eXosip_register_build_register(op->rid,expires,&msg); if (msg!=NULL){ if (contact) register_set_contact(msg,contact); - sal_register_add_route(msg,sal_op_get_route(op)); + sal_message_add_route(msg,sal_op_get_route(op)); eXosip_register_send_register(op->rid,msg); }else ms_error("Could not build REGISTER refresh message."); eXosip_unlock(); diff --git a/coreapi/sal_eXosip2.h b/coreapi/sal_eXosip2.h index 68a2d05ef..e00dd64d9 100644 --- a/coreapi/sal_eXosip2.h +++ b/coreapi/sal_eXosip2.h @@ -99,4 +99,6 @@ SalCustomHeader * sal_exosip_get_custom_headers(osip_message_t *msg); void _osip_list_set_empty(osip_list_t *l, void (*freefunc)(void*)); +void sal_message_add_route(osip_message_t *msg, const char *proxy); + #endif diff --git a/coreapi/sal_eXosip2_presence.c b/coreapi/sal_eXosip2_presence.c index 1b64fe429..c81910986 100644 --- a/coreapi/sal_eXosip2_presence.c +++ b/coreapi/sal_eXosip2_presence.c @@ -637,23 +637,26 @@ int sal_publish(SalOp *op, const char *from, const char *to, SalPresenceStatus p osip_message_t *pub; int i; char buf[1024]; + const char *route=sal_op_get_route(op); mk_presence_body (presence_mode, from, buf, sizeof (buf), presence_style); - i = eXosip_build_publish(&pub,from, to, sal_op_get_route(op), "presence", "300", + i = eXosip_build_publish(&pub,to, from, NULL, "presence", "600", presence_style ? "application/xpidf+xml" : "application/pidf+xml", buf); if (i<0){ ms_warning("Failed to build publish request."); return -1; } - + if (route) + sal_message_add_route(pub,route); + eXosip_lock(); i = eXosip_publish(pub, to); /* should update the sip-if-match parameter from sip-etag from last 200ok of PUBLISH */ eXosip_unlock(); if (i<0){ - ms_message("Failed to send publish request."); - return -1; + ms_message("Failed to send publish request."); + return -1; } sal_add_other(sal_op_get_sal(op),op,pub); return 0; From 3a3a5e478da4e6af7bed67b0e7a1b200079ca775 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 19 Apr 2013 15:39:40 +0200 Subject: [PATCH 05/13] wrap DSCP API for java --- coreapi/linphonecore_jni.cc | 24 +++++++++++ .../org/linphone/core/LinphoneCore.java | 40 +++++++++++++++++++ .../org/linphone/core/LinphoneCoreImpl.java | 35 ++++++++++++++++ 3 files changed, 99 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 5046d83bb..b721c6892 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -2143,6 +2143,14 @@ extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getDuration(JNIEnv* env return (jint)linphone_call_get_duration((LinphoneCall *) ptr); } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSipDscp(JNIEnv* env,jobject thiz,jlong ptr, jint dscp){ + linphone_core_set_sip_dscp((LinphoneCore*)ptr,dscp); +} + +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSipDscp(JNIEnv* env,jobject thiz,jlong ptr){ + return linphone_core_get_sip_dscp((LinphoneCore*)ptr); +} + extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSignalingTransportPort(JNIEnv* env,jobject thiz,jlong ptr, jint code) { LCSipTransports tr; linphone_core_get_sip_transports((LinphoneCore *) ptr, &tr); @@ -2447,6 +2455,22 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPortRange(JNIEnv linphone_core_set_video_port_range((LinphoneCore *)lc, min_port, max_port); } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioDscp(JNIEnv* env,jobject thiz,jlong ptr, jint dscp){ + linphone_core_set_audio_dscp((LinphoneCore*)ptr,dscp); +} + +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getAudioDscp(JNIEnv* env,jobject thiz,jlong ptr){ + return linphone_core_get_audio_dscp((LinphoneCore*)ptr); +} + +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoDscp(JNIEnv* env,jobject thiz,jlong ptr, jint dscp){ + linphone_core_set_video_dscp((LinphoneCore*)ptr,dscp); +} + +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getVideoDscp(JNIEnv* env,jobject thiz,jlong ptr){ + return linphone_core_get_video_dscp((LinphoneCore*)ptr); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setIncomingTimeout(JNIEnv *env, jobject thiz, jlong lc, jint timeout) { linphone_core_set_inc_timeout((LinphoneCore *)lc, timeout); } diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 144b7dfe2..d76acad9a 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -637,6 +637,20 @@ public interface LinphoneCore { * @return transports used for signaling (TCP, UDP, TLS) */ Transports getSignalingTransportPorts(); + + /** + * Assign a dscp value for the SIP socket. + * DSCP is an IP packet field used to indicate the type of routing service to routers. + * @param dscp + */ + void setSipDscp(int dscp); + + /** + * Get DSCP used for SIP socket. + * @return the DSCP value used for the SIP socket. + */ + int getSipDscp(); + /** * Activates or deactivates the speaker. * @param value @@ -1146,6 +1160,19 @@ public interface LinphoneCore { */ void setAudioPortRange(int minPort, int maxPort); + /** + * Assign a DSCP value to the audio RTP sockets. + * @param dscp the DSCP value. + * DSCP is an IP header field used to indicate a type of service to routers. + */ + void setAudioDscp(int dscp); + + /** + * Return DSCP value used for the audio RTP sockets. + * @return the DSCP value used for the audio RTP sockets. + */ + int getAudioDscp(); + /** * Sets the UDP port used for video streaming. **/ @@ -1156,6 +1183,19 @@ public interface LinphoneCore { */ void setVideoPortRange(int minPort, int maxPort); + /** + * Assign a DSCP value to the video RTP sockets. + * @param dscp the DSCP value. + * DSCP is an IP header field used to indicate a type of service to routers. + */ + void setVideoDscp(int dscp); + + /** + * Return DSCP value used for the video RTP sockets. + * @return the DSCP value used for the video RTP sockets. + */ + int getVideoDscp(); + /** * Set the incoming call timeout in seconds. * If an incoming call isn't answered for this timeout period, it is diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 0b4c984d6..f9a7abf39 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -913,4 +913,39 @@ class LinphoneCoreImpl implements LinphoneCore { public PayloadType findPayloadType(String mime) { return findPayloadType(mime, FIND_PAYLOAD_IGNORE_RATE); } + + private native void setSipDscp(long nativePtr, int dscp); + @Override + public void setSipDscp(int dscp) { + setSipDscp(nativePtr,dscp); + } + + private native int getSipDscp(long nativePtr); + @Override + public int getSipDscp() { + return getSipDscp(nativePtr); + } + private native void setAudioDscp(long nativePtr, int dscp); + @Override + public void setAudioDscp(int dscp) { + setAudioDscp(nativePtr, dscp); + } + + private native int getAudioDscp(long nativePtr); + @Override + public int getAudioDscp() { + return getAudioDscp(nativePtr); + } + + private native void setVideoDscp(long nativePtr, int dscp); + @Override + public void setVideoDscp(int dscp) { + setVideoDscp(nativePtr,dscp); + } + + private native int getVideoDscp(long nativePtr); + @Override + public int getVideoDscp() { + return getVideoDscp(nativePtr); + } } From f0ac752704d01f1f3d2edf359c888aa7bb2d333b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 19 Apr 2013 15:43:51 +0200 Subject: [PATCH 06/13] fix crash in gtk chat --- gtk/chat.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/gtk/chat.c b/gtk/chat.c index 58f1a23ce..b1da70822 100644 --- a/gtk/chat.c +++ b/gtk/chat.c @@ -61,12 +61,17 @@ void linphone_gtk_quit_chatroom(LinphoneChatRoom *cr) { GtkWidget *nb=linphone_gtk_get_widget(main_window,"viewswitch"); GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list"); GtkWidget *w=g_object_get_data(G_OBJECT(friendlist),"chatview"); + gchar *from; g_return_if_fail(w!=NULL); gtk_notebook_remove_page(GTK_NOTEBOOK(nb),gtk_notebook_page_num(GTK_NOTEBOOK(nb),w)); linphone_gtk_friend_list_update_chat_picture(); g_object_set_data(G_OBJECT(friendlist),"chatview",NULL); - g_object_set_data(G_OBJECT(w),"from_message",NULL); + from=g_object_get_data(G_OBJECT(w),"from_message"); + if (from){ + g_object_set_data(G_OBJECT(w),"from_message",NULL); + g_free(from); + } g_object_set_data(G_OBJECT(w),"cr",NULL); g_object_set_data(G_OBJECT(friendlist),"from",NULL); gtk_widget_destroy(w); @@ -128,7 +133,7 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from, GtkTextIter iter,begin; int off; char *from_str=linphone_address_as_string_uri_only(from); - char *from_message=(char *)g_object_get_data(G_OBJECT(w),"from_message"); + gchar *from_message=(gchar *)g_object_get_data(G_OBJECT(w),"from_message"); GList *list=g_object_get_data(G_OBJECT(w),"list"); time_t t; char buf[80]; @@ -148,8 +153,8 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from, gtk_text_buffer_insert_with_tags_by_name(buffer,&iter," : ",-1,"bold",me ? "bg":NULL,NULL); gtk_text_buffer_get_end_iter(buffer,&iter); gtk_text_buffer_insert(buffer,&iter,"\n",-1); - ms_free(from_message); - g_object_set_data(G_OBJECT(w),"from_message",from_str); + g_free(from_message); + g_object_set_data(G_OBJECT(w),"from_message",g_strdup(from_str)); } gtk_text_buffer_get_end_iter(buffer,&iter); gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,linphone_chat_message_get_text(msg),-1,"margin",me ? "bg":NULL,NULL); @@ -193,6 +198,7 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from, gtk_text_buffer_insert(buffer,&iter,"\n",-1); GtkTextMark *mark=gtk_text_buffer_create_mark(buffer,NULL,&iter,FALSE); gtk_text_view_scroll_mark_onscreen(text,mark); + ms_free(from_str); } const LinphoneAddress* linphone_gtk_get_used_identity(){ @@ -292,6 +298,7 @@ void display_history_message(GtkWidget *chat_view,MSList *messages,const Linphon MSList *it; char *from_str; char *with_str; + gchar *tmp; for(it=messages;it!=NULL;it=it->next){ LinphoneChatMessage *msg=(LinphoneChatMessage *)it->data; from_str=linphone_address_as_string_uri_only(linphone_chat_message_get_from(msg)); @@ -301,7 +308,11 @@ void display_history_message(GtkWidget *chat_view,MSList *messages,const Linphon strcmp(from_str,with_str)==0? FALSE : TRUE, linphone_chat_message_get_chat_room(msg),msg,TRUE); } - g_object_set_data(G_OBJECT(chat_view),"from_message",NULL); + tmp=g_object_get_data(G_OBJECT(chat_view),"from_message"); + if (tmp){ + g_object_set_data(G_OBJECT(chat_view),"from_message",NULL); + g_free(tmp); + } ms_free(from_str); ms_free(with_str); linphone_gtk_free_list(messages); @@ -420,7 +431,7 @@ void linphone_gtk_load_chatroom(LinphoneChatRoom *cr,const LinphoneAddress *uri, g_object_set_data(G_OBJECT(chat_view),"cr",cr); g_object_set_data(G_OBJECT(linphone_gtk_get_widget(main_window,"contact_list")),"chatview",(gpointer)chat_view); messages=linphone_chat_room_get_history(cr,NB_MSG_HIST); - g_object_set_data(G_OBJECT(chat_view),"from_message",uri_str); + g_object_set_data(G_OBJECT(chat_view),"from_message",g_strdup(uri_str)); display_history_message(chat_view,messages,uri); } ms_free(from_str); From 94c6883b8bbb68483db86b248290a97246ed9be7 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 19 Apr 2013 16:52:40 +0200 Subject: [PATCH 07/13] update ms2 for ringstream bugfix --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 25b0496db..9fa2247c2 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 25b0496dbc62183f195528481fe44c73e0d201e9 +Subproject commit 9fa2247c2446d4b06f4a60b72eee65dc591764da From ae4ad91a00b19b9335d90756a4f3a3c4d900618e Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sat, 20 Apr 2013 08:59:24 +0200 Subject: [PATCH 08/13] update ms2 (repair build) --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 9fa2247c2..2720ab1d1 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 9fa2247c2446d4b06f4a60b72eee65dc591764da +Subproject commit 2720ab1d1568ced6f0bf63e454a35f340d8ace64 From cc671644bea7dd3426316636ab6ce24526683374 Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Sun, 21 Apr 2013 22:06:07 +0200 Subject: [PATCH 09/13] Add aac-eld paylaod type to linphone core. - add two configurations with their respective fmtp config string --- coreapi/linphonecore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index edf11a407..e967b5737 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1291,6 +1291,8 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta linphone_core_assign_payload_type(lc,&payload_type_silk_wb,-1,NULL); linphone_core_assign_payload_type(lc,&payload_type_silk_swb,-1,NULL); linphone_core_assign_payload_type(lc,&payload_type_g729,18,"annexb=no"); + linphone_core_assign_payload_type(lc,&payload_type_aaceld_nb,-1,"config=F8EE2000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=24; sizeLength=13; streamType=5"); + linphone_core_assign_payload_type(lc,&payload_type_aaceld_wb,-1,"config=F8E82000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=24; sizeLength=13; streamType=5"); linphone_core_handle_static_payloads(lc); ms_init(); From bb255673e346364e5c255e12b4b3ea7abe6bfe12 Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Mon, 22 Apr 2013 11:04:48 +0200 Subject: [PATCH 10/13] Rename aac-eld modes to 22k and 44k --- coreapi/linphonecore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index e967b5737..24515d33d 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1291,8 +1291,8 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta linphone_core_assign_payload_type(lc,&payload_type_silk_wb,-1,NULL); linphone_core_assign_payload_type(lc,&payload_type_silk_swb,-1,NULL); linphone_core_assign_payload_type(lc,&payload_type_g729,18,"annexb=no"); - linphone_core_assign_payload_type(lc,&payload_type_aaceld_nb,-1,"config=F8EE2000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=24; sizeLength=13; streamType=5"); - linphone_core_assign_payload_type(lc,&payload_type_aaceld_wb,-1,"config=F8E82000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=24; sizeLength=13; streamType=5"); + linphone_core_assign_payload_type(lc,&payload_type_aaceld_22k,-1,"config=F8EE2000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=24; sizeLength=13; streamType=5"); + linphone_core_assign_payload_type(lc,&payload_type_aaceld_44k,-1,"config=F8E82000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=24; sizeLength=13; streamType=5"); linphone_core_handle_static_payloads(lc); ms_init(); From d14f627659e74da40dbd8f7fc2f07ce09b7e7b5d Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Mon, 22 Apr 2013 11:11:25 +0200 Subject: [PATCH 11/13] Add oRTP with aac-eld payload changes --- oRTP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oRTP b/oRTP index 1172caa98..26ee84a1e 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 1172caa98c7fc70d98bf6e508699a9bead5e9592 +Subproject commit 26ee84a1e3053b7b4426033ddc273cc60bf43902 From d09307827cb9cc19153bb7b44016d07fd39c4ac1 Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Mon, 22 Apr 2013 11:26:57 +0200 Subject: [PATCH 12/13] Typo in oRTP aac-eld payload type name --- oRTP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oRTP b/oRTP index 26ee84a1e..bd64df514 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 26ee84a1e3053b7b4426033ddc273cc60bf43902 +Subproject commit bd64df5148bdfd4a2ff5153927676fc497118279 From 93c48ae1686d54a65f502c3f73fde11e497941df Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 22 Apr 2013 12:57:44 +0200 Subject: [PATCH 13/13] Save DTMFs settings immediately. --- coreapi/linphonecore.c | 20 ++++++++------------ coreapi/private.h | 2 -- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 24515d33d..a17543d22 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -598,9 +598,6 @@ static void sip_config_read(LinphoneCore *lc) int ipv6; int random_port; - tmp=lp_config_get_int(lc->config,"sip","use_info",0); - linphone_core_set_use_info_for_dtmf(lc,tmp); - if (lp_config_get_int(lc->config,"sip","use_session_timers",0)==1){ sal_use_session_timers(lc->sal,200); } @@ -610,9 +607,6 @@ static void sip_config_read(LinphoneCore *lc) sal_reuse_authorization(lc->sal, lp_config_get_int(lc->config,"sip","reuse_authorization",0)); sal_expire_old_registration_contacts(lc->sal,lp_config_get_int(lc->config,"sip","expire_old_registration_contacts",0)); - tmp=lp_config_get_int(lc->config,"sip","use_rfc2833",1); - linphone_core_set_use_rfc2833_for_dtmf(lc,tmp); - ipv6=lp_config_get_int(lc->config,"sip","use_ipv6",-1); if (ipv6==-1){ ipv6=0; @@ -1725,7 +1719,7 @@ void linphone_core_set_nortp_timeout(LinphoneCore *lc, int nortp_timeout){ **/ bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc) { - return lc->sip_conf.use_info; + return lp_config_get_int(lc->config, "sip", "use_info", 0); } /** @@ -1735,7 +1729,9 @@ bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc) **/ void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc,bool_t use_info) { - lc->sip_conf.use_info=use_info; + if (linphone_core_ready()) { + lp_config_set_int(lc->config, "sip", "use_info", use_info); + } } /** @@ -1745,7 +1741,7 @@ void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc,bool_t use_info) **/ bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc) { - return lc->sip_conf.use_rfc2833; + return lp_config_get_int(lc->config, "sip", "use_rfc2833", 1); } /** @@ -1755,7 +1751,9 @@ bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc) **/ void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,bool_t use_rfc2833) { - lc->sip_conf.use_rfc2833=use_rfc2833; + if (linphone_core_ready()) { + lp_config_set_int(lc->config, "sip", "use_rfc2833", use_rfc2833); + } } /** @@ -5128,8 +5126,6 @@ void sip_config_uninit(LinphoneCore *lc) lp_config_set_int(lc->config,"sip","inc_timeout",config->inc_timeout); lp_config_set_int(lc->config,"sip","in_call_timeout",config->in_call_timeout); lp_config_set_int(lc->config,"sip","delayed_timeout",config->delayed_timeout); - lp_config_set_int(lc->config,"sip","use_info",config->use_info); - lp_config_set_int(lc->config,"sip","use_rfc2833",config->use_rfc2833); lp_config_set_int(lc->config,"sip","use_ipv6",config->ipv6_enabled); lp_config_set_int(lc->config,"sip","register_only_when_network_is_up",config->register_only_when_network_is_up); lp_config_set_int(lc->config,"sip","register_only_when_upnp_is_ok",config->register_only_when_upnp_is_ok); diff --git a/coreapi/private.h b/coreapi/private.h index 5e265c616..d80607ca9 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -438,8 +438,6 @@ typedef struct sip_config int delayed_timeout; /*timeout after a delayed call is resumed */ unsigned int keepalive_period; /* interval in ms between keep alive messages sent to the proxy server*/ LCSipTransports transports; - bool_t use_info; - bool_t use_rfc2833; /*force RFC2833 to be sent*/ bool_t guess_hostname; bool_t loopback_only; bool_t ipv6_enabled;