From 0933640e54f37e3521578f979d44e84ca6e795f7 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 24 Oct 2013 15:19:30 +0200 Subject: [PATCH] Add API to know if tunnel auto detect is enabled. --- coreapi/linphone_tunnel.cc | 7 +++++++ coreapi/linphone_tunnel.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/coreapi/linphone_tunnel.cc b/coreapi/linphone_tunnel.cc index 079074aa8..151755078 100644 --- a/coreapi/linphone_tunnel.cc +++ b/coreapi/linphone_tunnel.cc @@ -36,6 +36,7 @@ LinphoneTunnel* linphone_core_get_tunnel(LinphoneCore *lc){ struct _LinphoneTunnel { belledonnecomm::TunnelManager *manager; MSList *config_list; + bool_t auto_detect_enabled; }; extern "C" LinphoneTunnel* linphone_core_tunnel_new(LinphoneCore *lc){ @@ -225,6 +226,7 @@ void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel){ } void linphone_tunnel_enable(LinphoneTunnel *tunnel, bool_t enabled){ + tunnel->auto_detect_enabled = FALSE; lp_config_set_int(config(tunnel),"tunnel","enabled",(int)enabled); bcTunnel(tunnel)->enable(enabled); } @@ -311,9 +313,14 @@ void linphone_tunnel_reconnect(LinphoneTunnel *tunnel){ } void linphone_tunnel_auto_detect(LinphoneTunnel *tunnel){ + tunnel->auto_detect_enabled = TRUE; bcTunnel(tunnel)->autoDetect(); } +bool_t linphone_tunnel_auto_detect_enabled(LinphoneTunnel *tunnel) { + return tunnel->auto_detect_enabled; +} + static void my_ortp_logv(OrtpLogLevel level, const char *fmt, va_list args){ ortp_logv(level,fmt,args); } diff --git a/coreapi/linphone_tunnel.h b/coreapi/linphone_tunnel.h index 9f6302eec..cff8fc532 100644 --- a/coreapi/linphone_tunnel.h +++ b/coreapi/linphone_tunnel.h @@ -195,6 +195,13 @@ LINPHONE_PUBLIC void linphone_tunnel_reconnect(LinphoneTunnel *tunnel); */ LINPHONE_PUBLIC void linphone_tunnel_auto_detect(LinphoneTunnel *tunnel); +/** + * Tells whether tunnel auto detection is enabled. + * @param[in] tunnel LinphoneTunnel object. + * @return TRUE if auto detection is enabled, FALSE otherwise. + */ +LINPHONE_PUBLIC bool_t linphone_tunnel_auto_detect_enabled(LinphoneTunnel *tunnel); + /** * Set an optional http proxy to go through when connecting to tunnel server. * @param tunnel LinphoneTunnel object