mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 23:58:17 +00:00
Add API to refresh a subscription.
This commit is contained in:
parent
8950b9d6fb
commit
03261a97b1
4 changed files with 22 additions and 1 deletions
|
|
@ -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) {
|
||||
belle_sip_refresher_refresh(op->refresher,belle_sip_refresher_get_expires(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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue