diff --git a/coreapi/bellesip_sal/sal_op_registration.c b/coreapi/bellesip_sal/sal_op_registration.c index 7c70bf18f..11a503bdd 100644 --- a/coreapi/bellesip_sal/sal_op_registration.c +++ b/coreapi/bellesip_sal/sal_op_registration.c @@ -76,6 +76,12 @@ int sal_register(SalOp *op, const char *proxy, const char *from, int expires){ belle_sip_request_t *req; belle_sip_uri_t* req_uri; + if (op->refresher){ + belle_sip_refresher_stop(op->refresher); + belle_sip_object_unref(op->refresher); + op->refresher=NULL; + } + op->type=SalOpRegister; sal_op_set_from(op,from); sal_op_set_to(op,from); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 6a47a8ca5..6cb08c276 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -5554,6 +5554,8 @@ static void linphone_core_uninit(LinphoneCore *lc) static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t curtime){ // second get the list of available proxies const MSList *elem=linphone_core_get_proxy_config_list(lc); + + if (lc->network_reachable==isReachable) return; // no change, ignore. ms_message("Network state is now [%s]",isReachable?"UP":"DOWN"); for(;elem!=NULL;elem=elem->next){ @@ -5569,9 +5571,8 @@ static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t cu lc->netup_time=curtime; lc->network_reachable=isReachable; - if (!lc->network_reachable) linphone_core_invalidate_friend_subscriptions(lc); - - if(!isReachable) { + if (!lc->network_reachable){ + linphone_core_invalidate_friend_subscriptions(lc); sal_reset_transports(lc->sal); } #ifdef BUILD_UPNP diff --git a/coreapi/proxy.c b/coreapi/proxy.c index aacde9920..a6fa96274 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -1312,10 +1312,10 @@ void linphone_proxy_config_set_state(LinphoneProxyConfig *cfg, LinphoneRegistrat LinphoneCore *lc=cfg->lc; - ms_message("Proxy config [%p] for identity [%s] moving from state [%s] to [%s]" , cfg - , linphone_proxy_config_get_identity(cfg) - , linphone_registration_state_to_string(cfg->state) - , linphone_registration_state_to_string(state)); + ms_message("Proxy config [%p] for identity [%s] moving from state [%s] to [%s]" , cfg, + linphone_proxy_config_get_identity(cfg), + linphone_registration_state_to_string(cfg->state), + linphone_registration_state_to_string(state)); if (cfg->state!=state || state==LinphoneRegistrationOk) { /*allow multiple notification of LinphoneRegistrationOk for refreshing*/ cfg->state=state; if (lc && lc->vtable.registration_state_changed){