liblinphone  3.6.0
Typedefs | Enumerations | Functions
Subscriptions

Typedefs

typedef enum
_LinphoneSubscriptionDir 
LinphoneSubscriptionDir
 
typedef void(* LinphoneEventIncomingNotifyCb )(LinphoneCore *lc, LinphoneEvent *lev, const char *event_name, const LinphoneContent *body)
 
typedef void(* LinphoneSubscriptionStateChangedCb )(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state)
 

Enumerations

enum  _LinphoneSubscriptionDir
 
enum  _LinphoneSubscriptionState {
  LinphoneSubscriptionNone,
  LinphoneSubscriptionOutoingInit,
  LinphoneSubscriptionIncomingReceived,
  LinphoneSubscriptionPending,
  LinphoneSubscriptionActive,
  LinphoneSubscriptionTerminated,
  LinphoneSubscriptionError
}
 

Functions

LinphoneEvent * linphone_core_subscribe (LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body)
 
int linphone_event_update_subscribe (LinphoneEvent *lev, const LinphoneContent *body)
 
int linphone_event_accept_subscription (LinphoneEvent *lev)
 
int linphone_event_deny_subscription (LinphoneEvent *lev, LinphoneReason reason)
 
int linphone_event_notify (LinphoneEvent *lev, const LinphoneContent *body)
 
LinphoneEvent * linphone_core_publish (LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body)
 
int linphone_event_update_publish (LinphoneEvent *lev, const LinphoneContent *body)
 
LinphoneReason linphone_event_get_reason (const LinphoneEvent *lev)
 
LinphoneSubscriptionDir linphone_event_get_dir (LinphoneEvent *lev)
 
void linphone_event_set_user_data (LinphoneEvent *ev, void *up)
 
void * linphone_event_get_user_data (const LinphoneEvent *ev)
 
void linphone_event_terminate (LinphoneEvent *lev)
 

Detailed Description

Typedef Documentation

Typedef alias for _LinphoneSubscriptionDir

typedef void(* LinphoneEventIncomingNotifyCb)(LinphoneCore *lc, LinphoneEvent *lev, const char *event_name, const LinphoneContent *body)

Callback prototype for notifying the application about notification received from the network. If the notification is not associated with any outgoing subscription, then the LinphoneEvent argument is NULL.

typedef void(* LinphoneSubscriptionStateChangedCb)(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state)

Callback prototype for notifying the application about changes of subscription states, including arrival of new subscriptions.

Enumeration Type Documentation

Enum for subscription direction (incoming or outgoing).

Enum for subscription states.

Enumerator
LinphoneSubscriptionNone 

Initial state, should not be used.

LinphoneSubscriptionOutoingInit 

An outgoing subcription was created

LinphoneSubscriptionIncomingReceived 

An incoming subcription is received

LinphoneSubscriptionPending 

Subscription is pending, waiting for user approval

LinphoneSubscriptionActive 

Subscription is accepted.

LinphoneSubscriptionTerminated 

Subscription is terminated normally

LinphoneSubscriptionError 

Subscription encountered an error, indicated by linphone_event_get_reason()

Function Documentation

LinphoneEvent* linphone_core_subscribe ( LinphoneCore lc,
const LinphoneAddress resource,
const char *  event,
int  expires,
const LinphoneContent body 
)

Create an outgoing subscription, specifying the destination resource, the event name, and an optional content body. If accepted, the subscription runs for a finite period, but is automatically renewed if not terminated before.

Parameters
lcthe LinphoneCore
resourcethe destination resource
eventthe event name
expiresthe whished duration of the subscription
bodyan optional body, may be NULL.
Returns
a LinphoneEvent holding the context of the created subcription.
int linphone_event_update_subscribe ( LinphoneEvent *  lev,
const LinphoneContent body 
)

Update an outgoing subscription.

Parameters
leva LinphoneEvent
bodyan optional body to include in the subscription update, may be NULL.
int linphone_event_accept_subscription ( LinphoneEvent *  lev)

Accept an incoming subcription.

int linphone_event_deny_subscription ( LinphoneEvent *  lev,
LinphoneReason  reason 
)

Deny an incoming subscription with given reason.

int linphone_event_notify ( LinphoneEvent *  lev,
const LinphoneContent body 
)

Send a notification.

Parameters
leva #LinphoneEvent corresponding to an incoming subscription previously received and accepted.
bodyan optional body containing the actual notification data.
Returns
0 if successful, -1 otherwise.
LinphoneEvent* linphone_core_publish ( LinphoneCore lc,
const LinphoneAddress resource,
const char *  event,
int  expires,
const LinphoneContent body 
)

Publish an event. After expiry, the publication is refreshed unless it is terminated before.

Parameters
lcthe LinphoneCore
resourcethe resource uri for the event
eventthe event name
expiresthe lifetime of the publication
bodythe actual published data
Returns
the LinphoneEvent holding the context of the publish.
int linphone_event_update_publish ( LinphoneEvent *  lev,
const LinphoneContent body 
)

Update a publication.

Parameters
levthe #LinphoneEvent
bodythe new data to be published
LinphoneReason linphone_event_get_reason ( const LinphoneEvent *  lev)

Return reason code (in case of error state reached).

LinphoneSubscriptionDir linphone_event_get_dir ( LinphoneEvent *  lev)

Get subscription direction.

void linphone_event_set_user_data ( LinphoneEvent *  ev,
void *  up 
)

Set a user (application) pointer.

void* linphone_event_get_user_data ( const LinphoneEvent *  ev)

Retrieve user pointer.

void linphone_event_terminate ( LinphoneEvent *  lev)

Terminate an incoming or outgoing subscription that was previously acccepted, or a previous publication.