Commit 11d7c7be authored by Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer
Browse files

sal_register and sal_register_refresh returns -1 when exosip fails to build msg

parent 286dc698
......@@ -300,8 +300,9 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *obj){
**/
void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj){
if (obj->reg_sendregister && obj->op){
linphone_proxy_config_set_state(obj,LinphoneRegistrationProgress, "Refresh registration");
sal_register_refresh(obj->op,obj->expires);
if (sal_register_refresh(obj->op,obj->expires) == 0) {
linphone_proxy_config_set_state(obj,LinphoneRegistrationProgress, "Refresh registration");
}
}
}
......
......@@ -2042,16 +2042,17 @@ int sal_register(SalOp *h, const char *proxy, const char *from, int expires){
eXosip_register_build_register(h->rid,expires,&msg);
sal_register_add_route(msg,proxy);
}
eXosip_register_send_register(h->rid,msg);
if (msg)
eXosip_register_send_register(h->rid,msg);
eXosip_unlock();
h->expires=expires;
return 0;
return (msg != NULL) ? 0 : -1;
}
int sal_register_refresh(SalOp *op, int expires){
osip_message_t *msg=NULL;
const char *contact=sal_op_get_contact(op);
if (op->rid==-1){
ms_error("Unexistant registration context, not possible to refresh.");
return -1;
......@@ -2064,7 +2065,7 @@ int sal_register_refresh(SalOp *op, int expires){
eXosip_register_send_register(op->rid,msg);
}else ms_error("Could not build REGISTER refresh message.");
eXosip_unlock();
return 0;
return (msg != NULL) ? 0 : -1;
}
......
oRTP @ a936749f
Subproject commit 681e777d75b4e04f115034a5a90d3f27b99abe08
Subproject commit a936749fac4d3e2f788a0c03b3c4ea2021b3ae13
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