From 9723cbe2a766984b53057ed6256dca0c1b5b3e31 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 8 Feb 2012 17:33:17 +0100 Subject: [PATCH] Do not try to refresh register if network isnot reachable --- coreapi/linphonecore.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index b4412e0a8..0b200a42b 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -4179,7 +4179,12 @@ static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t cu } void linphone_core_refresh_registers(LinphoneCore* lc) { - const MSList *elem=linphone_core_get_proxy_config_list(lc); + const MSList *elem; + if (!lc->network_reachable) { + ms_warning("Refresh register operation not available (network unreachable)"); + return; + } + elem=linphone_core_get_proxy_config_list(lc); for(;elem!=NULL;elem=elem->next){ LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data; if (linphone_proxy_config_register_enabled(cfg) ) {