Avoid TunnelManager to register or unregister when SIP is disabled

This commit is contained in:
François Grisez 2014-09-24 10:16:32 +02:00
parent df4385b17c
commit ea5f09dcea

View file

@ -178,17 +178,19 @@ TunnelManager::~TunnelManager(){
}
void TunnelManager::doRegistration(){
LinphoneProxyConfig* lProxy;
linphone_core_get_default_proxy(mCore, &lProxy);
if (lProxy) {
if(linphone_proxy_config_get_state(lProxy) != LinphoneRegistrationProgress) {
linphone_proxy_config_refresh_register(lProxy);
mScheduledRegistration = false;
if(mTunnelizeSipPackets) {
LinphoneProxyConfig* lProxy;
linphone_core_get_default_proxy(mCore, &lProxy);
if (lProxy) {
if(linphone_proxy_config_get_state(lProxy) != LinphoneRegistrationProgress) {
linphone_proxy_config_refresh_register(lProxy);
mScheduledRegistration = false;
} else {
mScheduledRegistration = true;
}
} else {
mScheduledRegistration = true;
mScheduledRegistration = false;
}
} else {
mScheduledRegistration = false;
}
}
@ -362,14 +364,7 @@ void TunnelManager::setHttpProxyAuthInfo(const char* username,const char* passwd
}
void TunnelManager::tunnelizeSipPackets(bool enable){
if(enable != mTunnelizeSipPackets) {
mTunnelizeSipPackets = enable;
if(isConnected()) {
if(mTunnelizeSipPackets) sal_enable_tunnel(mCore->sal, mTunnelClient);
else sal_disable_tunnel(mCore->sal);
doRegistration();
}
}
}
bool TunnelManager::tunnelizeSipPacketsEnabled() const {