From 31a77583d7cbb7645551f7d5710642ad94cd654d Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 30 Jul 2015 15:03:02 +0200 Subject: [PATCH] proxy.c: we must also UNREGISTER when being in state RegistrationInProgress so that even if registration is pending we unregister properly --- coreapi/linphonecore.c | 3 ++- coreapi/proxy.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 104acb0f2..00ec99070 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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); } diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 40b860511..9d3bdc3d6 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -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); } }