]> sjero.net Git - linphone/commitdiff
Tunnel manager.
authorGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Thu, 15 Dec 2011 15:31:55 +0000 (16:31 +0100)
committerGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Fri, 16 Dec 2011 09:43:30 +0000 (10:43 +0100)
19 files changed:
.gitignore
build/android/Android.mk
configure.ac
coreapi/Makefile.am
coreapi/TunnelManager.cc [new file with mode: 0644]
coreapi/TunnelManager.hh [new file with mode: 0644]
coreapi/linphone_tunnel_manager.cc [new file with mode: 0644]
coreapi/linphone_tunnel_manager.h [new file with mode: 0644]
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/linphonecore_jni.cc
coreapi/private.h
gtk/Makefile.am
gtk/parameters.ui
gtk/propertybox.c
gtk/tunnel_config.ui [new file with mode: 0644]
java/common/org/linphone/core/LinphoneCore.java
oRTP

index a8905782993d1acfa250f101ac9dab7504bf612e..df1c803163bb4f8fcaeb39bdf4f52c9b0a296121 100644 (file)
@@ -41,4 +41,15 @@ Specfile
 .anjuta_sym_db.db
 gtk-glade/version_date.h
 share/linphone.desktop
+Debug/
+build/macos/Info-linphone.plist
+coreapi/help/Doxyfile
+coreapi/help/buddy_status
+coreapi/help/chatroom
+coreapi/help/doc/
+coreapi/help/helloworld
+coreapi/help/registration
+coreapi/test_ecc
+coreapi/test_lsd
+gtk/version_date.h
 
index 096f944641c211af8261355ea23ded7b38b1aacf..944f2361196c5e746111fc28e29f959c92fc8792 100755 (executable)
@@ -66,7 +66,6 @@ LOCAL_CFLAGS += \
 
 LOCAL_CFLAGS += -DIN_LINPHONE
 
-
 ifeq ($(LINPHONE_VIDEO),1)
 LOCAL_CFLAGS += -DVIDEO_ENABLED
 ifeq ($(BUILD_X264),1)
@@ -94,6 +93,18 @@ LOCAL_STATIC_LIBRARIES := \
        libosip2 \
        libgsm 
 
+ifeq ($(BUILD_TUNNEL),1)
+LOCAL_CFLAGS +=-DTUNNEL_ENABLED
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../tunnel/include
+LOCAL_SRC_FILES += linphone_tunnel_manager.cc TunnelManager.cc
+ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
+LOCAL_SHARED_LIBRARIES += libtunnelclient
+else
+LOCAL_STATIC_LIBRARIES += libtunnelclient
+endif
+endif
+
+
 
 ifneq ($(BUILD_AMR),0)
 LOCAL_CFLAGS += -DHAVE_AMR
index 568f46b73d1c6e4e705b9c172ff072081e42d977..2f206354bf4864480e661d2ee5935568387ce971 100644 (file)
@@ -37,6 +37,7 @@ AC_CONFIG_MACRO_DIR([m4])
 AC_SUBST([mkdir_p])
 AC_ISC_POSIX
 AC_PROG_CC
+AC_PROG_CXX
 AC_C_INLINE
 AM_PROG_CC_STDC
 AC_HEADER_STDC
@@ -460,6 +461,32 @@ AC_SUBST(MEDIASTREAMER_LIBS)
 AC_SUBST([MS2_VERSION])
 AC_SUBST([MS2_DIR])
 
+
+
+AC_ARG_ENABLE(tunnel,
+      [  --enable-tunnel=[yes/no]    Turn on compilation of tunnel support [default=no]],
+      [case "${enableval}" in
+        yes) enable_tunnel=true ;;
+        no)  enable_tunnel=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-tunnel) ;;
+      esac],[enable_tunnel=false])
+AM_CONDITIONAL(BUILD_TUNNEL, test x$enable_tunnel = xtrue)
+if test x$enable_tunnel = xtrue; then
+     PKG_CHECK_MODULES(TUNNEL, tunnel >= 0.3.1)
+     TUNNEL_CFLAGS+="-DTUNNEL_ENABLED"
+     AC_SUBST(TUNNEL_CFLAGS)
+     AC_SUBST(TUNNEL_LIBS)
+fi
+
+
+
+
+
+
+
+
+
+
 dnl check for db2html (docbook) to generate html user manual
 AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no)
 AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes )
@@ -517,6 +544,8 @@ AC_ARG_ENABLE(tests_enabled,
       esac],[tests_enabled=false])
 AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes)
 
+
+
 dnl ##################################################
 dnl # Check for doxygen
 dnl ##################################################
index 316b6f0365ee9835cbb7c5bc6770f67a863d4442..301c059767ed404b407328cdefcead48a6dca6fb 100644 (file)
@@ -10,7 +10,8 @@ linphone_include_HEADERS=linphonecore.h linphonefriend.h linphonecore_utils.h ..
 
 INCLUDES = \
        -I$(top_srcdir)\
-       $(MEDIASTREAMER_CFLAGS)
+       $(MEDIASTREAMER_CFLAGS)\
+       $(TUNNEL_CFLAGS)
 
 
 lib_LTLIBRARIES=liblinphone.la
@@ -37,7 +38,13 @@ liblinphone_la_SOURCES=\
        siplogin.c \
        lsd.c linphonecore_utils.h \
        ec-calibrator.c \
-       conference.c
+       conference.c \
+       linphone_tunnel_manager.h
+
+if BUILD_TUNNEL
+liblinphone_la_SOURCES+=TunnelManager.cc TunnelManager.hh linphone_tunnel_manager.c
+endif
+
 
 
 liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined
@@ -45,7 +52,8 @@ liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined
 liblinphone_la_LIBADD= \
                $(EXOSIP_LIBS) \
                $(MEDIASTREAMER_LIBS) \
-               $(ORTP_LIBS) $(OPENSSL_LIBS)
+               $(ORTP_LIBS) $(OPENSSL_LIBS) \
+               $(TUNNEL_LIBS)
 
 if BUILD_WIN32
 liblinphone_la_LIBADD+=$(top_builddir)/oRTP/src/libortp.la
@@ -70,6 +78,8 @@ AM_CFLAGS=$(STRICT_OPTIONS)  -DIN_LINPHONE \
        $(EXOSIP_CFLAGS) \
        -DENABLE_TRACE  \
        -DLOG_DOMAIN=\"LinphoneCore\" \
-        $(IPV6_CFLAGS) \
-        -DORTP_INET6 \
-        $(VIDEO_CFLAGS) 
+       $(IPV6_CFLAGS) \
+       -DORTP_INET6 \
+       $(VIDEO_CFLAGS) \
+       $(TUNNEL_CFLAGS)
+
diff --git a/coreapi/TunnelManager.cc b/coreapi/TunnelManager.cc
new file mode 100644 (file)
index 0000000..f1fa17b
--- /dev/null
@@ -0,0 +1,435 @@
+/*
+ *  C Implementation: tunnel
+ *
+ * Description: 
+ *
+ *
+ * Author: Simon Morlat <simon.morlat@linphone.org>, (C) 2009
+ *
+ * Copyright (C) 2010  Belledonne Comunications, Grenoble, France
+ *
+ */
+
+
+#include "TunnelManager.hh"
+
+#include "ortp/rtpsession.h"
+#include "linphonecore.h"
+#include "linphonecore_utils.h"
+#include "eXosip2/eXosip_transport_hook.h"
+#include "tunnel/udp_mirror.hh"
+
+#ifdef ANDROID
+#include <android/log.h>
+#endif
+
+#ifdef recvfrom 
+#undef recvfrom
+#endif
+#ifdef sendto 
+#undef sendto
+#endif
+#ifdef select 
+#undef select
+#endif
+
+using namespace belledonnecomm;
+
+Mutex TunnelManager::sMutex;
+
+int TunnelManager::eXosipSendto(int fd,const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen,void* userdata){
+       TunnelManager* lTunnelMgr=(TunnelManager*)userdata;
+       int err;
+       sMutex.lock();
+       if (lTunnelMgr->mSipSocket==NULL){
+               sMutex.unlock();
+               return len;//let ignore the error
+       }
+       err=lTunnelMgr->mSipSocket->sendto(buf,len,to,tolen);
+       sMutex.unlock();
+       return err;
+}
+
+int TunnelManager::eXosipRecvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen,void* userdata){
+       TunnelManager* lTunnelMgr=(TunnelManager*)userdata;
+       int err;
+       sMutex.lock();
+       if (lTunnelMgr->mSipSocket==NULL){
+               sMutex.unlock();
+               return 0;//let ignore the error
+       }
+       err=lTunnelMgr->mSipSocket->recvfrom(buf,len,from,*fromlen);
+       sMutex.unlock();
+       return err;
+}
+
+int TunnelManager::eXosipSelect(int max_fds, fd_set *s1, fd_set *s2, fd_set *s3, struct timeval *tv,void* userdata){
+       struct timeval begin,cur;
+       TunnelManager* lTunnelMgr=(TunnelManager*)userdata;
+       if (tv!=0 && tv->tv_sec){
+               /*this is the select from udp.c, the one that is interesting to us*/
+               unsigned int i;
+               fd_set tmp;
+               int udp_fd=eXosip_get_udp_socket();
+               int controlfd=-1;
+
+               /*
+                       Find the udp fd and the control fd
+               */
+               for(i=0;i<max_fds;++i){
+                       if (FD_ISSET(i,s1) && i!=udp_fd){
+                               controlfd=i;
+                               break;
+                       }
+               }
+               if (controlfd==-1){
+                       ms_error("Could not find control fd !");
+                       return -1;
+               }
+               FD_ZERO(s1);            
+               gettimeofday(&begin,NULL);
+               do{
+                       struct timeval abit;
+
+                       abit.tv_sec=0;
+                       abit.tv_usec=20000;
+                       sMutex.lock();
+                       if (lTunnelMgr->mSipSocket!=NULL){
+                               if (lTunnelMgr->mSipSocket->hasData()) {
+                                       sMutex.unlock();
+                                       /* we make exosip believe that it has udp data to read*/
+                                       FD_SET(udp_fd,s1);
+                                       return 1;
+                               }
+                       }
+                       sMutex.unlock();
+                       gettimeofday(&cur,NULL);
+                       if (cur.tv_sec-begin.tv_sec>tv->tv_sec) {
+                               FD_SET(controlfd,s1);
+                               FD_SET(udp_fd,s1);
+                               return 0;
+                       }
+                       FD_ZERO(s1);
+                       FD_SET(controlfd,s1);
+                       if (select(max_fds,s1,s2,s3,&abit)==1) {
+                               return 1;
+                       }
+               }while(1);
+               
+       }else{
+               /*select called from other places, only the control fd is present */
+               return select(max_fds,s1,s2,s3,tv);
+       }
+}
+
+
+void TunnelManager::addServer(const char *ip, int port,unsigned int udpMirrorPort,unsigned int delay) {
+       addServer(ip,port);
+       mUdpMirrorClients.push_back(UdpMirrorClient(ServerAddr(ip,udpMirrorPort),delay));
+}
+
+void TunnelManager::addServer(const char *ip, int port) {
+       mServerAddrs.push_back(ServerAddr(ip,port));
+       if (mTunnelClient) mTunnelClient->addServer(ip,port);
+}
+
+void TunnelManager::cleanServers() {
+       mServerAddrs.clear();
+
+       UdpMirrorClientList::iterator it;
+       mAutoDetectStarted=false;
+       for (it = mUdpMirrorClients.begin(); it != mUdpMirrorClients.end();) {
+               UdpMirrorClient& s=*it++;
+               s.stop();
+       }
+       mUdpMirrorClients.clear();
+       if (mTunnelClient) mTunnelClient->cleanServers();
+}
+
+void TunnelManager::reconnect(){
+       if (mTunnelClient)
+               mTunnelClient->reconnect();
+}
+
+void TunnelManager::setCallback(StateCallback cb, void *userdata) {
+       mCallback=cb;
+       mCallbackData=userdata;
+}
+
+static void sCloseRtpTransport(void *userData, RtpTransport *t){
+       ((TunnelManager::TunnelManager *) userData)->closeRtpTransport(t);
+}
+void TunnelManager::closeRtpTransport(RtpTransport *t){
+       TunnelSocket *socket=(TunnelSocket *) t->data;
+       mTransports.remove(t);
+       mTunnelClient->closeSocket(socket);
+       ms_free(t);
+}
+
+static RtpTransport *sCreateRtpTransport(void* userData, int port){
+       return ((TunnelManager::TunnelManager *) userData)->createRtpTransport(port);
+}
+
+RtpTransport *TunnelManager::createRtpTransport(int port){
+       RtpTransport *t=ms_new0(RtpTransport,1);
+       t->data=mTunnelClient->createSocket(port);
+       t->t_getsocket=NULL;
+       t->t_recvfrom=customRecvfrom;
+       t->t_sendto=customSendto;
+       t->close_fn=sCloseRtpTransport;
+       t->close_data=this;
+       mTransports.push_back(t);
+       return t;
+}
+
+void TunnelManager::start() {
+       if (!mTunnelClient) {
+               mTunnelClient = new TunnelClient();
+               mTunnelClient->setCallback((StateCallback)tunnelCallback,this);
+               std::list<ServerAddr>::iterator it;
+               for(it=mServerAddrs.begin();it!=mServerAddrs.end();++it){
+                       const ServerAddr &addr=*it;
+                       mTunnelClient->addServer(addr.mAddr.c_str(), addr.mPort);
+               }
+       }
+       mTunnelClient->start();
+
+       if (mSipSocket == NULL) mSipSocket =mTunnelClient->createSocket(5060);
+}
+
+bool TunnelManager::isStarted() {
+       return mTunnelClient != 0 && mTunnelClient->isStarted();
+}
+
+bool TunnelManager::isReady() const {
+       return mTunnelClient && mTunnelClient->isReady();
+}
+
+int TunnelManager::customSendto(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen){
+       int size;
+       msgpullup(msg,-1);
+       size=msgdsize(msg);
+       ((TunnelSocket*)t->data)->sendto(msg->b_rptr,size,to,tolen);
+       return size;
+}
+
+int TunnelManager::customRecvfrom(struct _RtpTransport *t, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen){
+       int err=((TunnelSocket*)t->data)->recvfrom(msg->b_wptr,msg->b_datap->db_lim-msg->b_datap->db_base,from,*fromlen);
+       if (err>0) return err;
+       return 0;
+}
+
+
+TunnelManager::TunnelManager(LinphoneCore* lc) :TunnelClientController()
+,mCore(lc)
+,mEnabled(false)
+,mSipSocket(NULL)
+,mCallback(NULL)
+,mTunnelClient(NULL)
+,mAutoDetectStarted(false) {
+
+       mExosipTransport.data=this;
+       mExosipTransport.recvfrom=eXosipRecvfrom;
+       mExosipTransport.sendto=eXosipSendto;
+       mExosipTransport.select=eXosipSelect;
+       mStateChanged=false;
+       linphone_core_add_iterate_hook(mCore,(LinphoneCoreIterateHook)sOnIterate,this);
+       mTransportFactories.audio_rtcp_func=sCreateRtpTransport;
+       mTransportFactories.audio_rtcp_func_data=this;
+       mTransportFactories.audio_rtp_func=sCreateRtpTransport;
+       mTransportFactories.audio_rtp_func_data=this;
+       mTransportFactories.video_rtcp_func=sCreateRtpTransport;
+       mTransportFactories.video_rtcp_func_data=this;
+       mTransportFactories.video_rtp_func=sCreateRtpTransport;
+       mTransportFactories.video_rtp_func_data=this;
+}
+
+TunnelManager::~TunnelManager(){
+       stopClient();
+}
+
+void TunnelManager::stopClient(){
+       eXosip_transport_hook_register(NULL);
+       if (mSipSocket != NULL){
+               sMutex.lock();
+               mTunnelClient->closeSocket(mSipSocket);
+               mSipSocket = NULL;
+               sMutex.unlock();
+       }
+       if (mTunnelClient){
+               delete mTunnelClient;
+               mTunnelClient=NULL;
+       }
+}
+
+void TunnelManager::processTunnelEvent(){
+       LinphoneProxyConfig* lProxy;
+       linphone_core_get_default_proxy(mCore, &lProxy);
+
+       if (mEnabled && mTunnelClient->isReady()){
+               ms_message("Tunnel is up, registering now");            
+               linphone_core_set_rtp_transport_factories(mCore,&mTransportFactories);
+               eXosip_transport_hook_register(&mExosipTransport);
+               //force transport to udp
+               LCSipTransports lTransport;
+               
+               lTransport.udp_port=15060;
+               lTransport.tcp_port=0;
+               lTransport.tls_port=0;
+               lTransport.dtls_port=0;
+               
+               linphone_core_set_sip_transports(mCore, &lTransport);           
+               //register
+               if (lProxy) {
+                       linphone_proxy_config_done(lProxy);
+               }
+       }else if (mEnabled && !mTunnelClient->isReady()){
+               /* we got disconnected from the tunnel */
+               if (lProxy && linphone_proxy_config_is_registered(lProxy)) {
+                       /*forces de-registration so that we register again when the tunnel is up*/
+                       linphone_proxy_config_edit(lProxy);
+                       linphone_core_iterate(mCore);
+               }
+       }
+}
+
+void TunnelManager::enable(bool isEnable) {
+       ms_message("Turning tunnel [%s]",(isEnable?"on":"off"));
+       if (isEnable && !mEnabled){
+               mEnabled=true;
+               //1 save transport 
+               linphone_core_get_sip_transports(mCore, &mRegularTransport);
+               //2 unregister
+               LinphoneProxyConfig* lProxy;
+               linphone_core_get_default_proxy(mCore, &lProxy);
+               if (lProxy) {
+                       linphone_proxy_config_edit(lProxy);
+                       //make sure unregister is sent
+                       linphone_core_iterate(mCore); 
+               }
+               //3 insert tunnel
+               start();
+       }else if (!isEnable && mEnabled){
+               mEnabled=false;
+               stopClient();
+               //1 unregister
+               LinphoneProxyConfig* lProxy;
+               linphone_core_get_default_proxy(mCore, &lProxy);
+               if (lProxy) {
+                       linphone_proxy_config_edit(lProxy);
+                       //make sure unregister is sent
+                       linphone_core_iterate(mCore); 
+               }
+               
+               //make sure unregister is sent
+               linphone_core_iterate(mCore); 
+               
+               linphone_core_set_rtp_transport_factories(mCore,NULL);
+
+               eXosip_transport_hook_register(NULL);
+               //Restore transport
+               linphone_core_set_sip_transports(mCore, &mRegularTransport);
+               //register
+               if (lProxy) {
+                       linphone_proxy_config_done(lProxy);
+               }
+
+       }
+}
+
+void TunnelManager::tunnelCallback(bool connected, TunnelManager *zis){
+       zis->mStateChanged=true;
+}
+
+/*invoked from linphone_core_iterate() */
+void TunnelManager::sOnIterate(TunnelManager *zis){
+       if (zis->mStateChanged){
+               zis->mStateChanged=false;
+               zis->processTunnelEvent();
+       }
+}
+
+#ifdef ANDROID
+static void linphone_android_log_handler(int lev, const char *fmt, va_list args){
+       int prio;
+       switch(lev){
+       case TUNNEL_DEBUG:      prio = ANDROID_LOG_DEBUG;       break;
+       case TUNNEL_INFO:       prio = ANDROID_LOG_INFO;        break;
+       case TUNNEL_NOTICE:     prio = ANDROID_LOG_INFO;        break;
+       case TUNNEL_WARN:       prio = ANDROID_LOG_WARN;        break;
+       case TUNNEL_ERROR:      prio = ANDROID_LOG_ERROR;       break;
+       default:                        prio = ANDROID_LOG_DEFAULT;     break;
+       }
+       __android_log_vprint(prio, LOG_DOMAIN, fmt, args);
+}
+#endif /*ANDROID*/
+
+void TunnelManager::enableLogs(bool value) {
+       enableLogs(value,NULL);
+}
+
+void TunnelManager::enableLogs(bool isEnabled,LogHandler logHandler) {
+       if (logHandler != NULL) SetLogHandler(logHandler);
+#ifdef ANDROID
+       else SetLogHandler(linphone_android_log_handler);
+#else
+       else SetLogHandler(default_log_handler);
+#endif
+
+       if (isEnabled) {
+               SetLogLevel(TUNNEL_ERROR|TUNNEL_WARN|TUNNEL_INFO);
+       } else {
+               SetLogLevel(TUNNEL_ERROR|TUNNEL_WARN);
+       }
+}
+       
+
+bool TunnelManager::isEnabled() {
+       return mEnabled;
+}
+void TunnelManager::UdpMirrorClientListener(bool isUdpAvailable, void* data) {
+       TunnelManager* thiz = (TunnelManager*)data;
+       if (isUdpAvailable) {
+               LOGI("Tunnel is not required, disabling");
+               thiz->enable(false);
+               thiz->mAutoDetectStarted = false;
+       } else {
+               if (++thiz->mCurrentUdpMirrorClient !=thiz->mUdpMirrorClients.end()) {
+                       //1 enable tunnable but also try backup server
+                       LOGI("Tunnel is required, enabling; Trying backup udp mirror");
+                       
+                       UdpMirrorClient &lUdpMirrorClient=*thiz->mCurrentUdpMirrorClient;
+                       lUdpMirrorClient.start(TunnelManager::UdpMirrorClientListener,(void*)thiz);
+               } else {
+                       LOGI("Tunnel is required, enabling; no backup udp mirror available");
+                       thiz->mAutoDetectStarted = false;
+               }
+               thiz->enable(true);
+       }
+       return;
+}
+
+void TunnelManager::autoDetect() {
+       // first check if udp mirrors was provisionned
+       if (mUdpMirrorClients.empty()) {
+               LOGE("No UDP mirror server configured aborting auto detection");
+               return;
+       }
+       if (mAutoDetectStarted) {
+               LOGE("auto detection already in progress, restarting");
+               (*mCurrentUdpMirrorClient).stop();
+       }
+       mAutoDetectStarted=true;
+       mCurrentUdpMirrorClient =mUdpMirrorClients.begin();
+       UdpMirrorClient &lUdpMirrorClient=*mCurrentUdpMirrorClient;
+       lUdpMirrorClient.start(TunnelManager::UdpMirrorClientListener,(void*)this);
+       
+}
+
+void TunnelManager::setHttpProxyAuthInfo(const char* username,const char* passwd) {
+       mTunnelClient->setHttpProxyAuthInfo(username,passwd);
+}
+
+LinphoneCore *TunnelManager::getLinphoneCore(){
+       return mCore;
+}
diff --git a/coreapi/TunnelManager.hh b/coreapi/TunnelManager.hh
new file mode 100644 (file)
index 0000000..20bb75d
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ *  C Implementation: tunnel
+ *
+ * Description: 
+ *
+ *
+ *
+ *Copyright (C) 2011  Belledonne Comunications, Grenoble, France
+ */
+
+#ifndef __TUNNEL_CLIENT_MANAGER_H__
+#define __TUNNEL_CLIENT_MANAGER_H__
+#include <list>
+#include "linphonecore.h"
+#include "tunnel/client.hh"
+extern "C" {
+       #include "eXosip2/eXosip_transport_hook.h"
+}
+namespace belledonnecomm {
+class TunnelClient;
+class UdpMirrorClient;
+/**
+ * @addtogroup tunnel_client 
+ * @{
+**/
+
+       /**
+        * The TunnelManager class extends the LinphoneCore functionnality in order to provide an easy to use API to 
+        * - provision tunnel servers ip addresses and ports
+        * - start/stop the tunneling service
+        * - be informed of of connection and disconnection events to the tunnel server
+        * - perform auto-detection whether tunneling is required, based on a test of sending/receiving a flow of UDP packets.
+        * 
+        * It takes in charge automatically the SIP registration procedure when connecting or disconnecting to a tunnel server.
+        * No other action on LinphoneCore is required to enable full operation in tunnel mode.
+       **/
+       class TunnelManager : public TunnelClientController{
+               
+       public:
+               /**
+                * Add a tunnel server. At least one should be provided to be able to connect.
+                * When several addresses are provided, the tunnel client may try each of them until it gets connected.
+                *
+                * @param ip tunnMethod definition for '-isInitialStateOn' not foundel server ip address
+                * @param port tunnel server tls port, recommended value is 443
+                */
+               void addServer(const char *ip, int port);
+               /**
+                *Add tunnel server with auto detection capabilities
+                *
+                * @param ip tunnel server ip address
+                * @param port tunnel server tls port, recommended value is 443
+                * @param udpMirrorPort remote port on the tunnel server side  used to test udp reachability
+                * @param delay udp packet round trip delay in ms considered as acceptable. recommanded value is 1000 ms.
+                */
+               void addServer(const char *ip, int port,unsigned int udpMirrorPort,unsigned int delay);
+               /**
+                * Removes all tunnel server address previously entered with addServer()
+               **/ 
+               void cleanServers();
+               /**
+                * Register a state callback to be notified whenever the tunnel client is connected or disconnected to the tunnel server.
+                * @param cb application callback function to use for notifying of connection/disconnection events.
+                * @param userdata An opaque pointer passed to the callback, used optionally by the application to retrieve a context.
+               **/             
+               void setCallback(StateCallback cb, void *userdata);
+               /**
+                * Start connecting to a tunnel server.
+                * At this step, nothing is tunneled yet. The enable() method must be used to state whether SIP and RTP traffic
+                * need to be tunneled or not.
+               **/
+               void start();
+               /**
+                * Forces reconnection to the tunnel server.
+                * This method is useful when the device switches from wifi to Edge/3G or vice versa. In most cases the tunnel client socket
+                * won't be notified promptly that its connection is now zombie, so it is recommended to call this method that will cause
+                * the lost connection to be closed and new connection to be issued.
+               **/
+               void reconnect();
+               /**
+                * Sets whether tunneling of SIP and RTP is required.
+                * @param isEnabled If true enter in tunneled mode, if false exits from tunneled mode.
+                * The TunnelManager takes care of refreshing SIP registration when switching on or off the tunneled mode.
+                *
+               **/
+               void enable(bool isEnabled);
+               /**
+                * In auto detect mode, the tunnel manager try to establish a real time rtp cummunication with the tunnel server on  specified port.
+                *<br>In case of success, the tunnel is automatically turned off. Otherwise, if no udp commmunication is feasible, tunnel mode is turned on.
+                *<br> Call this method each time to run the auto detection algorithm
+                */
+               void autoDetect();
+               /**
+                * Returns a boolean indicating whether tunneled operation is enabled.
+               **/
+               bool isEnabled();
+               /**
+                * Enables debug logs of the Tunnel subsystem.
+               **/
+               void enableLogs(bool isEnabled);
+               /**
+                * Enables debugs logs of the Tunnel subsystem and specify a callback where to receive the debug messages.
+               **/
+               void enableLogs(bool isEnabled,LogHandler logHandler);
+               /**
+                * iOS only feature: specify http proxy credentials.
+                * When the iOS device has an http proxy configured in the iOS settings, the tunnel client will connect to the server
+                * through this http proxy. Credentials might be needed depending on the proxy configuration.
+                * @param username The username.
+                * @param passwd The password.
+               **/
+               void setHttpProxyAuthInfo(const char* username,const char* passwd);
+               ~TunnelManager();
+               TunnelManager(LinphoneCore* lc);
+               /**
+                * Destroy the given RtpTransport.
+                */
+               void closeRtpTransport(RtpTransport *t);
+
+               /**
+                * Create an RtpTransport.
+                */
+               RtpTransport *createRtpTransport(int port);
+
+               /**
+                * Get associated Linphone Core.
+                */
+               LinphoneCore *getLinphoneCore();
+       private:
+               typedef std::list<UdpMirrorClient> UdpMirrorClientList;
+               typedef std::list<RtpTransport*> RtpTransportList;
+               virtual bool isStarted();
+               virtual bool isReady() const;
+               static int customSendto(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen);
+               static int customRecvfrom(struct _RtpTransport *t, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen);
+               static int eXosipSendto(int fd,const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen,void* userdata);
+               static int eXosipRecvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen,void* userdata);
+               static int eXosipSelect(int nfds, fd_set *s1, fd_set *s2, fd_set *s3, struct timeval *tv,void* userdata);
+               static void tunnelCallback(bool connected, TunnelManager *zis);
+               static void sOnIterate(TunnelManager *zis);
+               static void UdpMirrorClientListener(bool result, void* data);
+
+               void processTunnelEvent();
+               LinphoneCore* mCore;
+               LCSipTransports mRegularTransport;
+               TunnelSocket *mSipSocket;
+               eXosip_transport_hooks_t mExosipTransport;
+               StateCallback mCallback;
+               void * mCallbackData;
+               bool mEnabled;
+               bool mStateChanged;
+               std::list <ServerAddr> mServerAddrs;
+               UdpMirrorClientList mUdpMirrorClients;
+               UdpMirrorClientList::iterator mCurrentUdpMirrorClient;
+               TunnelClient* mTunnelClient;
+               void stopClient();
+               static Mutex sMutex;
+               bool mAutoDetectStarted;
+               RtpTransportList mTransports;
+               LinphoneRtpTransportFactories mTransportFactories;
+       };
+
+/**
+ * @}
+**/
+
+}
+
+
+
+#endif /*__TUNNEL_CLIENT_MANAGER_H__*/
diff --git a/coreapi/linphone_tunnel_manager.cc b/coreapi/linphone_tunnel_manager.cc
new file mode 100644 (file)
index 0000000..49bf700
--- /dev/null
@@ -0,0 +1,126 @@
+/***************************************************************************
+ *            linphone_tunnel_manager.cc
+ *
+ *  Fri Dec 9, 2011
+ *  Copyright  2011  Belledonne Communications
+ *  Author: Guillaume Beraudo
+ *  Email: guillaume dot beraudo at linphone dot org
+ ****************************************************************************/
+
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+#include "linphone_tunnel_manager.h"
+#include "TunnelManager.hh"
+#include "linphonecore.h"
+#include "private.h"
+#include "lpconfig.h"
+
+static inline belledonnecomm::TunnelManager *bcTunnel(LinphoneTunnelManager *tunnel){
+       return (belledonnecomm::TunnelManager *)tunnel;
+}
+
+extern "C" LinphoneTunnelManager* linphone_core_tunnel_new(LinphoneCore *lc){
+       LinphoneTunnelManager* tunnel= (LinphoneTunnelManager*) new belledonnecomm::TunnelManager(lc);
+       return tunnel;
+}
+
+LinphoneTunnelManager* linphone_tunnel_get(LinphoneCore *lc){
+       return lc->tunnel;
+}
+
+void linphone_tunnel_destroy(LinphoneTunnelManager *tunnel){
+       delete bcTunnel(tunnel);
+}
+
+void linphone_tunnel_add_server(LinphoneTunnelManager *tunnel, const char *host, int port){
+       bcTunnel(tunnel)->addServer(host, port);
+}
+
+void linphone_tunnel_add_server_and_mirror(LinphoneTunnelManager *tunnel, const char *host, int port, int remote_udp_mirror, int delay){
+       bcTunnel(tunnel)->addServer(host, port, remote_udp_mirror, delay);
+}
+
+void linphone_tunnel_clean_servers(LinphoneTunnelManager *tunnel){
+       bcTunnel(tunnel)->cleanServers();
+}
+
+void linphone_tunnel_enable(LinphoneTunnelManager *tunnel, bool_t enabled){
+       bcTunnel(tunnel)->enable(enabled);
+}
+
+bool_t linphone_tunnel_enabled(LinphoneTunnelManager *tunnel){
+       return bcTunnel(tunnel)->isEnabled();
+}
+
+void linphone_tunnel_enable_logs(LinphoneTunnelManager *tunnel, bool_t enabled){
+       bcTunnel(tunnel)->enableLogs(enabled);
+}
+
+void linphone_tunnel_auto_detect(LinphoneTunnelManager *tunnel){
+       bcTunnel(tunnel)->autoDetect();
+}
+
+
+static inline _LpConfig *config(LinphoneTunnelManager *tunnel){
+       return ((belledonnecomm::TunnelManager *)tunnel)->getLinphoneCore()->config;
+}
+
+/**
+ * Set tunnel server addresses. "host1:port1 host2:port2 host3:port3"
+**/
+void linphone_tunnel_set_server_addresses(LinphoneTunnelManager *tunnel, const char *addresses){
+       lp_config_set_string(config(tunnel),"tunnel","server_addresses",addresses);
+}
+
+/**
+ * Get tunnel server addresses. "host1:port1 host2:port2 host3:port3"
+**/
+const char *linphone_tunnel_get_server_addresses(LinphoneTunnelManager *tunnel){
+       return lp_config_get_string(config(tunnel),"tunnel","server_addresses", NULL);
+}
+
+/**
+ * Set tunnel state.
+**/
+void linphone_tunnel_set_state(LinphoneTunnelManager *tunnel, LinphoneTunnelState state){
+       switch (state) {
+               case LinphoneTunnelEnabled:
+                       lp_config_set_string(config(tunnel),"tunnel","tunnel_state","enabled");
+                       break;
+               case LinphoneTunnelDisabled:
+                       lp_config_set_string(config(tunnel),"tunnel","tunnel_state","disabled");
+                       break;
+               case LinphoneTunnelAuto:
+                       lp_config_set_string(config(tunnel),"tunnel","tunnel_state","auto");
+                       break;
+       }
+}
+
+/**
+ * Get tunnel state.
+**/
+LinphoneTunnelState linphone_tunnel_get_state(LinphoneTunnelManager *tunnel){
+       const char *state=lp_config_get_string(config(tunnel),"tunnel","tunnel_state","disabled");
+       if (0==strcmp("enabled", state)){
+               return LinphoneTunnelEnabled;
+       } else if (0==strcmp("auto", state)){
+               return LinphoneTunnelAuto;
+       } else {
+               return LinphoneTunnelDisabled;
+       }
+}
diff --git a/coreapi/linphone_tunnel_manager.h b/coreapi/linphone_tunnel_manager.h
new file mode 100644 (file)
index 0000000..6f901ac
--- /dev/null
@@ -0,0 +1,85 @@
+/***************************************************************************
+ *            linphone_tunnel_manager.h
+ *
+ *  Fri Dec 9, 2011
+ *  Copyright  2011  Belledonne Communications
+ *  Author: Guillaume Beraudo
+ *  Email: guillaume dot beraudo at linphone dot org
+ ****************************************************************************/
+
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+#ifndef LINPHONETUNNELMANAGER_H
+#define LINPHONETUNNELMANAGER_H
+
+#include "linphonecore.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct LinphoneTunnelManager LinphoneTunnelManager;
+
+LinphoneTunnelManager *linphone_tunnel_get(LinphoneCore *lc);
+void linphone_tunnel_destroy(LinphoneTunnelManager *tunnel);
+void linphone_tunnel_add_server(LinphoneTunnelManager *tunnel, const char *host, int port);
+void linphone_tunnel_add_server_and_mirror(LinphoneTunnelManager *tunnel, const char *host, int port, int remote_udp_mirror, int delay);
+void linphone_tunnel_clean_servers(LinphoneTunnelManager *tunnel);
+void linphone_tunnel_enable(LinphoneTunnelManager *tunnel, bool_t enabled);
+bool_t linphone_tunnel_enabled(LinphoneTunnelManager *tunnel);
+void linphone_tunnel_enable_logs(LinphoneTunnelManager *tunnel, bool_t enabled);
+void linphone_tunnel_auto_detect(LinphoneTunnelManager *tunnel);
+
+
+
+/**
+ * LinphoneTunnelState describes the tunnel activation states.
+ */
+typedef enum _LinphoneTunnelState{
+       LinphoneTunnelDisabled, /**<The tunnel is always on */
+       LinphoneTunnelEnabled, /**<The tunnel is always off */
+       LinphoneTunnelAuto /**<The tunnel is active if needed */
+}LinphoneTunnelState;
+
+/**
+ * Set tunnel addresses.
+**/
+void linphone_tunnel_set_server_addresses(LinphoneTunnelManager *tunnel, const char *lists);
+
+/**
+ * Get tunnel addresses.
+**/
+const char *linphone_tunnel_get_server_addresses(LinphoneTunnelManager *tunnel);
+
+/**
+ * Set tunnel state.
+**/
+void linphone_tunnel_set_state(LinphoneTunnelManager *tunnel, LinphoneTunnelState state);
+
+/**
+ * Get tunnel state.
+**/
+LinphoneTunnelState linphone_tunnel_get_state(LinphoneTunnelManager *tunnel);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
index c53d534f3784944bd9c3005831cc8ff1f422a161..d8a2db81730cdd1f80e3a214177c17efcd3f7c0f 100644 (file)
@@ -845,8 +845,11 @@ void linphone_call_init_media_streams(LinphoneCall *call){
                audio_stream_enable_noise_gate(audiostream,enabled);
        }
 
-       if (lc->a_rtp)
-               rtp_session_set_transports(audiostream->session,lc->a_rtp,lc->a_rtcp);
+       if (lc->rtptf){
+               RtpTransport *artp=lc->rtptf->audio_rtp_func(lc->rtptf->audio_rtp_func_data, call->audio_port);
+               RtpTransport *artcp=lc->rtptf->audio_rtcp_func(lc->rtptf->audio_rtcp_func_data, call->audio_port+1);
+               rtp_session_set_transports(audiostream->session,artp,artcp);
+       }
 
        call->audiostream_app_evq = ortp_ev_queue_new();
        rtp_session_register_event_queue(audiostream->session,call->audiostream_app_evq);
@@ -858,8 +861,11 @@ void linphone_call_init_media_streams(LinphoneCall *call){
        if( lc->video_conf.displaytype != NULL)
                video_stream_set_display_filter_name(call->videostream,lc->video_conf.displaytype);
        video_stream_set_event_callback(call->videostream,video_stream_event_cb, call);
-       if (lc->v_rtp)
-               rtp_session_set_transports(call->videostream->session,lc->v_rtp,lc->v_rtcp);
+       if (lc->rtptf){
+               RtpTransport *vrtp=lc->rtptf->video_rtp_func(lc->rtptf->video_rtp_func_data, call->video_port);
+               RtpTransport *vrtcp=lc->rtptf->video_rtcp_func(lc->rtptf->video_rtcp_func_data, call->video_port+1);
+               rtp_session_set_transports(call->videostream->session,vrtp,vrtcp);
+       }
        call->videostream_app_evq = ortp_ev_queue_new();
        rtp_session_register_event_queue(call->videostream->session,call->videostream_app_evq);
 #ifdef TEST_EXT_RENDERER
@@ -1039,7 +1045,7 @@ static bool_t linphone_call_sound_resources_available(LinphoneCall *call){
        return !linphone_core_is_in_conference(lc) && 
                (current==NULL || current==call);
 }
-static int find_crypto_index_from_tag(SalSrtpCryptoAlgo crypto[],unsigned char tag) {
+static int find_crypto_index_from_tag(const SalSrtpCryptoAlgo crypto[],unsigned char tag) {
        int i;
        for(i=0; i<SAL_CRYPTO_ALGO_MAX; i++) {
                if (crypto[i].tag == tag) {
@@ -1313,7 +1319,7 @@ void linphone_call_stop_media_streams(LinphoneCall *call){
                        const char *state_str=NULL;
                        ms_filter_call_method(call->audiostream->ec,MS_ECHO_CANCELLER_GET_STATE_STRING,&state_str);
                        if (state_str){
-                               ms_message("Writing echo canceller state, %i bytes",(int)strlen(state_str));
+                               ms_message("Writing echo canceler state, %i bytes",(int)strlen(state_str));
                                lp_config_set_string(call->core->config,"sound","ec_state",state_str);
                        }
                }
index 55e01193ecf7ab641992806e1dce534f71660092..aa1362cc02d912f30896363f1c6d1f92f4e1a6e1 100644 (file)
@@ -810,6 +810,14 @@ static void autoreplier_config_init(LinphoneCore *lc)
 }
 */
 
+bool_t linphone_core_tunnel_available(){
+#ifdef TUNNEL_ENABLED
+       return TRUE;
+#else
+       return FALSE;
+#endif
+}
+
 /**
  * Enable adaptive rate control (experimental feature, audio-only).
  *
@@ -989,6 +997,36 @@ static void misc_config_read (LinphoneCore *lc) {
     lc->max_calls=lp_config_get_int(config,"misc","max_calls",NB_MAX_CALLS);
 }
 
+#ifdef TUNNEL_ENABLED
+static void tunnel_add_servers_from_config(LinphoneTunnelManager *tunnel, const char* confaddress){
+       char *addresses=(char*)ms_strdup(confaddress);
+       char *str1;
+       for(str1=addresses;;str1=NULL){
+               char *port;
+               char *address=strtok(str1," "); // Not thread safe
+               if (!address) break;
+               port=strchr(address, ':');
+               if (!port) ms_fatal("Bad tunnel address %s", address);
+               *port++='\0';
+               linphone_tunnel_add_server(tunnel, address, atoi(port));
+       }
+       ms_free(addresses);
+}
+#endif
+
+void linphone_core_update_tunnel(LinphoneCore *lc){
+#ifdef TUNNEL_ENABLED
+       bool_t enabled;
+       const char* addresses=linphone_tunnel_get_server_addresses(lc->tunnel);
+       if (addresses){
+               linphone_tunnel_clean_servers(lc->tunnel);
+               tunnel_add_servers_from_config(lc->tunnel,addresses);
+       }
+       enabled=linphone_tunnel_get_state(lc->tunnel)==LinphoneTunnelEnabled && addresses!=NULL;
+       linphone_tunnel_enable(lc->tunnel, enabled);
+#endif
+}
+
 static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, const char *config_path,
     const char *factory_config_path, void * userdata)
 {
@@ -1084,6 +1122,10 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
        lc->presence_mode=LinphoneStatusOnline;
        misc_config_read(lc);
        ui_config_read(lc);
+#ifdef TUNNEL_ENABLED
+       lc->tunnel=linphone_core_tunnel_new(lc);
+       linphone_core_update_tunnel(lc);
+#endif
        if (lc->vtable.display_status)
                lc->vtable.display_status(lc,_("Ready"));
        lc->auto_net_state_mon=lc->sip_conf.auto_net_state_mon;
@@ -3874,14 +3916,8 @@ void linphone_core_stop_waiting(LinphoneCore *lc){
        }
 }
 
-void linphone_core_set_audio_transports(LinphoneCore *lc, RtpTransport *rtp, RtpTransport *rtcp){
-       lc->a_rtp=rtp;
-       lc->a_rtcp=rtcp;
-}
-
-void linphone_core_set_video_transports(LinphoneCore *lc, RtpTransport *rtp, RtpTransport *rtcp){
-       lc->v_rtp=rtp;
-       lc->v_rtcp=rtcp;
+void linphone_core_set_rtp_transport_factories(LinphoneCore* lc, LinphoneRtpTransportFactories *factories){
+       lc->rtptf=factories;
 }
 
 /**
index 68d658694843f0e5207afd31e4f48b0f72a4a432..e32c4d0fa612aff42c252d35d229bbf02981f328 100644 (file)
@@ -344,6 +344,16 @@ typedef enum _LinphoneRegistrationState{
  */
 const char *linphone_registration_state_to_string(LinphoneRegistrationState cs);
 
+/**
+ * True if tunnel support was compiled.
+ */
+bool_t linphone_core_tunnel_available();
+
+/**
+ * Update tunnel using configuration.
+ */
+void linphone_core_update_tunnel(LinphoneCore *lc);
+
 LinphoneProxyConfig *linphone_proxy_config_new(void);
 int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr);
 int linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);
@@ -1006,9 +1016,20 @@ const MSList * linphone_core_get_sip_setups(LinphoneCore *lc);
 void linphone_core_destroy(LinphoneCore *lc);
 
 /*for advanced users:*/
-void linphone_core_set_audio_transports(LinphoneCore *lc, RtpTransport *rtp, RtpTransport *rtcp);
-void linphone_core_set_video_transports(LinphoneCore *lc, RtpTransport *rtp, RtpTransport *rtcp);
+typedef RtpTransport * (*LinphoneRtpTransportFactoryFunc)(void *data, int port);
+struct _LinphoneRtpTransportFactories{
+       LinphoneRtpTransportFactoryFunc audio_rtp_func;
+       void *audio_rtp_func_data;
+       LinphoneRtpTransportFactoryFunc audio_rtcp_func;
+       void *audio_rtcp_func_data;
+       LinphoneRtpTransportFactoryFunc video_rtp_func;
+       void *video_rtp_func_data;
+       LinphoneRtpTransportFactoryFunc video_rtcp_func;
+       void *video_rtcp_func_data;
+};
+typedef struct _LinphoneRtpTransportFactories LinphoneRtpTransportFactories;
 
+void linphone_core_set_rtp_transport_factories(LinphoneCore* lc, LinphoneRtpTransportFactories *factories);
 
 int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, rtp_stats_t *remote);
 
index 4552a0523ad5447c2787556d67036706d2286fcc..eca9152f40716090cd976ccdabc0bc2ed0c66ddf 100644 (file)
@@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "linphonecore_utils.h"
 #include <ortp/zrtp.h>
 
+#ifdef TUNNEL_ENABLED
+#include "linphone_tunnel_manager.h"
+#endif
+
 extern "C" {
 #include "mediastreamer2/mediastream.h"
 }
@@ -1591,3 +1595,45 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMaxCalls(JNIEnv *env,
 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setMaxCalls(JNIEnv *env,jobject thiz,jlong pCore, jint max) {
        linphone_core_set_max_calls((LinphoneCore *) pCore, (int) max);
 }
+
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelAddServerAndMirror(JNIEnv *env,jobject thiz,jlong pCore,
+               jstring jHost, jint port, jint mirror, jint delay) {
+#ifdef TUNNEL_ENABLED
+       LinphoneTunnelManager *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return;
+       const char* cHost=env->GetStringUTFChars(jHost, NULL);
+       linphone_tunnel_add_server_and_mirror(tunnel, cHost, port, mirror, delay);
+       env->ReleaseStringUTFChars(jHost, cHost);
+#endif
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelAutoDetect(JNIEnv *env,jobject thiz,jlong pCore) {
+#ifdef TUNNEL_ENABLED
+       LinphoneTunnelManager *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return;
+       linphone_tunnel_auto_detect(tunnel);
+#endif
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelCleanServers(JNIEnv *env,jobject thiz,jlong pCore) {
+#ifdef TUNNEL_ENABLED
+       LinphoneTunnelManager *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return;
+       linphone_tunnel_clean_servers(tunnel);
+#endif
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelEnable(JNIEnv *env,jobject thiz,jlong pCore, jboolean enable) {
+#ifdef TUNNEL_ENABLED
+       LinphoneTunnelManager *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return;
+       linphone_tunnel_enable(tunnel, enable);
+#endif
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelEnableLogs(JNIEnv *env,jobject thiz,jlong pCore, jboolean enable) {
+#ifdef TUNNEL_ENABLED
+       LinphoneTunnelManager *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return;
+       linphone_tunnel_enable_logs(tunnel, enable);
+#endif
+}
+
+extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isTunnelAvailable(JNIEnv *env,jobject thiz){
+       return linphone_core_tunnel_available();
+}
index 3561a4126e0f6d89aaf39f211dc626943979a5a5..bda52f016c9ce8ddf9207d685733fc3426651d1e 100644 (file)
 
 #ifndef _PRIVATE_H
 #define _PRIVATE_H
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 #include "linphonecore.h"
+#include "linphone_tunnel_manager.h"
 #include "linphonecore_utils.h"
 #include "sal.h"
 
@@ -442,8 +445,7 @@ struct _LinphoneCore
        int missed_calls;
        VideoPreview *previewstream;
        struct _MSEventQueue *msevq;
-       RtpTransport *a_rtp,*a_rtcp;
-       RtpTransport *v_rtp,*v_rtcp;
+       LinphoneRtpTransportFactories *rtptf;
        MSList *bl_reqs;
        MSList *subscribers;    /* unknown subscribers */
        int minutes_away;
@@ -474,8 +476,11 @@ struct _LinphoneCore
        int device_rotation;
        bool_t ringstream_autorelease;
        int max_calls;
+       LinphoneTunnelManager *tunnel;
 };
 
+LinphoneTunnelManager *linphone_core_tunnel_new(LinphoneCore *lc);
+
 bool_t linphone_core_can_we_add_call(LinphoneCore *lc);
 int linphone_core_add_call( LinphoneCore *lc, LinphoneCall *call);
 int linphone_core_del_call( LinphoneCore *lc, LinphoneCall *call);
@@ -538,4 +543,9 @@ void __linphone_core_invalidate_registers(LinphoneCore* lc);
 #define NB_MAX_CALLS   (10)
 #endif
 void call_logs_write_to_config_file(LinphoneCore *lc);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _PRIVATE_H */
index 2d62217ac97d213511a88a06e7855ffe130c273b..42d5ff8386fe6f653a3f7cd783e379a74949f606 100644 (file)
@@ -8,6 +8,7 @@ UI_FILES=       about.ui \
                call_logs.ui \
                log.ui \
                buddylookup.ui \
+               tunnel_config.ui \
                waiting.ui
 
 PIXMAPS=       \
@@ -74,7 +75,8 @@ endif
 AM_CFLAGS= -DIN_LINPHONE -I$(top_srcdir)/coreapi/ \
                $(MEDIASTREAMER_CFLAGS) \
                $(ORTP_CFLAGS) \
-               $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(LIBGTKMAC_CFLAGS) $(IPV6_CFLAGS)
+               $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(LIBGTKMAC_CFLAGS) $(IPV6_CFLAGS) \
+               $(TUNNEL_CFLAGS)
 
 
 version_date.h: $(top_srcdir)/configure.ac
index 4006226325637746a40dd22cc9306d4865c317d5..2403b3316b9e03e0ea59cdae57339c85489dda76 100644 (file)
@@ -1,30 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0"?>
 <interface>
   <requires lib="gtk+" version="2.22"/>
+  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
+    <property name="value">500</property>
     <property name="lower">500</property>
     <property name="upper">3001</property>
-    <property name="value">500</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment2">
+    <property name="value">1</property>
     <property name="lower">1</property>
     <property name="upper">65535</property>
-    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment3">
+    <property name="value">1</property>
     <property name="lower">1</property>
     <property name="upper">65535</property>
-    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment4">
-    <property name="upper">65535</property>
     <property name="value">1</property>
+    <property name="upper">65535</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment7">
+    <property name="value">5060</property>
     <property name="lower">1</property>
     <property name="upper">65535</property>
-    <property name="value">5060</property>
     <property name="step_increment">1</property>
     <property name="page_increment">9.9999999995529656</property>
   </object>
   <object class="GtkAdjustment" id="adjustment_tcp_port">
-    <property name="upper">65535</property>
     <property name="value">1</property>
+    <property name="upper">65535</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
     </data>
   </object>
   <object class="GtkWindow" id="parameters">
-    <property name="can_focus">False</property>
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
     <property name="title" translatable="yes">Settings</property>
     <property name="icon">linphone2.png</property>
     <child>
       <object class="GtkVBox" id="vbox1">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
         <child>
           <object class="GtkNotebook" id="notebook1">
             <child>
               <object class="GtkVBox" id="network_tab">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <object class="GtkFrame" id="transport_frame">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment1">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox3">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <child>
                               <object class="GtkHBox" id="hbox2">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <child>
                                   <object class="GtkCheckButton" id="mtu_set">
                                     <property name="label" translatable="yes">Set Maximum Transmission Unit:</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
-                                    <property name="use_action_appearance">False</property>
                                     <property name="draw_indicator">True</property>
-                                    <signal name="toggled" handler="linphone_gtk_mtu_set" swapped="no"/>
+                                    <signal name="toggled" handler="linphone_gtk_mtu_set"/>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                   <object class="GtkSpinButton" id="mtu">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="primary_icon_activatable">False</property>
-                                    <property name="secondary_icon_activatable">False</property>
                                     <property name="adjustment">adjustment1</property>
-                                    <signal name="value-changed" handler="linphone_gtk_mtu_changed" swapped="no"/>
+                                    <signal name="value_changed" handler="linphone_gtk_mtu_changed"/>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="draw_indicator">True</property>
-                                <signal name="toggled" handler="linphone_gtk_use_sip_info_dtmf_toggled" swapped="no"/>
+                                <signal name="toggled" handler="linphone_gtk_use_sip_info_dtmf_toggled"/>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="draw_indicator">True</property>
-                                <signal name="toggled" handler="linphone_gtk_ipv6_toggled" swapped="no"/>
+                                <signal name="toggled" handler="linphone_gtk_ipv6_toggled"/>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">2</property>
                               </packing>
                             </child>
                     <child type="label">
                       <object class="GtkLabel" id="label1">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;Transport&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="ports_frame">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment2">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkTable" id="table1">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="n_rows">4</property>
+                            <property name="n_rows">5</property>
                             <property name="n_columns">2</property>
                             <child>
                               <object class="GtkComboBox" id="proto_combo">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="model">model8</property>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer1"/>
                               <object class="GtkSpinButton" id="proto_port">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="invisible_char">•</property>
+                                <property name="invisible_char">&#x2022;</property>
                                 <property name="invisible_char_set">True</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
                                 <property name="adjustment">adjustment7</property>
                               </object>
                               <packing>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="invisible_char">•</property>
+                                <property name="invisible_char">&#x2022;</property>
                                 <property name="invisible_char_set">True</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
                                 <property name="adjustment">adjustment2</property>
-                                <signal name="value-changed" handler="linphone_gtk_video_port_changed" swapped="no"/>
+                                <signal name="value_changed" handler="linphone_gtk_video_port_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="invisible_char">•</property>
+                                <property name="invisible_char">&#x2022;</property>
                                 <property name="invisible_char_set">True</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
                                 <property name="adjustment">adjustment3</property>
-                                <signal name="value-changed" handler="linphone_gtk_audio_port_changed" swapped="no"/>
+                                <signal name="value_changed" handler="linphone_gtk_audio_port_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                             <child>
                               <object class="GtkLabel" id="label7">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Video RTP/UDP:</property>
                                 <property name="justify">right</property>
                             <child>
                               <object class="GtkLabel" id="label6">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Audio RTP/UDP:</property>
                                 <property name="justify">right</property>
                             <child>
                               <object class="GtkLabel" id="media_encryption_label">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="label" translatable="yes">Media encryption type</property>
                               </object>
                               <packing>
                             <child>
                               <object class="GtkComboBox" id="media_encryption_combo">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="active">0</property>
                               </object>
                               <packing>
                                 <property name="bottom_attach">4</property>
                               </packing>
                             </child>
+                            <child>
+                              <object class="GtkLabel" id="tunnel_label">
+                                <property name="label" translatable="yes">Tunnel</property>
+                              </object>
+                              <packing>
+                                <property name="top_attach">4</property>
+                                <property name="bottom_attach">5</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" id="tunnel_edit_button">
+                                <property name="label" translatable="yes">edit</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <signal name="clicked" handler="linphone_gtk_edit_tunnel"/>
+                              </object>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">4</property>
+                                <property name="bottom_attach">5</property>
+                              </packing>
+                            </child>
                           </object>
                         </child>
                       </object>
                     <child type="label">
                       <object class="GtkLabel" id="label4">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;Network protocol and ports&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="nat_frame">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkVButtonBox" id="vbuttonbox3">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <child>
                           <object class="GtkRadioButton" id="no_nat">
                             <property name="label" translatable="yes">Direct connection to the Internet</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="active">True</property>
                             <property name="draw_indicator">True</property>
-                            <signal name="toggled" handler="linphone_gtk_no_firewall_toggled" swapped="no"/>
+                            <signal name="toggled" handler="linphone_gtk_no_firewall_toggled"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                         <child>
                           <object class="GtkVBox" id="vbox4">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <child>
                               <object class="GtkRadioButton" id="use_nat_address">
                                 <property name="label" translatable="yes">Behind NAT / Firewall (specify gateway IP below)</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="active">True</property>
                                 <property name="draw_indicator">True</property>
                                 <property name="group">no_nat</property>
-                                <signal name="toggled" handler="linphone_gtk_use_nat_address_toggled" swapped="no"/>
+                                <signal name="toggled" handler="linphone_gtk_use_nat_address_toggled"/>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkHBox" id="hbox21">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <child>
                                   <object class="GtkLabel" id="label39">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                     <property name="label" translatable="yes">Public IP address:</property>
                                     <property name="justify">right</property>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="primary_icon_activatable">False</property>
-                                    <property name="secondary_icon_activatable">False</property>
-                                    <signal name="changed" handler="linphone_gtk_nat_address_changed" swapped="no"/>
+                                    <signal name="changed" handler="linphone_gtk_nat_address_changed"/>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                         <child>
                           <object class="GtkVBox" id="vbox5">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <child>
                               <object class="GtkRadioButton" id="use_stun">
                                 <property name="label" translatable="yes">Behind NAT / Firewall (use STUN to resolve)</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="active">True</property>
                                 <property name="draw_indicator">True</property>
                                 <property name="group">no_nat</property>
-                                <signal name="toggled" handler="linphone_gtk_use_stun_toggled" swapped="no"/>
+                                <signal name="toggled" handler="linphone_gtk_use_stun_toggled"/>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkHBox" id="hbox24">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <child>
                                   <object class="GtkLabel" id="label42">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                     <property name="label" translatable="yes">Stun server:</property>
                                     <property name="justify">right</property>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="primary_icon_activatable">False</property>
-                                    <property name="secondary_icon_activatable">False</property>
-                                    <signal name="changed" handler="linphone_gtk_stun_server_changed" swapped="no"/>
+                                    <signal name="changed" handler="linphone_gtk_stun_server_changed"/>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                     <child type="label">
                       <object class="GtkLabel" id="label38">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;NAT and Firewall&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
             <child type="tab">
               <object class="GtkHBox" id="hbox12">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <object class="GtkImage" id="image6">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="stock">gtk-network</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="network">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label" translatable="yes">Network settings</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
             <child>
               <object class="GtkVBox" id="multimedia_tab">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <object class="GtkFrame" id="frame14">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment14">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkTable" id="table5">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <property name="n_rows">6</property>
                             <property name="n_columns">2</property>
                             <child>
                               <object class="GtkHBox" id="ring_sound_box">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <child>
                                   <object class="GtkFileChooserButton" id="ring_chooser">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <signal name="file-set" handler="linphone_gtk_ring_file_set" swapped="no"/>
+                                    <signal name="file_set" handler="linphone_gtk_ring_file_set"/>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="use_action_appearance">False</property>
                                     <property name="use_stock">True</property>
-                                    <signal name="clicked" handler="linphone_gtk_play_ring_file" swapped="no"/>
+                                    <signal name="clicked" handler="linphone_gtk_play_ring_file"/>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
                             <child>
                               <object class="GtkLabel" id="ring_sound_label">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Ring sound:</property>
                                 <property name="justify">right</property>
                               <object class="GtkEntry" id="alsa_dev">
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
-                                <signal name="editing-done" handler="linphone_gtk_alsa_special_device_changed" swapped="no"/>
+                                <signal name="editing_done" handler="linphone_gtk_alsa_special_device_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                             <child>
                               <object class="GtkComboBox" id="capture_device">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="model">model1</property>
-                                <signal name="changed" handler="linphone_gtk_capture_device_changed" swapped="no"/>
+                                <signal name="changed" handler="linphone_gtk_capture_device_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer2"/>
                                   <attributes>
                             <child>
                               <object class="GtkComboBox" id="ring_device">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="model">model2</property>
-                                <signal name="changed" handler="linphone_gtk_ring_device_changed" swapped="no"/>
+                                <signal name="changed" handler="linphone_gtk_ring_device_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer3"/>
                                   <attributes>
                             </child>
                             <child>
                               <object class="GtkLabel" id="label36">
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">ALSA special device (optional):</property>
                                 <property name="justify">right</property>
                             <child>
                               <object class="GtkLabel" id="label35">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Capture device:</property>
                                 <property name="justify">right</property>
                             <child>
                               <object class="GtkLabel" id="label34">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Ring device:</property>
                                 <property name="justify">right</property>
                             <child>
                               <object class="GtkLabel" id="label32">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Playback device:</property>
                                 <property name="justify">right</property>
                             <child>
                               <object class="GtkComboBox" id="playback_device">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="model">model3</property>
-                                <signal name="changed" handler="linphone_gtk_playback_device_changed" swapped="no"/>
+                                <signal name="changed" handler="linphone_gtk_playback_device_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer4"/>
                                   <attributes>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="draw_indicator">True</property>
-                                <signal name="toggled" handler="linphone_gtk_echo_cancelation_toggled" swapped="no"/>
+                                <signal name="toggled" handler="linphone_gtk_echo_cancelation_toggled"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                     <child type="label">
                       <object class="GtkLabel" id="label31">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;Audio&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="video_frame">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment4">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkTable" id="table2">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="n_rows">2</property>
                             <property name="n_columns">2</property>
                             <child>
                               <object class="GtkLabel" id="label9">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="label" translatable="yes">Video input device:</property>
                                 <property name="justify">right</property>
                               </object>
                             <child>
                               <object class="GtkComboBox" id="webcams">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="model">model4</property>
-                                <signal name="changed" handler="linphone_gtk_cam_changed" swapped="no"/>
+                                <signal name="changed" handler="linphone_gtk_cam_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer5"/>
                                   <attributes>
                             <child>
                               <object class="GtkLabel" id="video_size_label">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="label" translatable="yes">Prefered video resolution:</property>
                               </object>
                               <packing>
                             <child>
                               <object class="GtkComboBox" id="video_size">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="model">model5</property>
                                 <property name="active">0</property>
-                                <signal name="changed" handler="linphone_gtk_video_size_changed" swapped="no"/>
+                                <signal name="changed" handler="linphone_gtk_video_size_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer6"/>
                                   <attributes>
                     <child type="label">
                       <object class="GtkLabel" id="video_frame_title">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">&lt;b&gt;Video&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                       </object>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
                     <property name="fill">False</property>
                     <property name="position">1</property>
                   </packing>
             <child type="tab">
               <object class="GtkHBox" id="hbox11">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <object class="GtkImage" id="image5">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="stock">gtk-media-play</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="label2">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label" translatable="yes">Multimedia settings</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
             <child>
               <object class="GtkVBox" id="sip_tab">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <object class="GtkFrame" id="frame11">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="tooltip_text" translatable="yes">This section defines your SIP address when not using a SIP account</property>
                     <property name="label_xalign">0</property>
                     <child>
                       <object class="GtkAlignment" id="alignment11">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkTable" id="table4">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <property name="n_rows">3</property>
                             <property name="n_columns">2</property>
                             <child>
                               <object class="GtkLabel" id="label25">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Your display name (eg: John Doe):</property>
                               </object>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
-                                <signal name="changed" handler="linphone_gtk_update_my_contact" swapped="no"/>
+                                <signal name="changed" handler="linphone_gtk_update_my_contact"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                             <child>
                               <object class="GtkLabel" id="label26">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Your username:</property>
                               </object>
                             <child>
                               <object class="GtkLabel" id="label27">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Your resulting SIP address:</property>
                               </object>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
-                                <signal name="changed" handler="linphone_gtk_update_my_contact" swapped="no"/>
+                                <signal name="changed" handler="linphone_gtk_update_my_contact"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="editable">False</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                     <child type="label">
                       <object class="GtkLabel" id="label24">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;Default identity&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame12">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment12">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkHBox" id="hbox13">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <child>
                               <object class="GtkScrolledWindow" id="scrolledwindow2">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <child internal-child="selection">
-                                      <object class="GtkTreeSelection" id="treeview-selection1"/>
-                                    </child>
                                   </object>
                                 </child>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkVButtonBox" id="vbuttonbox2">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <child>
                                   <object class="GtkButton" id="add_proxy">
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <signal name="clicked" handler="linphone_gtk_add_proxy" swapped="no"/>
+                                    <signal name="clicked" handler="linphone_gtk_add_proxy"/>
                                     <child>
                                       <object class="GtkHBox" id="hbox14">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <child>
                                           <object class="GtkImage" id="image7">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <property name="stock">gtk-add</property>
                                           </object>
                                           <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
                                             <property name="position">0</property>
                                           </packing>
                                         </child>
                                         <child>
                                           <object class="GtkLabel" id="add_proxy_label">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <property name="label" translatable="yes">Add</property>
                                           </object>
                                           <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
                                             <property name="position">1</property>
                                           </packing>
                                         </child>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <signal name="clicked" handler="linphone_gtk_edit_proxy" swapped="no"/>
+                                    <signal name="clicked" handler="linphone_gtk_edit_proxy"/>
                                     <child>
                                       <object class="GtkHBox" id="hbox16">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <child>
                                           <object class="GtkImage" id="image9">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <property name="stock">gtk-edit</property>
                                           </object>
                                           <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
                                             <property name="position">0</property>
                                           </packing>
                                         </child>
                                         <child>
                                           <object class="GtkLabel" id="label_proxy2">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <property name="label" translatable="yes">Edit</property>
                                           </object>
                                           <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
                                             <property name="position">1</property>
                                           </packing>
                                         </child>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <signal name="clicked" handler="linphone_gtk_remove_proxy" swapped="no"/>
+                                    <signal name="clicked" handler="linphone_gtk_remove_proxy"/>
                                     <child>
                                       <object class="GtkHBox" id="hbox7">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <child>
                                           <object class="GtkImage" id="image2">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <property name="stock">gtk-delete</property>
                                           </object>
                                           <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
                                             <property name="position">0</property>
                                           </packing>
                                         </child>
                                         <child>
                                           <object class="GtkLabel" id="label_proxy1">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <property name="label" translatable="yes">Remove</property>
                                           </object>
                                           <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
                                             <property name="position">1</property>
                                           </packing>
                                         </child>
                                   <object class="GtkButton" id="create_phonics">
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <signal name="clicked" handler="linphone_gtk_create_fonics_account" swapped="no"/>
+                                    <signal name="clicked" handler="linphone_gtk_create_fonics_account"/>
                                     <child>
                                       <object class="GtkHBox" id="hbox1">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
                                         <child>
                                           <object class="GtkImage" id="image1">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="stock">gtk-network</property>
                                           </object>
                                           <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
                                             <property name="position">0</property>
                                           </packing>
                                         </child>
                                         <child>
                                           <object class="GtkLabel" id="label11">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="label" translatable="yes">Register to FONICS
 virtual network !</property>
                                           </object>
                                           <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
                                             <property name="position">1</property>
                                           </packing>
                                         </child>
@@ -1432,7 +1278,6 @@ virtual network !</property>
                     <child type="label">
                       <object class="GtkLabel" id="label28">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;Proxy accounts&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
@@ -1440,28 +1285,23 @@ virtual network !</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame13">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment13">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkHButtonBox" id="hbuttonbox3">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <child>
                               <object class="GtkButton" id="erase_passwords">
@@ -1469,36 +1309,28 @@ virtual network !</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="use_action_appearance">False</property>
-                                <signal name="clicked" handler="linphone_gtk_clear_passwords" swapped="no"/>
+                                <signal name="clicked" handler="linphone_gtk_clear_passwords"/>
                                 <child>
                                   <object class="GtkHBox" id="hbox18">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                     <child>
                                       <object class="GtkImage" id="image11">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <property name="stock">gtk-delete</property>
                                       </object>
                                       <packing>
-                                        <property name="expand">True</property>
-                                        <property name="fill">True</property>
                                         <property name="position">0</property>
                                       </packing>
                                     </child>
                                     <child>
                                       <object class="GtkLabel" id="label30">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <property name="label" translatable="yes">Erase all passwords</property>
                                       </object>
                                       <packing>
-                                        <property name="expand">True</property>
-                                        <property name="fill">True</property>
                                         <property name="position">1</property>
                                       </packing>
                                     </child>
@@ -1518,7 +1350,6 @@ virtual network !</property>
                     <child type="label">
                       <object class="GtkLabel" id="label29">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;Privacy&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
@@ -1526,8 +1357,6 @@ virtual network !</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
@@ -1539,31 +1368,24 @@ virtual network !</property>
             <child type="tab">
               <object class="GtkHBox" id="hbox10">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <object class="GtkImage" id="image4">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="pixbuf">stock_people.png</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="label3">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label" translatable="yes">Manage SIP Accounts</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -1576,34 +1398,29 @@ virtual network !</property>
             <child>
               <object class="GtkVBox" id="codec_tab">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <object class="GtkFrame" id="frame9">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment9">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox8">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <child>
                               <object class="GtkComboBox" id="codec_view">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="model">model6</property>
                                 <property name="active">0</property>
-                                <signal name="changed" handler="linphone_gtk_codec_view_changed" swapped="no"/>
+                                <signal name="changed" handler="linphone_gtk_codec_view_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer7"/>
                                   <attributes>
@@ -1613,14 +1430,12 @@ virtual network !</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
-                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkHBox" id="hbox_codec">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <child>
                                   <object class="GtkScrolledWindow" id="scrolledwindow1">
@@ -1634,22 +1449,16 @@ virtual network !</property>
                                         <property name="can_focus">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <property name="has_tooltip">True</property>
-                                        <child internal-child="selection">
-                                          <object class="GtkTreeSelection" id="treeview-selection2"/>
-                                        </child>
                                       </object>
                                     </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkVButtonBox" id="vbuttonbox1">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                     <child>
                                       <object class="GtkButton" id="button4">
@@ -1658,9 +1467,8 @@ virtual network !</property>
                                         <property name="can_focus">True</property>
                                         <property name="receives_default">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <property name="use_action_appearance">False</property>
                                         <property name="use_stock">True</property>
-                                        <signal name="clicked" handler="linphone_gtk_codec_up" swapped="no"/>
+                                        <signal name="clicked" handler="linphone_gtk_codec_up"/>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
@@ -1675,9 +1483,8 @@ virtual network !</property>
                                         <property name="can_focus">True</property>
                                         <property name="receives_default">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <property name="use_action_appearance">False</property>
                                         <property name="use_stock">True</property>
-                                        <signal name="clicked" handler="linphone_gtk_codec_down" swapped="no"/>
+                                        <signal name="clicked" handler="linphone_gtk_codec_down"/>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
@@ -1691,36 +1498,28 @@ virtual network !</property>
                                         <property name="can_focus">True</property>
                                         <property name="receives_default">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <signal name="clicked" handler="linphone_gtk_codec_enable" swapped="no"/>
+                                        <signal name="clicked" handler="linphone_gtk_codec_enable"/>
                                         <child>
                                           <object class="GtkHBox" id="hbox8">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <child>
                                               <object class="GtkImage" id="image3">
                                                 <property name="visible">True</property>
-                                                <property name="can_focus">False</property>
                                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                                 <property name="stock">gtk-yes</property>
                                               </object>
                                               <packing>
-                                                <property name="expand">True</property>
-                                                <property name="fill">True</property>
                                                 <property name="position">0</property>
                                               </packing>
                                             </child>
                                             <child>
                                               <object class="GtkLabel" id="label19">
                                                 <property name="visible">True</property>
-                                                <property name="can_focus">False</property>
                                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                                 <property name="label" translatable="yes">Enable</property>
                                               </object>
                                               <packing>
-                                                <property name="expand">True</property>
-                                                <property name="fill">True</property>
                                                 <property name="position">1</property>
                                               </packing>
                                             </child>
@@ -1739,36 +1538,28 @@ virtual network !</property>
                                         <property name="can_focus">True</property>
                                         <property name="receives_default">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <signal name="clicked" handler="linphone_gtk_codec_disable" swapped="no"/>
+                                        <signal name="clicked" handler="linphone_gtk_codec_disable"/>
                                         <child>
                                           <object class="GtkHBox" id="hbox9">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <child>
                                               <object class="GtkImage" id="image8">
                                                 <property name="visible">True</property>
-                                                <property name="can_focus">False</property>
                                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                                 <property name="stock">gtk-no</property>
                                               </object>
                                               <packing>
-                                                <property name="expand">True</property>
-                                                <property name="fill">True</property>
                                                 <property name="position">0</property>
                                               </packing>
                                             </child>
                                             <child>
                                               <object class="GtkLabel" id="label20">
                                                 <property name="visible">True</property>
-                                                <property name="can_focus">False</property>
                                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                                 <property name="label" translatable="yes">Disable</property>
                                               </object>
                                               <packing>
-                                                <property name="expand">True</property>
-                                                <property name="fill">True</property>
                                                 <property name="position">1</property>
                                               </packing>
                                             </child>
@@ -1784,14 +1575,11 @@ virtual network !</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
@@ -1802,7 +1590,6 @@ virtual network !</property>
                     <child type="label">
                       <object class="GtkLabel" id="label18">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;Codecs&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
@@ -1810,28 +1597,23 @@ virtual network !</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame10">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment10">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkTable" id="table3">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <property name="n_rows">3</property>
                             <property name="n_columns">2</property>
@@ -1841,10 +1623,8 @@ virtual network !</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="tooltip_text" translatable="yes">0 stands for "unlimited"</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
                                 <property name="adjustment">adjustment5</property>
-                                <signal name="value-changed" handler="linphone_gtk_upload_bw_changed" swapped="no"/>
+                                <signal name="value_changed" handler="linphone_gtk_upload_bw_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
@@ -1861,10 +1641,8 @@ virtual network !</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="tooltip_text" translatable="yes">0 stands for "unlimited"</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
                                 <property name="adjustment">adjustment6</property>
-                                <signal name="value-changed" handler="linphone_gtk_download_bw_changed" swapped="no"/>
+                                <signal name="value_changed" handler="linphone_gtk_download_bw_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
@@ -1876,7 +1654,6 @@ virtual network !</property>
                             <child>
                               <object class="GtkLabel" id="label23">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Upload speed limit in Kbit/sec:</property>
                                 <property name="justify">right</property>
@@ -1889,7 +1666,6 @@ virtual network !</property>
                             <child>
                               <object class="GtkLabel" id="label22">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">Download speed limit in Kbit/sec:</property>
                                 <property name="justify">right</property>
@@ -1901,10 +1677,9 @@ virtual network !</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
-                                <signal name="toggled" handler="linphone_gtk_adaptive_rate_control_toggled" swapped="no"/>
+                                <signal name="toggled" handler="linphone_gtk_adaptive_rate_control_toggled"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
@@ -1918,7 +1693,6 @@ virtual network !</property>
                             <child>
                               <object class="GtkLabel" id="label5">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="label" translatable="yes">&lt;i&gt;Adaptive rate control is a technique to dynamically guess the available bandwidth during a call.&lt;/i&gt;</property>
                                 <property name="use_markup">True</property>
                                 <property name="wrap">True</property>
@@ -1937,7 +1711,6 @@ virtual network !</property>
                     <child type="label">
                       <object class="GtkLabel" id="label21">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="label" translatable="yes">&lt;b&gt;Bandwidth control&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
@@ -1945,8 +1718,6 @@ virtual network !</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -1958,31 +1729,24 @@ virtual network !</property>
             <child type="tab">
               <object class="GtkHBox" id="hbox15">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <object class="GtkImage" id="image10">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="stock">gtk-execute</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="label33">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="label" translatable="yes">Codecs</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -1995,24 +1759,20 @@ virtual network !</property>
             <child>
               <object class="GtkVBox" id="vbox2">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <child>
                   <object class="GtkFrame" id="lang_frame">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment3">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkComboBox" id="lang_combo">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
                             <property name="model">model7</property>
-                            <signal name="changed" handler="linphone_gtk_lang_changed" swapped="no"/>
+                            <signal name="changed" handler="linphone_gtk_lang_changed"/>
                             <child>
                               <object class="GtkCellRendererText" id="renderer9"/>
                               <attributes>
@@ -2026,7 +1786,6 @@ virtual network !</property>
                     <child type="label">
                       <object class="GtkLabel" id="lang_label">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">&lt;b&gt;Language&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                       </object>
@@ -2034,20 +1793,17 @@ virtual network !</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="ui_level_frame">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment5">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkCheckButton" id="ui_level">
@@ -2055,9 +1811,8 @@ virtual network !</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="draw_indicator">True</property>
-                            <signal name="toggled" handler="linphone_gtk_ui_level_toggled" swapped="no"/>
+                            <signal name="toggled" handler="linphone_gtk_ui_level_toggled"/>
                           </object>
                         </child>
                       </object>
@@ -2065,7 +1820,6 @@ virtual network !</property>
                     <child type="label">
                       <object class="GtkLabel" id="label12">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">&lt;b&gt;Level&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                       </object>
@@ -2073,7 +1827,6 @@ virtual network !</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -2085,29 +1838,22 @@ virtual network !</property>
             <child type="tab">
               <object class="GtkHBox" id="hbox4">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <child>
                   <object class="GtkImage" id="image13">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="stock">gtk-properties</property>
                     <property name="icon-size">3</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="label10">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <property name="label" translatable="yes">User interface</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -2119,15 +1865,12 @@ virtual network !</property>
             </child>
           </object>
           <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
           <object class="GtkHButtonBox" id="hbuttonbox2">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
             <property name="layout_style">end</property>
             <child>
@@ -2136,33 +1879,25 @@ virtual network !</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="use_action_appearance">False</property>
-                <signal name="clicked" handler="linphone_gtk_parameters_closed" swapped="no"/>
+                <signal name="clicked" handler="linphone_gtk_parameters_closed"/>
                 <child>
                   <object class="GtkHBox" id="hbox3">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkImage" id="image12">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="stock">gtk-apply</property>
                       </object>
                       <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
                         <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="label8">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Done</property>
                       </object>
                       <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
@@ -2178,8 +1913,6 @@ virtual network !</property>
             </child>
           </object>
           <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
             <property name="padding">5</property>
             <property name="position">1</property>
           </packing>
index 8bacff9f55fd359f62d5f6102909ec83760ceadf..7c414dc835ea6e767f39e9b6be378c4ebdfea857 100644 (file)
@@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
 #include "linphone.h"
+#include "linphone_tunnel_manager.h"
 
 typedef enum {
        CAP_IGNORE,
@@ -986,5 +987,88 @@ void linphone_gtk_show_parameters(void){
 
        g_signal_connect(G_OBJECT(linphone_gtk_get_widget(pb,"proto_port")),"value-changed",(GCallback)linphone_gtk_update_my_port,NULL);
        g_signal_connect(G_OBJECT(linphone_gtk_get_widget(pb,"proto_combo")),"changed",(GCallback)linphone_gtk_proto_changed,NULL);
+
+
+       if (linphone_core_tunnel_available(lc)){
+               gtk_widget_set_visible(GTK_WIDGET(linphone_gtk_get_widget(pb,"tunnel_edit_button")), TRUE);
+               gtk_widget_set_visible(GTK_WIDGET(linphone_gtk_get_widget(pb,"tunnel_label")), TRUE);
+       }
+
        gtk_widget_show(pb);
 }
+
+
+void linphone_gtk_edit_tunnel_closed(GtkWidget *button){
+        GtkWidget *pb=gtk_widget_get_toplevel(button);
+        gtk_widget_destroy(pb);
+}
+
+#ifdef TUNNEL_ENABLED
+static void tunnel_get_server_host_and_port(LinphoneTunnelManager *tunnel, char *host, int size, int *port){
+       char *colon;
+        char *addresses=(char*)ms_strdup(linphone_tunnel_get_server_addresses(tunnel));
+       char *str1=addresses;
+        char *address=strtok(str1," "); // Not thread safe
+        if (!address) return;
+        colon=strchr(address, ':');
+        if (!colon) return;
+        *colon++='\0';
+       *port=atoi(colon);
+       memcpy(host,address,size);
+        ms_free(addresses);
+}
+#endif
+
+void linphone_gtk_edit_tunnel(GtkButton *button){
+#ifdef TUNNEL_ENABLED
+       LinphoneCore *lc=linphone_gtk_get_core();
+       GtkWidget *w=linphone_gtk_create_window("tunnel_config");
+       LinphoneTunnelManager *tunnel=linphone_tunnel_get(lc);
+       char host[50]={'\0'};
+       int port=0;
+       tunnel_get_server_host_and_port(tunnel, host, sizeof(host), &port);
+       LinphoneTunnelState state=linphone_tunnel_get_state(tunnel);
+
+       gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(w,"host")),host);
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(w,"port")), port);
+
+       if (state == LinphoneTunnelEnabled){
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(w,"radio_enable")),1);
+       } else{
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(w,"radio_disable")),1);
+       }
+
+       g_object_weak_ref(G_OBJECT(w),(GWeakNotify)linphone_gtk_edit_tunnel_closed,w);
+
+    gtk_widget_show(w);
+#endif
+}
+
+void linphone_gtk_tunnel_ok(GtkButton *button){
+#ifdef TUNNEL_ENABLED
+       // Save information to config file
+       LinphoneCore *lc=linphone_gtk_get_core();
+       GtkWidget *w=gtk_widget_get_toplevel(GTK_WIDGET(button));
+       char address[50]={'\0'};
+       LinphoneTunnelManager *tunnel=linphone_tunnel_get(lc);
+
+       gint port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(w,"port")));
+       gboolean enabled=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(w,"radio_enable")));
+       const char *host=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(w,"host")));
+
+       snprintf(address, sizeof address, "%s:%i", host, port);
+       linphone_tunnel_set_server_addresses(tunnel, address);
+       if (enabled){
+               linphone_tunnel_set_state(tunnel, LinphoneTunnelEnabled);
+       } else{
+               linphone_tunnel_set_state(tunnel,LinphoneTunnelDisabled);
+       }
+       linphone_core_update_tunnel(lc);
+       gtk_widget_destroy(w);
+#endif
+}
+
+
+void linphone_gtk_tunnel_cancel(GtkButton *button){
+
+}
diff --git a/gtk/tunnel_config.ui b/gtk/tunnel_config.ui
new file mode 100644 (file)
index 0000000..c10ddf2
--- /dev/null
@@ -0,0 +1,202 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.18"/>
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="value">3600</property>
+    <property name="upper">100000</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkDialog" id="tunnel_config">
+    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Linphone - Configure a SIP account</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="icon">linphone2.png</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox2">
+        <property name="visible">True</property>
+        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkFrame" id="frame15">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment15">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkVBox" id="vbox11">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <child>
+                      <object class="GtkTable" id="table6">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="n_rows">4</property>
+                        <property name="n_columns">2</property>
+                        <child>
+                          <object class="GtkLabel" id="label38">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="label" translatable="yes">Host</property>
+                            <property name="justify">right</property>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkEntry" id="host">
+                            <property name="width_request">275</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label39">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="label" translatable="yes">Port</property>
+                            <property name="justify">right</property>
+                          </object>
+                          <packing>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkRadioButton" id="radio_enable">
+                            <property name="label" translatable="yes">Enable</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkRadioButton" id="radio_disable">
+                            <property name="label" translatable="yes">Disable</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">radio_enable</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">3</property>
+                            <property name="bottom_attach">4</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="port">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="invisible_char">&#x25CF;</property>
+                            <property name="adjustment">adjustment1</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label42">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label" translatable="yes">Configure tunnel</property>
+                <property name="use_markup">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area2">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button6">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="linphone_gtk_tunnel_ok"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button7">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="linphone_gtk_proxy_cancel"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">button6</action-widget>
+      <action-widget response="0">button7</action-widget>
+    </action-widgets>
+  </object>
+</interface>
index b3c25b4b72c241cb2428c02a46921581a0b26b9d..a9629cce1df9a638508e338e487c08ca1681af9a 100644 (file)
@@ -707,5 +707,17 @@ public interface LinphoneCore {
         * @param path path to music file played to remote side when on hold.
         */
        void setPlayFile(String path);
-       
+       void tunnelEnable(boolean enable);
+       void tunnelAutoDetect();
+       void tunnelEnableLogs(boolean enable);
+       void tunnelCleanServers();
+       /**
+        * @param host tunnel server ip address
+        * @param port tunnel server tls port, recommended value is 443
+        * @param udpMirrorPort remote port on the tunnel server side  used to test udp reachability
+        * @param roundTripDelay udp packet round trip delay in ms considered as acceptable. recommended value is 1000 ms
+        */
+       void tunnelAddServerAndMirror(String host, int port, int udpMirrorPort, int roundTripDelay);
+
+       boolean isTunnelAvailable();
 }
diff --git a/oRTP b/oRTP
index 758150c3cd0f5a3a7a087247d6ff2dd198435fe7..729f35e54053154d92fe3eaf7bdb86bc10aec262 160000 (submodule)
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit 758150c3cd0f5a3a7a087247d6ff2dd198435fe7
+Subproject commit 729f35e54053154d92fe3eaf7bdb86bc10aec262