Add API to know if tunnel auto detect is enabled.

This commit is contained in:
Ghislain MARY 2013-10-24 15:19:30 +02:00
parent 9ef261f66e
commit 0933640e54
2 changed files with 14 additions and 0 deletions

View file

@ -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);
}

View file

@ -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