mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 21:28:08 +00:00
Avoid TunnelManager to register or unregister when SIP is disabled
This commit is contained in:
parent
df4385b17c
commit
ea5f09dcea
1 changed files with 11 additions and 16 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue