proxy.c: we must also UNREGISTER when being in state RegistrationInProgress so that even if registration is pending we unregister properly

This commit is contained in:
Gautier Pelloux-Prayer 2015-07-30 15:03:02 +02:00
parent e001e61c58
commit 31a77583d7
2 changed files with 6 additions and 4 deletions

View file

@ -5941,7 +5941,8 @@ void sip_config_uninit(LinphoneCore *lc)
sal_iterate(lc->sal);
for(elem=config->proxies;elem!=NULL;elem=ms_list_next(elem)){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)(elem->data);
still_registered|=linphone_proxy_config_is_registered(cfg);
LinphoneRegistrationState state = linphone_proxy_config_get_state(cfg);
still_registered|=(state==LinphoneRegistrationOk||state==LinphoneRegistrationProgress);
}
ms_usleep(100000);
}

View file

@ -402,9 +402,10 @@ LinphoneAddress *guess_contact_for_register(LinphoneProxyConfig *cfg){
return ret;
}
void _linphone_proxy_config_unregister(LinphoneProxyConfig *cfg) {
if (cfg->op && cfg->state == LinphoneRegistrationOk) {
sal_unregister(cfg->op);
void _linphone_proxy_config_unregister(LinphoneProxyConfig *obj) {
if (obj->op && (obj->state == LinphoneRegistrationOk ||
(obj->state == LinphoneRegistrationProgress && obj->expires != 0))) {
sal_unregister(obj->op);
}
}