Commit 923ef434 authored by Simon Morlat's avatar Simon Morlat
Browse files

improve publish support

parent 2ebd2f08
......@@ -213,6 +213,7 @@ struct _LinphoneProxyConfig
int auth_failures;
char *dial_prefix;
LinphoneRegistrationState state;
SalOp *publish_op;
bool_t commit;
bool_t reg_sendregister;
bool_t registered;
......
......@@ -72,6 +72,7 @@ void linphone_proxy_config_destroy(LinphoneProxyConfig *obj){
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);
}
/**
......@@ -433,7 +434,9 @@ int linphone_proxy_config_send_publish(LinphoneProxyConfig *proxy,
SalOp *op=sal_op_new(proxy->lc->sal);
err=sal_publish(op,linphone_proxy_config_get_identity(proxy),
linphone_proxy_config_get_identity(proxy),linphone_online_status_to_sal(presence_mode));
sal_op_release(op);
if (proxy->publish_op!=NULL)
sal_op_release(proxy->publish_op);
proxy->publish_op=op;
return err;
}
......@@ -693,6 +696,9 @@ void linphone_proxy_config_update(LinphoneProxyConfig *cfg){
}
if (lc->sip_conf.register_only_when_network_is_up || lc->network_reachable)
linphone_proxy_config_register(cfg);
if (cfg->publish && cfg->publish_op==NULL){
linphone_proxy_config_send_publish(cfg,lc->presence_mode);
}
cfg->commit=FALSE;
}
}
......
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