diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 028d0a62e..0086029d7 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2411,6 +2411,17 @@ static bool_t transports_unchanged(const LCSipTransports * tr1, const LCSipTrans tr2->tls_port==tr1->tls_port; } +static void __linphone_core_invalidate_registers(LinphoneCore* lc){ + const bctbx_list_t *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)) { + /*this will force a re-registration at next iterate*/ + cfg->commit = TRUE; + } + } +} + int _linphone_core_apply_transports(LinphoneCore *lc){ Sal *sal=lc->sal; const char *anyaddr; @@ -6880,16 +6891,6 @@ void linphone_core_refresh_registers(LinphoneCore* lc) { } } -void __linphone_core_invalidate_registers(LinphoneCore* lc){ - const bctbx_list_t *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)) { - linphone_proxy_config_edit(cfg); - linphone_proxy_config_done(cfg); - } - } -} static void disable_internal_network_reachability_detection(LinphoneCore *lc){ if (lc->auto_net_state_mon) { diff --git a/coreapi/private.h b/coreapi/private.h index 66194714a..21f57e974 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -651,6 +651,9 @@ struct _LinphoneProxyConfig /*use to check if server config has changed between edit() and done()*/ LinphoneAddress *saved_proxy; LinphoneAddress *saved_identity; + int saved_expires; + bool_t saved_sendregister; + bool_t unused[3]; /*---*/ LinphoneAddress *pending_contact; /*use to store previous contact in case of network failure*/ LinphoneEvent *long_term_event; @@ -1159,7 +1162,6 @@ bool_t linphone_core_sound_resources_available(LinphoneCore *lc); void linphone_core_notify_refer_state(LinphoneCore *lc, LinphoneCall *referer, LinphoneCall *newcall); unsigned int linphone_core_get_audio_features(LinphoneCore *lc); -void __linphone_core_invalidate_registers(LinphoneCore* lc); void _linphone_core_codec_config_write(LinphoneCore *lc); #define HOLD_OFF (0) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 9ccd5ac4b..8014f2739 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -29,6 +29,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org) /*store current config related to server location*/ static void linphone_proxy_config_store_server_config(LinphoneProxyConfig* cfg) { + cfg->saved_sendregister = cfg->reg_sendregister; if (cfg->saved_identity) linphone_address_destroy(cfg->saved_identity); if (cfg->identity_address) cfg->saved_identity = linphone_address_clone(cfg->identity_address); @@ -786,6 +787,11 @@ int linphone_proxy_config_done(LinphoneProxyConfig *cfg) } cfg->commit = TRUE; } + if ((cfg->saved_sendregister != cfg->reg_sendregister) + || (cfg->saved_expires != cfg->expires)){ + cfg->commit = TRUE; + } + if (linphone_proxy_config_compute_publish_params_hash(cfg)) { ms_message("Publish params have changed on proxy config [%p]",cfg); if (cfg->long_term_event) {