liblinphone  3.6.1
Typedefs | Enumerations | Functions
Subscriptions

Typedefs

typedef enum
_LinphoneSubscriptionDir 
LinphoneSubscriptionDir
 
typedef void(* LinphoneEventIncomingNotifyCb )(LinphoneCore *lc, LinphoneEvent *lev, const char *notified_event, 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

LINPHONE_PUBLIC LinphoneEvent * linphone_core_subscribe (LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body)
 
LINPHONE_PUBLIC int linphone_event_update_subscribe (LinphoneEvent *lev, const LinphoneContent *body)
 
LINPHONE_PUBLIC int linphone_event_accept_subscription (LinphoneEvent *lev)
 
LINPHONE_PUBLIC int linphone_event_deny_subscription (LinphoneEvent *lev, LinphoneReason reason)
 
LINPHONE_PUBLIC int linphone_event_notify (LinphoneEvent *lev, const LinphoneContent *body)
 
LINPHONE_PUBLIC LinphoneEvent * linphone_core_publish (LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body)
 
LINPHONE_PUBLIC int linphone_event_update_publish (LinphoneEvent *lev, const LinphoneContent *body)
 
LINPHONE_PUBLIC LinphoneReason linphone_event_get_reason (const LinphoneEvent *lev)
 
LINPHONE_PUBLIC
LinphoneSubscriptionState 
linphone_event_get_subscription_state (const LinphoneEvent *lev)
 
LINPHONE_PUBLIC
LinphoneSubscriptionDir 
linphone_event_get_subscription_dir (LinphoneEvent *lev)
 
LINPHONE_PUBLIC void linphone_event_set_user_data (LinphoneEvent *ev, void *up)
 
LINPHONE_PUBLIC void * linphone_event_get_user_data (const LinphoneEvent *ev)
 
LINPHONE_PUBLIC void linphone_event_terminate (LinphoneEvent *lev)
 
LINPHONE_PUBLIC LinphoneEvent * linphone_event_ref (LinphoneEvent *lev)
 
LINPHONE_PUBLIC void linphone_event_unref (LinphoneEvent *lev)
 
LINPHONE_PUBLIC const char * linphone_event_get_name (const LinphoneEvent *lev)
 
LINPHONE_PUBLIC const
LinphoneAddress
linphone_event_get_from (const LinphoneEvent *lev)
 
LINPHONE_PUBLIC const
LinphoneAddress
linphone_event_get_resource (const LinphoneEvent *lev)
 

Detailed Description

Typedef Documentation

Typedef alias for _LinphoneSubscriptionDir

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

Callback prototype for notifying the application about notification received from the network.

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

LINPHONE_PUBLIC 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.
LINPHONE_PUBLIC 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.
LINPHONE_PUBLIC int linphone_event_accept_subscription ( LinphoneEvent *  lev)

Accept an incoming subcription.

LINPHONE_PUBLIC int linphone_event_deny_subscription ( LinphoneEvent *  lev,
LinphoneReason  reason 
)

Deny an incoming subscription with given reason.

LINPHONE_PUBLIC 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.
LINPHONE_PUBLIC 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.
LINPHONE_PUBLIC int linphone_event_update_publish ( LinphoneEvent *  lev,
const LinphoneContent body 
)

Update a publication.

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

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

LINPHONE_PUBLIC LinphoneSubscriptionState linphone_event_get_subscription_state ( const LinphoneEvent *  lev)

Get subscription state. If the event object was not created by a subscription mechanism, LinphoneSubscriptionNone is returned.

LINPHONE_PUBLIC LinphoneSubscriptionDir linphone_event_get_subscription_dir ( LinphoneEvent *  lev)

Get subscription direction. If the object wasn't created by a subscription mechanism, #LinphoneSubscriptionInvalidDir is returned.

LINPHONE_PUBLIC void linphone_event_set_user_data ( LinphoneEvent *  ev,
void *  up 
)

Set a user (application) pointer.

LINPHONE_PUBLIC void* linphone_event_get_user_data ( const LinphoneEvent *  ev)

Retrieve user pointer.

LINPHONE_PUBLIC void linphone_event_terminate ( LinphoneEvent *  lev)

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

LINPHONE_PUBLIC LinphoneEvent* linphone_event_ref ( LinphoneEvent *  lev)

Increase reference count.

LINPHONE_PUBLIC void linphone_event_unref ( LinphoneEvent *  lev)

Decrease reference count.

LINPHONE_PUBLIC const char* linphone_event_get_name ( const LinphoneEvent *  lev)

Get the name of the event as specified in the event package RFC.

LINPHONE_PUBLIC const LinphoneAddress* linphone_event_get_from ( const LinphoneEvent *  lev)

Get the "from" address of the subscription.

LINPHONE_PUBLIC const LinphoneAddress* linphone_event_get_resource ( const LinphoneEvent *  lev)

Get the resource address of the subscription or publish.