Commit 03261a97 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Add API to refresh a subscription.

parent 8950b9d6
......@@ -223,6 +223,15 @@ int sal_subscribe(SalOp *op, const char *from, const char *to, const char *event
return -1;
int sal_subscribe_refresh(SalOp *op) {
if (op->refresher) {
return 0;
ms_warning("sal_refresh_subscribe(): no refresher");
return -1;
int sal_unsubscribe(SalOp *op){
if (op->refresher){
const belle_sip_transaction_t *tr=(const belle_sip_transaction_t*) belle_sip_refresher_get_transaction(op->refresher);
......@@ -192,6 +192,10 @@ int linphone_event_update_subscribe(LinphoneEvent *lev, const LinphoneContent *b
return linphone_event_send_subscribe(lev,body);
int linphone_event_refresh_subscribe(LinphoneEvent *lev) {
return sal_subscribe_refresh(lev->op);
int linphone_event_accept_subscription(LinphoneEvent *lev){
int err;
if (lev->subscription_state!=LinphoneSubscriptionIncomingReceived){
......@@ -138,12 +138,19 @@ LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_subscribe(LinphoneCore *lc,
LINPHONE_PUBLIC int linphone_event_send_subscribe(LinphoneEvent *ev, const LinphoneContent *body);
* Update (refresh) an outgoing subscription.
* Update (refresh) an outgoing subscription, changing the body.
* @param lev a LinphoneEvent
* @param body an optional body to include in the subscription update, may be NULL.
LINPHONE_PUBLIC int linphone_event_update_subscribe(LinphoneEvent *lev, const LinphoneContent *body);
* Refresh an outgoing subscription keeping the same body.
* @param lev LinphoneEvent object.
* @return 0 if successful, -1 otherwise.
LINPHONE_PUBLIC int linphone_event_refresh_subscribe(LinphoneEvent *lev);
* Accept an incoming subcription.
......@@ -742,6 +742,7 @@ int sal_subscribe(SalOp *op, const char *from, const char *to, const char *event
int sal_unsubscribe(SalOp *op);
int sal_subscribe_accept(SalOp *op);
int sal_subscribe_decline(SalOp *op, SalReason reason);
int sal_subscribe_refresh(SalOp *op);
int sal_notify(SalOp *op, const SalBodyHandler *body);
int sal_notify_close(SalOp *op);
int sal_publish(SalOp *op, const char *from, const char *to, const char*event_name, int expires, const SalBodyHandler *body);
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