Commit c68dd94a authored by Simon Morlat's avatar Simon Morlat
Browse files

allow notification of registration_state_changed callback for removed proxy configs.

parent 293ed89d
......@@ -843,8 +843,8 @@ static void register_success(SalOp *op, bool_t registered){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)sal_op_get_user_pointer(op);
char *msg;
if (!cfg || cfg->deletion_date!=0){
ms_message("Registration success for removed proxy config, ignored");
if (!cfg){
ms_message("Registration success for deleted proxy config, ignored");
return;
}
linphone_proxy_config_set_state(cfg, registered ? LinphoneRegistrationOk : LinphoneRegistrationCleared ,
......@@ -868,10 +868,6 @@ static void register_failure(SalOp *op){
ms_warning("Registration failed for unknown proxy config.");
return ;
}
if (cfg->deletion_date!=0){
ms_message("Registration failed for removed proxy config, ignored");
return;
}
if (details==NULL)
details=_("no response timeout");
......
......@@ -2200,9 +2200,10 @@ static void proxy_update(LinphoneCore *lc){
for(elem=lc->sip_conf.deleted_proxies;elem!=NULL;elem=next){
LinphoneProxyConfig* cfg = (LinphoneProxyConfig*)elem->data;
next=elem->next;
if (ms_time(NULL) - cfg->deletion_date > 5) {
if (ms_time(NULL) - cfg->deletion_date > 32) {
lc->sip_conf.deleted_proxies =ms_list_remove_link(lc->sip_conf.deleted_proxies,elem);
ms_message("clearing proxy config for [%s]",linphone_proxy_config_get_addr(cfg));
ms_message("Proxy config for [%s] is definitely removed from core.",linphone_proxy_config_get_addr(cfg));
_linphone_proxy_config_release_ops(cfg);
linphone_proxy_config_destroy(cfg);
}
}
......
......@@ -407,6 +407,7 @@ void linphone_core_queue_task(LinphoneCore *lc, belle_sip_source_func_t task_fun
LINPHONE_PUBLIC bool_t linphone_proxy_config_address_equal(const LinphoneAddress *a, const LinphoneAddress *b);
LINPHONE_PUBLIC bool_t linphone_proxy_config_is_server_config_changed(const LinphoneProxyConfig* obj);
void _linphone_proxy_config_unregister(LinphoneProxyConfig *obj);
void _linphone_proxy_config_release_ops(LinphoneProxyConfig *obj);
/*chat*/
void linphone_chat_message_destroy(LinphoneChatMessage* msg);
......
......@@ -149,6 +149,17 @@ LinphoneProxyConfig * linphone_core_create_proxy_config(LinphoneCore *lc) {
return obj;
}
void _linphone_proxy_config_release_ops(LinphoneProxyConfig *obj){
if (obj->op) {
sal_op_release(obj->op);
obj->op=NULL;
}
if (obj->publish_op){
sal_op_release(obj->publish_op);
obj->publish_op=NULL;
}
}
void _linphone_proxy_config_destroy(LinphoneProxyConfig *obj){
if (obj->reg_proxy!=NULL) ms_free(obj->reg_proxy);
if (obj->reg_identity!=NULL) ms_free(obj->reg_identity);
......@@ -159,12 +170,11 @@ void _linphone_proxy_config_destroy(LinphoneProxyConfig *obj){
if (obj->realm!=NULL) ms_free(obj->realm);
if (obj->type!=NULL) ms_free(obj->type);
if (obj->dial_prefix!=NULL) ms_free(obj->dial_prefix);
if (obj->op) sal_op_release(obj->op);
if (obj->publish_op) sal_op_release(obj->publish_op);
if (obj->contact_params) ms_free(obj->contact_params);
if (obj->contact_uri_params) ms_free(obj->contact_uri_params);
if (obj->saved_proxy!=NULL) linphone_address_destroy(obj->saved_proxy);
if (obj->saved_identity!=NULL) linphone_address_destroy(obj->saved_identity);
_linphone_proxy_config_release_ops(obj);
}
/**
......@@ -467,9 +477,6 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *obj){
linphone_proxy_config_set_state(obj,LinphoneRegistrationCleared,"Registration cleared");
}
_linphone_proxy_config_unregister(obj);
}
}
......@@ -1156,10 +1163,7 @@ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cf
linphone_proxy_config_edit(cfg);
linphone_proxy_config_enable_register(cfg,FALSE);
linphone_proxy_config_done(cfg);
linphone_proxy_config_update(cfg); /*so that it has an effect*/
/*as cfg no longer in proxies, unregister will never be issued*/
_linphone_proxy_config_unregister(cfg);
linphone_proxy_config_update(cfg);
}
if (lc->default_proxy==cfg){
lc->default_proxy=NULL;
......
......@@ -1540,7 +1540,7 @@ static void update_registration_status(LinphoneProxyConfig *cfg, LinphoneRegistr
}while(gtk_tree_model_iter_next(model,&iter));
}
if (!found) {
g_warning("Could not find proxy config in combo box of identities.");
/*ignored, this is a notification for a removed proxy config.*/
return;
}
switch (rs){
......
oRTP @ 49fc6895
Subproject commit 00701648593b0fce93b3d519e281dd6f547db670
Subproject commit 49fc68957126d1126be1eb0fcaaa6153480e93e4
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