-uninit sal upon network is no more reachable

-create new function to refreash registration
This commit is contained in:
Jehan Monnier 2011-02-17 17:41:08 +01:00
parent 7818dee64b
commit 1a36b0626c
3 changed files with 23 additions and 2 deletions

View file

@ -3904,8 +3904,24 @@ static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t cu
}
lc->netup_time=curtime;
lc->network_reachable=isReachable;
}
if(!isReachable) {
sal_unlisten_ports (lc->sal);
} else {
apply_transports(lc);
}
}
void linphone_core_refresh_registers(LinphoneCore* lc) {
const MSList *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) ) {
cfg->registered=0;
cfg->commit=TRUE;
}
}
}
void linphone_core_set_network_reachable(LinphoneCore* lc,bool_t isReachable) {
//first disable automatic mode
if (lc->auto_net_state_mon) {

View file

@ -972,7 +972,11 @@ int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, r
const MSList *linphone_core_get_calls(LinphoneCore *lc);
LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc);
/**
* force registration refresh to be initiated upon next iterate
* @ingroup proxies
*/
void linphone_core_refresh_registers(LinphoneCore* lc);
#ifdef __cplusplus
}
#endif

View file

@ -329,6 +329,7 @@ int sal_unlisten_ports(Sal *ctx){
if (ctx->running){
eXosip_quit();
eXosip_init();
ctx->running=FALSE;
}
return 0;
}