Liblinphone  5.3.0
Typedefs | Enumerations | Functions
Event api

Managing generic subscriptions and publishes. More...

Typedefs

typedef void(* LinphoneCoreCbsNotifySentCb) (LinphoneCore *core, LinphoneEvent *linphone_event, const LinphoneContent *body)
 Callback prototype for notifying the application about notification that is being sent. More...
 
typedef void(* LinphoneCoreCbsNotifyReceivedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, const char *notified_event, const LinphoneContent *body)
 Callback prototype for notifying the application about notification received from the network. More...
 
typedef LinphoneCoreCbsNotifyReceivedCb LinphoneCoreNotifyReceivedCb
 Old name of LinphoneCoreCbsNotifyReceivedCb.
 
typedef void(* LinphoneCoreCbsSubscribeReceivedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, const char *subscribe_event, const LinphoneContent *body)
 Callback prototype for notifying the application about subscription received from the network. More...
 
typedef LinphoneCoreCbsSubscribeReceivedCb LinphoneCoreSubscribeReceivedCb
 Old name of LinphoneCoreCbsSubscribeReceivedCb.
 
typedef void(* LinphoneCoreCbsSubscriptionStateChangedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, LinphoneSubscriptionState state)
 Callback prototype for notifying the application about changes of subscription states, including arrival of new subscriptions. More...
 
typedef LinphoneCoreCbsSubscriptionStateChangedCb LinphoneCoreSubscriptionStateChangedCb
 Old name of LinphoneCoreCbsSubscriptionStateChangedCb.
 
typedef void(* LinphoneCoreCbsPublishStateChangedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, LinphonePublishState state)
 Callback prototype for notifying the application about changes of publish states. More...
 
typedef LinphoneCoreCbsPublishStateChangedCb LinphoneCorePublishStateChangedCb
 Old name of LinphoneCoreCbsPublishStateChangedCb.
 
typedef void(* LinphoneCoreCbsPublishReceivedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, const char *publish_event, const LinphoneContent *body)
 Callback prototype for notifying the application about publish received from the network. More...
 
typedef LinphoneCoreCbsPublishReceivedCb LinphoneCorePublishReceivedCb
 Old name of LinphoneCoreCbsPublishReceivedCb.
 
typedef void(* LinphoneCoreCbsConferenceInfoReceivedCb) (LinphoneCore *core, const LinphoneConferenceInfo *conference_info)
 Callback prototype for notifying the application about a received conference info. More...
 
typedef void(* LinphoneCoreCbsPushNotificationReceivedCb) (LinphoneCore *core, const char *payload)
 Callback prototype for notifying the application a push notification was received. More...
 
typedef void(* LinphoneCoreCbsPreviewDisplayErrorOccurredCb) (LinphoneCore *core, int error_code)
 Callback to notify that there are errors from the video rendering. More...
 
typedef enum _LinphonePublishState LinphonePublishState
 Enum for publish states.
 
typedef enum _LinphoneSubscriptionDir LinphoneSubscriptionDir
 Enum for subscription direction (incoming or outgoing).
 
typedef enum _LinphoneSubscriptionState LinphoneSubscriptionState
 Enum for subscription states. More...
 
typedef void(* LinphoneEventCbsNotifyResponseCb) (const LinphoneEvent *linphone_event)
 Callback used to notify the response to a sent NOTIFY. More...
 

Enumerations

enum  _LinphonePublishState {
  LinphonePublishNone = 0,
  LinphonePublishIncomingReceived = 1,
  LinphonePublishOk = 2,
  LinphonePublishError = 3,
  LinphonePublishExpiring,
  LinphonePublishCleared = 5,
  LinphonePublishTerminating = 6,
  LinphonePublishOutgoingProgress = 7
}
 Enum for publish states. More...
 
enum  _LinphoneSubscriptionDir {
  LinphoneSubscriptionIncoming = 0,
  LinphoneSubscriptionOutgoing = 1,
  LinphoneSubscriptionInvalidDir = 2
}
 Enum for subscription direction (incoming or outgoing). More...
 
enum  _LinphoneSubscriptionState {
  LinphoneSubscriptionNone = 0,
  LinphoneSubscriptionOutgoingProgress = 1,
  LinphoneSubscriptionIncomingReceived = 2,
  LinphoneSubscriptionPending = 3,
  LinphoneSubscriptionActive = 4,
  LinphoneSubscriptionTerminated = 5,
  LinphoneSubscriptionError,
  LinphoneSubscriptionExpiring
}
 Enum for subscription states. More...
 

Functions

LinphoneEventlinphone_core_subscribe (LinphoneCore *core, 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. More...
 
LinphoneEventlinphone_core_create_subscribe (LinphoneCore *core, LinphoneAddress *resource, const char *event, int expires)
 Create an outgoing subscription, specifying the destination resource, the event name, and an optional content body. More...
 
LinphoneEventlinphone_core_create_subscribe_2 (LinphoneCore *core, LinphoneAddress *resource, LinphoneProxyConfig *proxy, const char *event, int expires)
 Create an outgoing subscription, specifying the destination resource, the event name, and an optional content body. More...
 
LinphoneEventlinphone_core_create_notify (LinphoneCore *core, LinphoneAddress *resource, const char *event)
 Create an out-of-dialog notification, specifying the destination resource, the event name. More...
 
LinphoneEventlinphone_core_publish (LinphoneCore *core, LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body)
 Publish an event state. More...
 
LinphoneEventlinphone_core_create_publish (LinphoneCore *core, LinphoneAddress *resource, const char *event, int expires)
 Create a publish context for an event state. More...
 
LinphoneEventlinphone_core_create_one_shot_publish (LinphoneCore *core, LinphoneAddress *resource, const char *event)
 Create a publish context for a one-shot publish. More...
 
LinphoneStatus linphone_event_send_subscribe (LinphoneEvent *linphone_event, const LinphoneContent *body)
 Send a subscription previously created by linphone_core_create_subscribe(). More...
 
LinphoneStatus linphone_event_update_subscribe (LinphoneEvent *linphone_event, const LinphoneContent *body)
 Update (refresh) an outgoing subscription, changing the body. More...
 
LinphoneStatus linphone_event_refresh_subscribe (LinphoneEvent *linphone_event)
 Refresh an outgoing subscription keeping the same body. More...
 
LinphoneStatus linphone_event_accept_subscription (LinphoneEvent *linphone_event)
 Accept an incoming subcription. More...
 
LinphoneStatus linphone_event_deny_subscription (LinphoneEvent *linphone_event, LinphoneReason reason)
 Deny an incoming subscription with given reason. More...
 
LinphoneStatus linphone_event_notify (LinphoneEvent *linphone_event, const LinphoneContent *body)
 Send a notification. More...
 
LinphoneStatus linphone_event_send_publish (LinphoneEvent *linphone_event, const LinphoneContent *body)
 Send a publish created by linphone_core_create_publish(). More...
 
LinphoneStatus linphone_event_update_publish (LinphoneEvent *linphone_event, const LinphoneContent *body)
 Update (refresh) a publish. More...
 
LinphoneStatus linphone_event_refresh_publish (LinphoneEvent *linphone_event)
 Refresh an outgoing publish keeping the same body. More...
 
LinphoneStatus linphone_event_accept_publish (LinphoneEvent *linphone_event)
 Accept an incoming publish. More...
 
LinphoneStatus linphone_event_deny_publish (LinphoneEvent *linphone_event, LinphoneReason reason)
 Deny an incoming publish with given reason. More...
 
void linphone_event_pause_publish (LinphoneEvent *linphone_event)
 Prevent an event from refreshing its publish. More...
 
LinphoneReason linphone_event_get_reason (const LinphoneEvent *linphone_event)
 Return reason code (in case of error state reached). More...
 
const LinphoneErrorInfolinphone_event_get_error_info (const LinphoneEvent *linphone_event)
 Get full details about an error occured. More...
 
LinphoneSubscriptionState linphone_event_get_subscription_state (const LinphoneEvent *linphone_event)
 Get subscription state. More...
 
LinphonePublishState linphone_event_get_publish_state (const LinphoneEvent *linphone_event)
 Get publish state. More...
 
LinphoneSubscriptionDir linphone_event_get_subscription_dir (LinphoneEvent *linphone_event)
 Get subscription direction. More...
 
void linphone_event_set_user_data (LinphoneEvent *linphone_event, void *user_data)
 Set a user (application) pointer. More...
 
void * linphone_event_get_user_data (const LinphoneEvent *linphone_event)
 Retrieve user pointer. More...
 
void linphone_event_add_custom_header (LinphoneEvent *linphone_event, const char *name, const char *value)
 Add a custom header to an outgoing susbscription or publish. More...
 
void linphone_event_remove_custom_header (LinphoneEvent *ev, const char *name)
 Remove custom header to an outgoing susbscription or publish. More...
 
const char * linphone_event_get_custom_header (LinphoneEvent *linphone_event, const char *name)
 Obtain the value of a given header for an incoming subscription. More...
 
void linphone_event_terminate (LinphoneEvent *linphone_event)
 Terminate an incoming or outgoing subscription that was previously acccepted, or a previous publication. More...
 
LinphoneEventlinphone_event_ref (LinphoneEvent *linphone_event)
 Increase reference count of LinphoneEvent. More...
 
void linphone_event_unref (LinphoneEvent *linphone_event)
 Decrease reference count. More...
 
const char * linphone_event_get_name (const LinphoneEvent *linphone_event)
 Get the name of the event as specified in the event package RFC. More...
 
const LinphoneAddresslinphone_event_get_from (const LinphoneEvent *linphone_event)
 Get the "from" address of the subscription. More...
 
const LinphoneAddresslinphone_event_get_to (const LinphoneEvent *lev)
 Get the "to" address of the subscription. More...
 
const LinphoneAddresslinphone_event_get_resource (const LinphoneEvent *linphone_event)
 Get the resource address of the subscription or publish. More...
 
const LinphoneAddresslinphone_event_get_remote_contact (const LinphoneEvent *linphone_event)
 Get the "contact" address of the subscription. More...
 
LinphoneCorelinphone_event_get_core (const LinphoneEvent *linphone_event)
 Returns back pointer to the LinphoneCore that created this LinphoneEvent. More...
 
void linphone_event_add_callbacks (LinphoneEvent *linphone_event, LinphoneEventCbs *cbs)
 Adds a LinphoneEventCbs object to be associated with a LinphoneEvent. More...
 
void linphone_event_remove_callbacks (LinphoneEvent *linphone_event, LinphoneEventCbs *cbs)
 Removes a LinphoneEventCbs object associated with a LinphoneEvent. More...
 
LinphoneEventCbslinphone_event_get_current_callbacks (const LinphoneEvent *linphone_event)
 Get the current LinphoneEventCbs object associated with a LinphoneEvent. More...
 

Detailed Description

Managing generic subscriptions and publishes.

The LinphoneEvent api allows application to control subscriptions, receive notifications and make publish to peers, in a generic manner.

Typedef Documentation

◆ LinphoneCoreCbsConferenceInfoReceivedCb

typedef void(* LinphoneCoreCbsConferenceInfoReceivedCb) (LinphoneCore *core, const LinphoneConferenceInfo *conference_info)

Callback prototype for notifying the application about a received conference info.

Parameters
coreLinphoneCore object
conference_infothe LinphoneConferenceInfo received

◆ LinphoneCoreCbsNotifyReceivedCb

typedef void(* LinphoneCoreCbsNotifyReceivedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, const char *notified_event, const LinphoneContent *body)

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

Parameters
coreLinphoneCore object
linphone_eventthe LinphoneEvent received
notified_eventThe event as string
bodythe LinphoneContent of the event

◆ LinphoneCoreCbsNotifySentCb

typedef void(* LinphoneCoreCbsNotifySentCb) (LinphoneCore *core, LinphoneEvent *linphone_event, const LinphoneContent *body)

Callback prototype for notifying the application about notification that is being sent.

Parameters
coreLinphoneCore object
linphone_eventthe LinphoneEvent received
notified_eventThe event as string
bodythe LinphoneContent of the event

◆ LinphoneCoreCbsPreviewDisplayErrorOccurredCb

typedef void(* LinphoneCoreCbsPreviewDisplayErrorOccurredCb) (LinphoneCore *core, int error_code)

Callback to notify that there are errors from the video rendering.

Check LinphoneCallCbsVideoDisplayErrorOccurredCb for more details.

Parameters
coreLinphoneCore object
error_codeThe error code. It depends of the display filter (available for OpenGL)

◆ LinphoneCoreCbsPublishReceivedCb

typedef void(* LinphoneCoreCbsPublishReceivedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, const char *publish_event, const LinphoneContent *body)

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

Parameters
coreLinphoneCore object
linphone_eventthe LinphoneEvent received
publish_eventThe event as string
bodythe LinphoneContent of the event

◆ LinphoneCoreCbsPublishStateChangedCb

typedef void(* LinphoneCoreCbsPublishStateChangedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, LinphonePublishState state)

Callback prototype for notifying the application about changes of publish states.

Parameters
coreLinphoneCore object
linphone_eventthe LinphoneEvent
statethe new LinphonePublishState

◆ LinphoneCoreCbsPushNotificationReceivedCb

typedef void(* LinphoneCoreCbsPushNotificationReceivedCb) (LinphoneCore *core, const char *payload)

Callback prototype for notifying the application a push notification was received.

On iOS it only works with pushkit (VoIP) pushes.

Parameters
coreLinphoneCore object
payloadthe body of the push notification, if any

◆ LinphoneCoreCbsSubscribeReceivedCb

typedef void(* LinphoneCoreCbsSubscribeReceivedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, const char *subscribe_event, const LinphoneContent *body)

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

Parameters
coreLinphoneCore object
linphone_eventthe LinphoneEvent received
subscribe_eventThe event as string
bodythe LinphoneContent of the event

◆ LinphoneCoreCbsSubscriptionStateChangedCb

typedef void(* LinphoneCoreCbsSubscriptionStateChangedCb) (LinphoneCore *core, LinphoneEvent *linphone_event, LinphoneSubscriptionState state)

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

Parameters
coreLinphoneCore object
linphone_eventthe LinphoneEvent
statethe new LinphoneSubscriptionState

◆ LinphoneEventCbsNotifyResponseCb

typedef void(* LinphoneEventCbsNotifyResponseCb) (const LinphoneEvent *linphone_event)

Callback used to notify the response to a sent NOTIFY.

Parameters
linphone_eventThe LinphoneEvent object that has sent the NOTIFY and for which we received a response

◆ LinphoneSubscriptionState

Enum for subscription states.

LinphoneSubscriptionTerminated and LinphoneSubscriptionError are final states.

Enumeration Type Documentation

◆ _LinphonePublishState

Enum for publish states.

Enumerator
LinphonePublishNone 

Initial state, do not use.

LinphonePublishIncomingReceived 

An incoming publish is received.

LinphonePublishOk 

Publish is accepted.

LinphonePublishError 

Publish encoutered an error, linphone_event_get_reason() gives reason code.

LinphonePublishExpiring 

Publish is about to expire, only sent if [sip]->refresh_generic_publish property is set to 0.

LinphonePublishCleared 

Event has been un published.

LinphonePublishTerminating 

Publish is about to terminate.

LinphonePublishOutgoingProgress 

An outgoing publish was created and submitted.

◆ _LinphoneSubscriptionDir

Enum for subscription direction (incoming or outgoing).

Enumerator
LinphoneSubscriptionIncoming 

Incoming subscription.

LinphoneSubscriptionOutgoing 

Outgoing subscription.

LinphoneSubscriptionInvalidDir 

Invalid subscription direction.

◆ _LinphoneSubscriptionState

Enum for subscription states.

LinphoneSubscriptionTerminated and LinphoneSubscriptionError are final states.

Enumerator
LinphoneSubscriptionNone 

Initial state, should not be used.

LinphoneSubscriptionOutgoingProgress 

An outgoing subcription was sent.

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 was terminated by an error, indicated by linphone_event_get_reason()

LinphoneSubscriptionExpiring 

Subscription is about to expire, only sent if [sip]->refresh_generic_subscribe property is set to 0.

Function Documentation

◆ linphone_core_create_notify()

LinphoneEvent* linphone_core_create_notify ( LinphoneCore core,
LinphoneAddress resource,
const char *  event 
)

Create an out-of-dialog notification, specifying the destination resource, the event name.

The notification can be send with linphone_event_notify().

Parameters
corethe LinphoneCore
resourcethe destination resource
eventthe event name
Returns
a LinphoneEvent holding the context of the notification.

◆ linphone_core_create_one_shot_publish()

LinphoneEvent* linphone_core_create_one_shot_publish ( LinphoneCore core,
LinphoneAddress resource,
const char *  event 
)

Create a publish context for a one-shot publish.

After being created, the publish must be sent using linphone_event_send_publish(). The LinphoneEvent is automatically terminated when the publish transaction is finished, either with success or failure. The application must not call linphone_event_terminate() for such one-shot publish.

Parameters
corethe LinphoneCore
resourcethe resource uri for the event
eventthe event name
Returns
the LinphoneEvent holding the context of the publish.

◆ linphone_core_create_publish()

LinphoneEvent* linphone_core_create_publish ( LinphoneCore core,
LinphoneAddress resource,
const char *  event,
int  expires 
)

Create a publish context for an event state.

After being created, the publish must be sent using linphone_event_send_publish(). After expiry, the publication is refreshed unless it is terminated before.

Parameters
corethe LinphoneCore
resourcethe resource uri for the event
eventthe event name
expiresthe lifetime of event being published, -1 if no associated duration, in which case it will not be refreshed.
Returns
the LinphoneEvent holding the context of the publish.

◆ linphone_core_create_subscribe()

LinphoneEvent* linphone_core_create_subscribe ( LinphoneCore core,
LinphoneAddress resource,
const char *  event,
int  expires 
)

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. Unlike linphone_core_subscribe() the subscription isn't sent immediately. It will be send when calling linphone_event_send_subscribe().

Parameters
corethe LinphoneCore
resourcethe destination resource
eventthe event name
expiresthe whished duration of the subscription
Returns
a LinphoneEvent holding the context of the created subcription.

◆ linphone_core_create_subscribe_2()

LinphoneEvent* linphone_core_create_subscribe_2 ( LinphoneCore core,
LinphoneAddress resource,
LinphoneProxyConfig proxy,
const char *  event,
int  expires 
)

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. Unlike linphone_core_subscribe() the subscription isn't sent immediately. It will be send when calling linphone_event_send_subscribe().

Parameters
corethe LinphoneCore
resourcethe destination resource
proxythe proxy configuration to use
eventthe event name
expiresthe whished duration of the subscription
Returns
a LinphoneEvent holding the context of the created subcription.

◆ linphone_core_publish()

LinphoneEvent* linphone_core_publish ( LinphoneCore core,
LinphoneAddress resource,
const char *  event,
int  expires,
const LinphoneContent body 
)

Publish an event state.

This first create a LinphoneEvent with linphone_core_create_publish() and calls linphone_event_send_publish() to actually send it. After expiry, the publication is refreshed unless it is terminated before.

Parameters
corethe LinphoneCore
resourcethe resource uri for the event
eventthe event name
expiresthe lifetime of event being published, -1 if no associated duration, in which case it will not be refreshed.
bodythe actual published data
Returns
the LinphoneEvent holding the context of the publish.

◆ linphone_core_subscribe()

LinphoneEvent* linphone_core_subscribe ( LinphoneCore core,
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
corethe 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_event_accept_publish()

LinphoneStatus linphone_event_accept_publish ( LinphoneEvent linphone_event)

Accept an incoming publish.

Parameters
linphone_eventLinphoneEvent object.
Returns
0 if successful, error code otherwise

◆ linphone_event_accept_subscription()

LinphoneStatus linphone_event_accept_subscription ( LinphoneEvent linphone_event)

Accept an incoming subcription.

Parameters
linphone_eventLinphoneEvent object.
Returns
0 if successful, error code otherwise

◆ linphone_event_add_callbacks()

void linphone_event_add_callbacks ( LinphoneEvent linphone_event,
LinphoneEventCbs cbs 
)

Adds a LinphoneEventCbs object to be associated with a LinphoneEvent.

Parameters
linphone_eventLinphoneEvent object
cbsThe LinphoneEventCbs object to add

◆ linphone_event_add_custom_header()

void linphone_event_add_custom_header ( LinphoneEvent linphone_event,
const char *  name,
const char *  value 
)

Add a custom header to an outgoing susbscription or publish.

Parameters
linphone_eventthe LinphoneEvent
nameheader's name
valuethe header's value.

◆ linphone_event_deny_publish()

LinphoneStatus linphone_event_deny_publish ( LinphoneEvent linphone_event,
LinphoneReason  reason 
)

Deny an incoming publish with given reason.

Parameters
linphone_eventLinphoneEvent object.
Returns
0 if successful, error code otherwise

◆ linphone_event_deny_subscription()

LinphoneStatus linphone_event_deny_subscription ( LinphoneEvent linphone_event,
LinphoneReason  reason 
)

Deny an incoming subscription with given reason.

Parameters
linphone_eventLinphoneEvent object.
Returns
0 if successful, error code otherwise

◆ linphone_event_get_core()

LinphoneCore* linphone_event_get_core ( const LinphoneEvent linphone_event)

Returns back pointer to the LinphoneCore that created this LinphoneEvent.

Parameters
linphone_eventLinphoneEvent object
Returns
the LinphoneCore object associated.

◆ linphone_event_get_current_callbacks()

LinphoneEventCbs* linphone_event_get_current_callbacks ( const LinphoneEvent linphone_event)

Get the current LinphoneEventCbs object associated with a LinphoneEvent.

Parameters
linphone_eventLinphoneEvent object
Returns
The current LinphoneEventCbs object associated with the LinphoneEvent.

◆ linphone_event_get_custom_header()

const char* linphone_event_get_custom_header ( LinphoneEvent linphone_event,
const char *  name 
)

Obtain the value of a given header for an incoming subscription.

Parameters
linphone_eventthe LinphoneEvent
nameheader's name
Returns
the header's value or NULL if such header doesn't exist.

◆ linphone_event_get_error_info()

const LinphoneErrorInfo* linphone_event_get_error_info ( const LinphoneEvent linphone_event)

Get full details about an error occured.

Parameters
linphone_eventLinphoneEvent object.
Returns
a LinphoneErrorInfo object.

◆ linphone_event_get_from()

const LinphoneAddress* linphone_event_get_from ( const LinphoneEvent linphone_event)

Get the "from" address of the subscription.

Parameters
linphone_eventLinphoneEvent object
Returns
the from LinphoneAddress.

◆ linphone_event_get_name()

const char* linphone_event_get_name ( const LinphoneEvent linphone_event)

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

Parameters
linphone_eventLinphoneEvent object
Returns
the event name.

◆ linphone_event_get_publish_state()

LinphonePublishState linphone_event_get_publish_state ( const LinphoneEvent linphone_event)

Get publish state.

If the event object was not created by a publish mechanism, LinphonePublishNone is returned.

Parameters
linphone_eventLinphoneEvent object.
Returns
the current LinphonePublishState

◆ linphone_event_get_reason()

LinphoneReason linphone_event_get_reason ( const LinphoneEvent linphone_event)

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

Parameters
linphone_eventLinphoneEvent object.
Returns
a LinphoneReason enum

◆ linphone_event_get_remote_contact()

const LinphoneAddress* linphone_event_get_remote_contact ( const LinphoneEvent linphone_event)

Get the "contact" address of the subscription.

Parameters
linphone_eventLinphoneEvent object
Returns
The "contact" address of the subscription

◆ linphone_event_get_resource()

const LinphoneAddress* linphone_event_get_resource ( const LinphoneEvent linphone_event)

Get the resource address of the subscription or publish.

Parameters
linphone_eventLinphoneEvent object
Returns
the resource LinphoneAddress.

◆ linphone_event_get_subscription_dir()

LinphoneSubscriptionDir linphone_event_get_subscription_dir ( LinphoneEvent linphone_event)

Get subscription direction.

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

Parameters
linphone_eventLinphoneEvent object.
Returns
the LinphoneSubscriptionDir

◆ linphone_event_get_subscription_state()

LinphoneSubscriptionState linphone_event_get_subscription_state ( const LinphoneEvent linphone_event)

Get subscription state.

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

Parameters
linphone_eventLinphoneEvent object.
Returns
the current LinphoneSubscriptionState

◆ linphone_event_get_to()

const LinphoneAddress* linphone_event_get_to ( const LinphoneEvent lev)

Get the "to" address of the subscription.

Parameters
linphone_eventLinphoneEvent object
Returns
the "to" LinphoneAddress.

◆ linphone_event_get_user_data()

void* linphone_event_get_user_data ( const LinphoneEvent linphone_event)

Retrieve user pointer.

Parameters
linphone_eventLinphoneEvent object.
Returns
the user_data pointer or NULL.

◆ linphone_event_notify()

LinphoneStatus linphone_event_notify ( LinphoneEvent linphone_event,
const LinphoneContent body 
)

Send a notification.

Parameters
linphone_eventa 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_event_pause_publish()

void linphone_event_pause_publish ( LinphoneEvent linphone_event)

Prevent an event from refreshing its publish.

This is useful to let registrations to expire naturally (or) when the application wants to keep control on when refreshes are sent. The refreshing operations can be resumed with linphone_proxy_config_refresh_register().

Parameters
linphone_eventLinphoneEvent object.

◆ linphone_event_ref()

LinphoneEvent* linphone_event_ref ( LinphoneEvent linphone_event)

Increase reference count of LinphoneEvent.

A LinphoneEvent created by the core when receiving an incoming SUBSCRIBE or PUBLISH are owned by the core only. An application that wishes to retain a reference to it must call linphone_event_ref(). When this reference is no longer needed, linphone_event_unref() must be called.

Parameters
linphone_eventLinphoneEvent object
Returns
the same LinphoneEvent object.

◆ linphone_event_refresh_publish()

LinphoneStatus linphone_event_refresh_publish ( LinphoneEvent linphone_event)

Refresh an outgoing publish keeping the same body.

Parameters
linphone_eventLinphoneEvent object.
Returns
0 if successful, -1 otherwise.

◆ linphone_event_refresh_subscribe()

LinphoneStatus linphone_event_refresh_subscribe ( LinphoneEvent linphone_event)

Refresh an outgoing subscription keeping the same body.

Parameters
linphone_eventLinphoneEvent object.
Returns
0 if successful, -1 otherwise.

◆ linphone_event_remove_callbacks()

void linphone_event_remove_callbacks ( LinphoneEvent linphone_event,
LinphoneEventCbs cbs 
)

Removes a LinphoneEventCbs object associated with a LinphoneEvent.

Parameters
linphone_eventLinphoneEvent object
cbsThe LinphoneEventCbs object to remove

◆ linphone_event_remove_custom_header()

void linphone_event_remove_custom_header ( LinphoneEvent ev,
const char *  name 
)

Remove custom header to an outgoing susbscription or publish.

Parameters
evthe LinphoneEvent
nameheader's name

◆ linphone_event_send_publish()

LinphoneStatus linphone_event_send_publish ( LinphoneEvent linphone_event,
const LinphoneContent body 
)

Send a publish created by linphone_core_create_publish().

Parameters
linphone_eventthe LinphoneEvent
bodythe new data to be published
Returns
0 if successful, -1 otherwise.

◆ linphone_event_send_subscribe()

LinphoneStatus linphone_event_send_subscribe ( LinphoneEvent linphone_event,
const LinphoneContent body 
)

Send a subscription previously created by linphone_core_create_subscribe().

Parameters
linphone_eventthe LinphoneEvent
bodyoptional content to attach with the subscription.
Returns
0 if successful, -1 otherwise.

◆ linphone_event_set_user_data()

void linphone_event_set_user_data ( LinphoneEvent linphone_event,
void *  user_data 
)

Set a user (application) pointer.

Parameters
linphone_eventLinphoneEvent object.
user_dataThe user data to set.

◆ linphone_event_terminate()

void linphone_event_terminate ( LinphoneEvent linphone_event)

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

The LinphoneEvent shall not be used anymore after this operation.

Parameters
linphone_eventLinphoneEvent object

◆ linphone_event_unref()

void linphone_event_unref ( LinphoneEvent linphone_event)

Decrease reference count.

Parameters
linphone_eventLinphoneEvent object
See also
linphone_event_ref()

◆ linphone_event_update_publish()

LinphoneStatus linphone_event_update_publish ( LinphoneEvent linphone_event,
const LinphoneContent body 
)

Update (refresh) a publish.

Parameters
linphone_eventthe LinphoneEvent
bodythe new data to be published
Returns
0 if successful, error code otherwise

◆ linphone_event_update_subscribe()

LinphoneStatus linphone_event_update_subscribe ( LinphoneEvent linphone_event,
const LinphoneContent body 
)

Update (refresh) an outgoing subscription, changing the body.

Parameters
linphone_eventa LinphoneEvent
bodyan optional body to include in the subscription update, may be NULL.
Returns
0 if successful, error code otherwise