]> sjero.net Git - linphone/commitdiff
Merge branch 'master' of git.savannah.nongnu.org:/srv/git/linphone
authorGuillaume Beraudo <guillaume.beraudo@linphone.org>
Wed, 30 Mar 2011 07:32:15 +0000 (09:32 +0200)
committerGuillaume Beraudo <guillaume.beraudo@linphone.org>
Wed, 30 Mar 2011 07:32:15 +0000 (09:32 +0200)
18 files changed:
Makefile.am
NEWS
README.macos
build/macos/Makefile.am
build/macos/environment.sh
build/macos/linphone.bundle
configure.ac
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/misc.c
coreapi/sal_eXosip2.c
coreapi/sal_eXosip2.h
gtk/Makefile.am
gtk/gtkrc.mac [new file with mode: 0644]
gtk/main.c
mediastreamer2
oRTP

index cef6503c605304e48cd9ecfb14c3d05301413148..3d533352fb7a31ca4841bad4f788c93c69d70f70 100644 (file)
@@ -59,7 +59,7 @@ ISS_SCRIPT_PATH=$(shell cd $(top_srcdir) && pwd)/$(ISS_SCRIPT)
 #path to Inno Setup 5 compiler
 ISCC=ISCC.exe
 PACKAGE_WIN32_FILELIST=$(PACKAGE)-win32.filelist
-PACKAGE_BUNDLE_FILE=$(top_srcdir)/build/macos/reltime.bundle
+PACKAGE_BUNDLE_FILE=$(top_srcdir)/build/macos/$(PACKAGE).bundle
 
 EXTRA_DIST = config.rpath  BUGS linphone.kdevelop  \
                                intltool-extract.in     \
@@ -194,6 +194,7 @@ bundle:
        LINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
        LIBLINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
        ige-mac-bundler $(PACKAGE_BUNDLE_FILE)
+       cd $$HOME/Desktop && zip -r Linphone-$(VERSION).app.zip Linphone.app
 
 
 
diff --git a/NEWS b/NEWS
index 687b27f980fa4e771d0622b96cc19bc76ce42d41..4d5bcf7c5ab7bdd7a648e0de2fb2b88552b0044b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,12 @@
+linphone-3.4.3 -- March 28, 2011
+       * Fully ported to mac os x with gtk-osx (menu integration, bundle generation with "make bundle", sound I/O improved) but still audio only
+       * Fix stupid warning "no response" that sometimes arrived at end of calls
+       * limit the size of the log window (to prevent memory drain)
+       * limit the size of the SDP message by removing unnecessary information (for well known codecs, for H264).
+         This is to prevent SIP messages from being discarded by routers on the internet when they exceeds in size the internet MTU.
+       * other sip bugfixes
+       Requires mediastreamer-2.7.3
+
 linphone-3.4.2 -- March 3rd, 2011
        * fix problems with webcams on windows
        Requires mediastreamer-2.7.2
index 251b622751bf559b67dd8275cb6251a7079d0e34..ed5fdd41d8bb7f2a57975dd3c4a5c55eea0ab449 100644 (file)
@@ -1,4 +1,52 @@
-Compiling linphone on macos X
+**********************************
+* Compiling linphone on macos X  *
+**********************************
+
+
+You have two options: using gtk-osx framework (http://gtk-osx.sourceforge.net/) which results in a Linphone GTK well integrated into Mac OS
+environment. The other option is using MacPort, in which case Linphone will run as an X11 application inside Mac OS.
+
+At the date of March 25, 2011, no video support is available yet.
+
+
+Compiling using gtk-osx
+=======================
+
+Requirements:
+* gtk-osx framework
+* xcode (for gcc)
+* macport (to retrieve dependencies easily, such as libosip2, libeXosip2, libspeex
+* linphone git tree
+
+Steps:
+
+- Install gtk-osx jhbuild environment as described at
+http://sourceforge.net/apps/trac/gtk-osx/wiki/Build
+It will build gtk for osx as well as many dependencies.
+
+- Install ige-mac-bundler following instructions here (git clone method is preferred):
+http://sourceforge.net/apps/trac/gtk-osx/wiki/Bundle
+
+- Install some linphone dependencies with macports
+ $ port install speex-dev
+ $ port install osip2
+ $ port install eXosip2
+
+- Now you can compile linphone
+
+$ jhbuild shell
+$ PKG_CONFIG_PATH=$HOME/gtk/inst/lib/pkgconfig:/opt/local/lib/pkgconfig/ ./configure --disable-video --disable-strict --with-gsm=/opt/local
+#assuming you have gsm installed in /opt/local. However gsm is optional.
+$ make
+
+- You can generate a bundle using
+$ make bundle
+
+The bundle is generated in ~/Desktop/Linphone and can safely be exported to other places and computers.
+
+
+Compiling using MacPort
+=======================
 
 This procedure works for audio, video still not fully supported.
 It was tested on macos X (leopard) on september 2009.
@@ -16,7 +64,6 @@ Steps:
        - gettext
        - intltool
        - gtk2
-       - libglade2
        - speex-dev
        - osip2
        - eXosip2
@@ -30,14 +77,6 @@ Steps:
 * install to /opt/local
        sudo make install 
 
-*********************
-Using gtk-osx (jhbuild environnment)
-
-After installing jhbuild and get gtk built,
-
-$ jhbuild shell
-
-$ PKG_CONFIG_PATH=$HOME/gtk/inst/lib/pkgconfig:/opt/local/lib/pkgconfig/ ./configure --disable-video --disable-strict
 
 
 
index 5e2f376d59a3abb09792f63ceddf8c1c66448676..e90eb2ffef3fb0758cc6e3e4bce3559c01e299b3 100644 (file)
@@ -1,3 +1,3 @@
-EXTRA_DIST=linphone.bundle.in environment.sh
+EXTRA_DIST=linphone.bundle environment.sh Info-linphone.plist.in
 
 
index f331e77a13ba939881c8697bf94616101691899d..69191845b580aa380279096ba0be3fff93bc1523 100644 (file)
@@ -1,3 +1,3 @@
 export EXTRA_ARGS="--workdir $bundle_res"
-unset GDK_PIXBUF_MODULE_FILE
+
 
index 2b1e1f7ffc2f5ae527ed3dc349cfd0a11c6abf29..b38d550aca22e5f64a514418b69447aa9dd6edb0 100644 (file)
@@ -80,7 +80,7 @@
   </binary>
 
   <binary>
-     ${prefix}/lib/gdk-pixbuf-2.0/*
+     ${prefix}/lib/gdk-pixbuf-2.0
   </binary>
 
   <!-- Copy in GTK+ theme engines. Note the use of the
        "dest" property. The destination must then start with the macro
        "${bundle}", which refers to the bundle root directory.
   -->
-  <data dest="${bundle}/Contents/Resources/share/linphone">
-    ${prefix:linphone}/share/*
+  <data>
+    ${prefix:linphone}/share
   </data>
 
   <!-- Copy in the themes data. You may want to trim this to save space
        theme of choice if they provide and example, or you can just
        change the source path. -->
 
-  <!--data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
-    ${project}/src/gtkrc
-  </data-->
+  <data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
+    ${project}/../../gtk/gtkrc.mac
+  </data>
 
   <data dest="${bundle}/Contents/Resources/share/sounds/linphone">
       ${prefix:linphone}/share/sounds/linphone/
index 66e65a12faee6f170a60b6d53454083e7763e5f1..fbb99d2821ee1459221dad9153433df5015dfb42 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT([linphone],[3.4.2],[linphone-developers@nongnu.org])
+AC_INIT([linphone],[3.4.3],[linphone-developers@nongnu.org])
 AC_CANONICAL_SYSTEM
 AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
 
@@ -61,6 +61,7 @@ case $target_os in
        *darwin*)
                dnl use macport installation
                ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
+               build_macos=yes
        ;;
 esac
 
@@ -129,11 +130,12 @@ AC_ARG_ENABLE(gtk_ui,
         *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk_ui) ;;
       esac],[gtk_ui=true])
 
-
 if test "$gtk_ui" = "true" ; then
        PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0)
-       AC_SUBST(LIBGTK_CFLAGS)
-       AC_SUBST(LIBGTK_LIBS)
+       if test "$enable_x11" = "false" ; then
+               PKG_CHECK_MODULES(LIBGTKMAC,[ige-mac-integration >= 0.9.7 ])
+               AC_DEFINE([HAVE_GTK_OSX],[1],[Defined when gtk osx is used])
+       fi
 else
        echo "GTK interface compilation is disabled."
 fi
@@ -159,13 +161,13 @@ AC_ARG_WITH( configdir,
 
 AC_DEFINE_UNQUOTED(LINPHONE_CONFIG_DIR,"$configdir",[Windows appdata subdir where linphonerc can be found])
 
-AC_ARG_ENABLE(manual,
-      [  --disable-manual    Do not attempt to build html linphone's user documentation],
+AC_ARG_ENABLE(relativeprefix,
+      [  --enable-relativeprefix    Build a linphone that finds its resources relatively to the directory where it is installed],
       [case "${enableval}" in
-        yes) build_manual=yes ;;
-        no)  build_manual=false ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-manual) ;;
-      esac],[build_manual=yes])
+        yes) relativeprefix=yes ;;
+        no)  relativeprefix=no ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-relativeprefix) ;;
+      esac],[relativeprefix=auto])
 
 AC_ARG_ENABLE(date,
       [  --enable-date    Use build date in internal version number],
@@ -232,9 +234,22 @@ else
        package_prefix=${prefix}
 fi
 
-if test x$mingw_found = xyes ; then
-dnl allow binaries to install everywhere
-package_prefix="."
+
+
+if test "$relativeprefix" = "auto" ; then
+       case $target_os in
+               *darwin*)
+               relativeprefix=yes
+               ;;
+               *mingw*)
+               relativeprefix=yes
+               ;;
+       esac
+fi
+
+if test "$relativeprefix" = "yes" ; then
+       dnl allow binaries to install everywhere
+       package_prefix="."
 fi
 
 dnl Set PACKAGE_LOCALE_DIR in config.h.
index 03f04da5bc6b06d5d7f685541cb6e0642e83699a..c3264d99bbdb7203ca4b864c701857e55fb39a14 100644 (file)
@@ -1082,3 +1082,33 @@ bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call){
        }
 }
 
+/**
+ * Returns the measured sound volume played locally (received from remote)
+ * It is expressed in dbm0. 
+**/
+float linphone_call_get_play_volume(LinphoneCall *call){
+       AudioStream *st=call->audiostream;
+       if (st && st->volsend){
+               float vol=0;
+               ms_filter_call_method(st->volsend,MS_VOLUME_GET,&vol);
+               return vol;
+               
+       }
+       return LINPHONE_VOLUME_DB_LOWEST;
+}
+
+/**
+ * Returns the measured sound volume recorded locally (sent to remote)
+ * It is expressed in dbm0. 
+**/
+float linphone_call_get_record_volume(LinphoneCall *call){
+       AudioStream *st=call->audiostream;
+       if (st && st->volrecv){
+               float vol=0;
+               ms_filter_call_method(st->volrecv,MS_VOLUME_GET,&vol);
+               return vol;
+               
+       }
+       return LINPHONE_VOLUME_DB_LOWEST;
+}
+
index 6bc2133b7204444f69ffbb7165775a5629f10bb4..43819d5df0d96843b4669ab2ba060f3745b7daf3 100644 (file)
@@ -3591,11 +3591,6 @@ void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms){
                return;
        }
 
-       // Play DTMF only when in call
-       if (!linphone_core_in_call(lc)) {
-               return;
-       }
-
        if (duration_ms>0)
                ms_filter_call_method(f, MS_DTMF_GEN_PLAY, &dtmf);
        else ms_filter_call_method(f, MS_DTMF_GEN_START, &dtmf);
index d0e13ba5023f76823ad24203aa225b65bae71d43..f1c85334166b726d7b111b17a7d2db36967c570b 100644 (file)
@@ -253,6 +253,8 @@ bool_t linphone_call_camera_enabled(const LinphoneCall *lc);
 int linphone_call_take_video_snapshot(LinphoneCall *call, const char *file);
 LinphoneReason linphone_call_get_reason(const LinphoneCall *call);
 const char *linphone_call_get_remote_user_agent(LinphoneCall *call);
+float linphone_call_get_play_volume(LinphoneCall *call);
+float linphone_call_get_record_volume(LinphoneCall *call);
 void *linphone_call_get_user_pointer(LinphoneCall *call);
 void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
 /**
@@ -283,6 +285,10 @@ void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_t val);
  * @ingroup media_parameters
 **/
 bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call);
+
+/*keep this in sync with mediastreamer2/msvolume.h*/
+#define LINPHONE_VOLUME_DB_LOWEST (-120) /**< Lowest measured that can be returned.*/
+
 /**
  * @addtogroup proxies
  * @{
index 799de3aeeac78469301677a84f9e25a7d4543db7..9cce4c480643be8ff645cd8fe837bdf4365439ed 100644 (file)
@@ -763,10 +763,10 @@ void _linphone_core_configure_resolver(){
 /*bionic declares _res but does not define nor export it !!*/
 #ifdef ANDROID
        /*timeout and attempts are the same as retrans and retry, but are android specific names.*/
-       setenv("RES_OPTIONS","timeout:1 attempts:2 retrans:1 retry:2",1);
+       setenv("RES_OPTIONS","timeout:2 attempts:2 retrans:2 retry:2",1);
 #else
        res_init();
-       _res.retrans=1; /*retransmit every second*/
+       _res.retrans=2; /*retransmit every two seconds*/
        _res.retry=2; /*only two times per DNS server*/
 #endif
 }
index 8da6488d3c8597f655757a2dfec9a5a4765c976d..4504dcbeaf3c1a565e2be6bf2f12ecf3232752aa 100644 (file)
@@ -33,9 +33,10 @@ static void text_received(Sal *sal, eXosip_event_t *ev);
 
 void _osip_list_set_empty(osip_list_t *l, void (*freefunc)(void*)){
        void *data;
-       while((data=osip_list_get(l,0))!=NULL){
+       while(!osip_list_eol(l,0)) {
+               data=osip_list_get(l,0);
                osip_list_remove(l,0);
-               freefunc(data);
+               if (data) freefunc(data);
        }
 }
 
@@ -171,6 +172,7 @@ SalOp * sal_op_new(Sal *sal){
        op->masquerade_via=FALSE;
        op->auto_answer_asked=FALSE;
        op->auth_info=NULL;
+       op->terminated=FALSE;
        return op;
 }
 
@@ -781,6 +783,7 @@ int sal_call_terminate(SalOp *h){
        if (err!=0){
                ms_warning("Exosip could not terminate the call: cid=%i did=%i", h->cid,h->did);
        }
+       h->terminated=TRUE;
        return 0;
 }
 
@@ -1007,6 +1010,7 @@ static int call_proceeding(Sal *sal, eXosip_event_t *ev){
                eXosip_lock();
                eXosip_call_terminate(ev->cid,ev->did);
                eXosip_unlock();
+               op->terminated=TRUE;
                return -1;
        }
        if (ev->did>0)
@@ -1083,6 +1087,7 @@ static void call_terminated(Sal *sal, eXosip_event_t *ev){
        }
        sal->callbacks.call_terminated(op,from!=NULL ? from : sal_op_get_from(op));
        if (from) osip_free(from);
+       op->terminated=TRUE;
 }
 
 static void call_released(Sal *sal, eXosip_event_t *ev){
@@ -1091,7 +1096,7 @@ static void call_released(Sal *sal, eXosip_event_t *ev){
                ms_warning("No op associated to this call_released()");
                return;
        }
-       if (ev->response==NULL){
+       if (!op->terminated){
                /* no response received so far */
                call_failure(sal,ev);
        }
@@ -1874,8 +1879,14 @@ int sal_register(SalOp *h, const char *proxy, const char *from, int expires){
        if (h->rid==-1){
                eXosip_lock();
                h->rid=eXosip_register_build_initial_register(from,proxy,NULL,expires,&msg);
-               if (contact) register_set_contact(msg,contact);
-               sal_add_register(h->base.root,h);
+               if (msg){
+                       if (contact) register_set_contact(msg,contact);
+                       sal_add_register(h->base.root,h);
+               }else{
+                       ms_error("Could not build initial register.");
+                       eXosip_unlock();
+                       return -1;
+               }
        }else{
                eXosip_lock();
                eXosip_register_build_register(h->rid,expires,&msg);    
index 4db203362f589ee021ad3da7f76add64e0a8702d..d55263627b126be99d18c0f7993c7ff7994aef21 100644 (file)
@@ -65,6 +65,7 @@ struct SalOp{
        bool_t reinvite;
        bool_t masquerade_via;
        bool_t auto_answer_asked;
+       bool_t terminated;
        const SalAuthInfo *auth_info;
 };
 
index 58f5306596b972c31ac4c72e8dd6f45268d7ba25..c51234eb395418437505e9a7ad35d77c19840d8e 100644 (file)
@@ -21,7 +21,8 @@ EXTRA_DIST=   $(PIXMAPS) \
                linphone.iss \
                $(LINPHONE_ICO_RC_FILE) \
                $(LINPHONE_ICO_FILE)
-
+               gtkrc \
+               gtkrc.mac
 
 if BUILD_GTK_UI
 
@@ -48,7 +49,7 @@ linphone_SOURCES=     \
 linphone_LDADD=$(ORTP_LIBS) \
                $(MEDIASTREAMER_LIBS) \
                $(top_builddir)/coreapi/liblinphone.la \
-                       $(LIBGTK_LIBS) $(INTLLIBS) 
+                       $(LIBGTK_LIBS) $(LIBGTKMAC_LIBS) $(INTLLIBS) 
 
 
 if BUILD_WIN32
@@ -71,8 +72,7 @@ endif
 AM_CFLAGS= -DIN_LINPHONE -I$(top_srcdir)/coreapi/ \
                $(MEDIASTREAMER_CFLAGS) \
                $(ORTP_CFLAGS) \
-               $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(IPV6_CFLAGS) \
-               $(OSIP_CFLAGS) 
+               $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(LIBGTKMAC_CFLAGS) $(IPV6_CFLAGS)
 
 
 version_date.h: $(top_srcdir)/configure.ac
diff --git a/gtk/gtkrc.mac b/gtk/gtkrc.mac
new file mode 100644 (file)
index 0000000..8a39b00
--- /dev/null
@@ -0,0 +1 @@
+include "../../share/themes/Mac4Lin_GTK_Aqua_v1.0/gtk-2.0/gtkrc"
index b35b8f4c49aa5a79148f4cac4e4b9aad62be7b28..df281a7996f18a63c644484eed74efbc8a38f04a 100644 (file)
@@ -17,7 +17,6 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
-//#define USE_LIBGLADE 1
 
 #define VIDEOSELFVIEW_DEFAULT 1
 
@@ -25,15 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "lpconfig.h"
 
 
-
-#ifdef USE_LIBGLADE
-#include <glade/glade.h>
-#endif
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
+#ifdef HAVE_GTK_OSX
+#include <gtkosxapplication.h>
+#endif
+
 #ifdef WIN32
 #define chdir _chdir
 #endif
@@ -246,40 +244,6 @@ static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name)
        }
 }
 
-#ifdef USE_LIBGLADE
-
-GtkWidget *linphone_gtk_create_window(const char *window_name){
-       GtkWidget *w;
-       GladeXML *gxml;
-       char path[2048];
-       snprintf(path,sizeof(path),"%s/%s.glade",BUILD_TREE_XML_DIR,window_name);
-       if (access(path,F_OK)!=0){
-               snprintf(path,sizeof(path),"%s/%s.glade",INSTALLED_XML_DIR,window_name);
-               if (access(path,F_OK)!=0){
-                       g_error("Could not locate neither %s/%s.glade and %s/%s.glade .",BUILD_TREE_XML_DIR,window_name,
-                               INSTALLED_XML_DIR,window_name);
-                       return NULL;
-               }
-       }
-       gxml=glade_xml_new(path,NULL,NULL);
-       glade_xml_signal_autoconnect(gxml);
-       w=glade_xml_get_widget(gxml,window_name);
-       if (w==NULL) g_error("Could not retrieve '%s' window from xml file",window_name);
-       linphone_gtk_configure_window(w,window_name);
-       return w;
-}
-
-GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){
-       GtkWidget *w;
-       GladeXML *gxml=glade_get_widget_tree(window);
-       if (gxml==NULL) g_error("Could not retrieve XML tree of window %s",name);
-       w=glade_xml_get_widget(gxml,name);
-       if (w==NULL) g_error("Could not retrieve widget %s",name);
-       return GTK_WIDGET(w);
-}
-
-#else
-
 static int get_ui_file(const char *name, char *path, int pathsize){
        snprintf(path,pathsize,"%s/%s.ui",BUILD_TREE_XML_DIR,name);
        if (access(path,F_OK)!=0){
@@ -358,7 +322,6 @@ GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){
        return GTK_WIDGET(w);
 }
 
-#endif
 
 void linphone_gtk_display_something(GtkMessageType type,const gchar *message){
        GtkWidget *dialog;
@@ -1219,7 +1182,11 @@ static void linphone_gtk_configure_main_window(){
        if (title) {
                gtk_window_set_title(GTK_WINDOW(w),title);
 #if GTK_CHECK_VERSION(2,16,0)
+#ifdef HAVE_GTK_OSX
+               gtk_menu_item_set_label(GTK_MENU_ITEM(linphone_gtk_get_widget(w,"main_menu")),_("Windows"));
+#else
                gtk_menu_item_set_label(GTK_MENU_ITEM(linphone_gtk_get_widget(w,"main_menu")),title);
+#endif
 #endif
        }
        if (start_call_icon){
@@ -1299,7 +1266,11 @@ gboolean linphone_gtk_close(GtkWidget *mw){
                linphone_core_terminate_all_calls(lc);
        }
        linphone_core_enable_video_preview(lc,FALSE);
+#ifdef HAVE_GTK_OSX
+       gtk_window_iconify(GTK_WINDOW(mw));
+#else
        gtk_widget_hide(mw);
+#endif
        return TRUE;
 }
 
@@ -1324,6 +1295,16 @@ static void linphone_gtk_init_main_window(){
        /*prevent the main window from being destroyed by a user click on WM controls, instead we hide it*/
        g_signal_connect (G_OBJECT (main_window), "delete-event",
                G_CALLBACK (linphone_gtk_close), main_window);
+#ifdef HAVE_GTK_OSX
+       {
+               GtkWidget *menubar=linphone_gtk_get_widget(main_window,"menubar1");
+               gtk_widget_destroy(linphone_gtk_get_widget(main_window,"imagemenuitem5"));
+               GtkOSXApplication *theMacApp = (GtkOSXApplication*)g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
+               gtk_osxapplication_set_menu_bar(theMacApp,GTK_MENU_SHELL(menubar));
+               gtk_widget_hide(menubar);
+               gtk_osxapplication_ready(theMacApp);
+       }
+#endif
 }
 
 
@@ -1470,8 +1451,11 @@ int main(int argc, char *argv[]){
        add_pixmap_directory("pixmaps");
        add_pixmap_directory(PACKAGE_DATA_DIR "/pixmaps/linphone");
 
-       
-       
+#ifdef HAVE_GTK_OSX
+       GtkOSXApplication *theMacApp = (GtkOSXApplication*)g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
+       g_signal_connect(G_OBJECT(theMacApp),"NSApplicationDidBecomeActive",(GCallback)linphone_gtk_show_main_window,NULL);
+       g_signal_connect(G_OBJECT(theMacApp),"NSApplicationWillTerminate",(GCallback)gtk_main_quit,NULL);
+#endif
        
        the_ui=linphone_gtk_create_window("main");
        
@@ -1488,7 +1472,9 @@ int main(int argc, char *argv[]){
        gtk_timeout_add(30,(GtkFunction)linphone_gtk_iterate,(gpointer)linphone_gtk_get_core());
        gtk_timeout_add(30,(GtkFunction)linphone_gtk_check_logs,(gpointer)NULL);
        linphone_gtk_init_main_window();
+#ifndef HAVE_GTK_OSX
        linphone_gtk_init_status_icon();
+#endif
        if (!iconified){
                linphone_gtk_show_main_window();
                linphone_gtk_check_soundcards();
@@ -1500,8 +1486,10 @@ int main(int argc, char *argv[]){
        gdk_threads_leave();
        linphone_gtk_destroy_log_window();
        linphone_core_destroy(the_core);
+#ifndef HAVE_GTK_OSX
        /*workaround a bug on win32 that makes status icon still present in the systray even after program exit.*/
        gtk_status_icon_set_visible(icon,FALSE);
+#endif
        free(progpath);
        return 0;
 }
index 5c139fbb21e7715b36a0b7e609d821f74dd01b8d..e4596609778a09c3b6550480b3eaa20a5433991b 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5c139fbb21e7715b36a0b7e609d821f74dd01b8d
+Subproject commit e4596609778a09c3b6550480b3eaa20a5433991b
diff --git a/oRTP b/oRTP
index 7f1adcfc38c3dc3286a4e4c3d68be403fb5b9a4c..98c3a0cb9b17568b1aabe038f8cb36caa9b1a147 160000 (submodule)
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit 7f1adcfc38c3dc3286a4e4c3d68be403fb5b9a4c
+Subproject commit 98c3a0cb9b17568b1aabe038f8cb36caa9b1a147