for(;elem!=NULL;elem=elem->next){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
if (linphone_proxy_config_register_enabled(cfg) ) {
- cfg->registered=0;
- cfg->commit=TRUE;
+ linphone_proxy_config_refresh_register(cfg);
}
}
-
}
+
void linphone_core_set_network_reachable(LinphoneCore* lc,bool_t isReachable) {
//first disable automatic mode
if (lc->auto_net_state_mon) {
const char *linphone_proxy_config_get_addr(const LinphoneProxyConfig *obj);
int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj);
bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj);
+void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj);
struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *obj);
bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
}
}
+/**
+ * Refresh a proxy registration.
+ * This is useful if for example you resuming from suspend, thus IP address may have changed.
+**/
+void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj){
+ if (obj->reg_sendregister && obj->op){
+ sal_register_refresh(obj->op,obj->expires);
+ }
+}
+
/**
* Sets a dialing prefix to be automatically prepended when inviting a number with
/*Registration*/
int sal_register(SalOp *op, const char *proxy, const char *from, int expires);
+int sal_register_refresh(SalOp *op, int expires);
int sal_unregister(SalOp *h);
/*Messaging */
return 0;
}
+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;
+ }
+ eXosip_lock();
+ eXosip_register_build_register(op->rid,expires,&msg);
+ if (msg!=NULL){
+ if (contact) register_set_contact(msg,contact);
+ eXosip_register_send_register(op->rid,msg);
+ }else ms_error("Could not build REGISTER refresh message.");
+ eXosip_unlock();
+ return 0;
+}
+
+
int sal_unregister(SalOp *h){
osip_message_t *msg=NULL;
eXosip_lock();
-Subproject commit 88d2500c0a1a01c136f0e7ebb8d9872262b57a41
+Subproject commit e7e43f83d827eebc1b6989f0ec22a89c00f15627