Commit 5f32fd7e authored by Simon Morlat's avatar Simon Morlat

stop refreshing register when network is off.

parent c5dc16ed
......@@ -5665,6 +5665,7 @@ static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t cu
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
if (linphone_proxy_config_register_enabled(cfg) ) {
if (!isReachable) {
linphone_proxy_config_stop_refreshing(cfg);
linphone_proxy_config_set_state(cfg, LinphoneRegistrationNone,"Registration impossible (network down)");
}else{
cfg->commit=TRUE;
......
......@@ -240,6 +240,7 @@ const char *linphone_core_get_nat_address_resolved(LinphoneCore *lc);
int linphone_proxy_config_send_publish(LinphoneProxyConfig *cfg, LinphonePresenceModel *presence);
void linphone_proxy_config_set_state(LinphoneProxyConfig *cfg, LinphoneRegistrationState rstate, const char *message);
void linphone_proxy_config_stop_refreshing(LinphoneProxyConfig *obj);
void linphone_proxy_config_write_all_to_config_file(LinphoneCore *lc);
/*
* returns service route as defined in as defined by rfc3608, might be a list instead of just one.
......
......@@ -266,6 +266,17 @@ void linphone_proxy_config_apply(LinphoneProxyConfig *obj,LinphoneCore *lc){
linphone_proxy_config_done(obj);
}
void linphone_proxy_config_stop_refreshing(LinphoneProxyConfig *obj){
if (obj->publish_op){
sal_op_release(obj->publish_op);
obj->publish_op=NULL;
}
if (obj->op){
sal_op_release(obj->op);
obj->op=NULL;
}
}
LinphoneAddress *guess_contact_for_register(LinphoneProxyConfig *obj){
LinphoneAddress *ret=NULL;
LinphoneAddress *proxy=linphone_address_new(obj->reg_proxy);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment