Liblinphone: Event api

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.
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.
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.
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.
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.
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.
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.
typedef void(* | LinphoneCoreCbsPushNotificationReceivedCb) (LinphoneCore *core, const char *payload)
| Callback prototype for notifying the application a push notification was received.
typedef void(* | LinphoneCoreCbsPreviewDisplayErrorOccurredCb) (LinphoneCore *core, int error_code)
| Callback to notify that there are errors from the video rendering.
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.
typedef void(* | LinphoneEventCbsNotifyResponseCb) (LinphoneEvent *linphone_event)
| Callback used to notify the response to a sent NOTIFY.

## 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
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.
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.
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.
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.
LinphoneEvent * | linphone_core_publish (LinphoneCore *core, LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body)
| Publish an event state.
LinphoneEvent * | linphone_core_create_publish (LinphoneCore *core, LinphoneAddress *resource, const char *event, int expires)
| Create a publish context for an event state.
LinphoneEvent * | linphone_core_create_one_shot_publish (LinphoneCore *core, LinphoneAddress *resource, const char *event)
| Create a publish context for a one-shot publish.
LinphoneStatus | linphone_event_send_subscribe (LinphoneEvent *linphone_event, const LinphoneContent *body)
| Send a subscription previously created by linphone_core_create_subscribe().
LinphoneStatus | linphone_event_update_subscribe (LinphoneEvent *linphone_event, const LinphoneContent *body)
| Update (refresh) an outgoing subscription, changing the body.
LinphoneStatus | linphone_event_refresh_subscribe (LinphoneEvent *linphone_event)
| Refresh an outgoing subscription keeping the same body.
LinphoneStatus | linphone_event_accept_subscription (LinphoneEvent *linphone_event)
| Accept an incoming subcription.
LinphoneStatus | linphone_event_deny_subscription (LinphoneEvent *linphone_event, LinphoneReason reason)
| Deny an incoming subscription with given reason.
LinphoneStatus | linphone_event_notify (LinphoneEvent *linphone_event, const LinphoneContent *body)
| Send a notification.
LinphoneStatus | linphone_event_send_publish (LinphoneEvent *linphone_event, const LinphoneContent *body)
| Send a publish created by linphone_core_create_publish().
LinphoneStatus | linphone_event_update_publish (LinphoneEvent *linphone_event, const LinphoneContent *body)
| Update (refresh) a publish.
LinphoneStatus | linphone_event_refresh_publish (LinphoneEvent *linphone_event)
| Refresh an outgoing publish keeping the same body.
LinphoneStatus | linphone_event_accept_publish (LinphoneEvent *linphone_event)
| Accept an incoming publish.
LinphoneStatus | linphone_event_deny_publish (LinphoneEvent *linphone_event, LinphoneReason reason)
| Deny an incoming publish with given reason.
void | linphone_event_pause_publish (LinphoneEvent *linphone_event)
| Prevent an event from refreshing its publish.
LinphoneReason | linphone_event_get_reason (const LinphoneEvent *linphone_event)
| Return reason code (in case of error state reached).
const LinphoneErrorInfo * | linphone_event_get_error_info (const LinphoneEvent *linphone_event)
| Get full details about an error occured.
LinphoneSubscriptionState | linphone_event_get_subscription_state (const LinphoneEvent *linphone_event)
| Get subscription state.
LinphonePublishState | linphone_event_get_publish_state (const LinphoneEvent *linphone_event)
| Get publish state.
LinphoneSubscriptionDir | linphone_event_get_subscription_dir (LinphoneEvent *linphone_event)
| Get subscription direction.
void | linphone_event_set_user_data (LinphoneEvent *linphone_event, void *user_data)
| Set a user (application) pointer.
void * | linphone_event_get_user_data (const LinphoneEvent *linphone_event)
| Retrieve user pointer.
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.
void | linphone_event_remove_custom_header (LinphoneEvent *ev, const char *name)
| Remove custom header to an outgoing susbscription or publish.
const char * | linphone_event_get_custom_header (LinphoneEvent *linphone_event, const char *name)
| Obtain the value of a given header for an incoming subscription.
void | linphone_event_terminate (LinphoneEvent *linphone_event)
| Terminate an incoming or outgoing subscription that was previously acccepted, or a previous publication.
LinphoneEvent * | linphone_event_ref (LinphoneEvent *linphone_event)
| Increase reference count of LinphoneEvent.
void | linphone_event_unref (LinphoneEvent *linphone_event)
| Decrease reference count.
const char * | linphone_event_get_name (const LinphoneEvent *linphone_event)
| Get the name of the event as specified in the event package RFC.
const LinphoneAddress * | linphone_event_get_from (const LinphoneEvent *linphone_event)
| Get the "from" address of the subscription.
const LinphoneAddress * | linphone_event_get_to (const LinphoneEvent *linphone_event)
| Get the "to" address of the subscription.
const LinphoneAddress * | linphone_event_get_resource (const LinphoneEvent *linphone_event)
| Get the resource address of the subscription or publish.
const LinphoneAddress * | linphone_event_get_remote_contact (const LinphoneEvent *linphone_event)
| Get the "contact" address of the subscription.
LinphoneCore * | linphone_event_get_core (const LinphoneEvent *linphone_event)
| Returns back pointer to the LinphoneCore that created this LinphoneEvent.
void | linphone_event_add_callbacks (LinphoneEvent *linphone_event, LinphoneEventCbs *cbs)
| Adds a LinphoneEventCbs object to be associated with a LinphoneEvent.
void | linphone_event_remove_callbacks (LinphoneEvent *linphone_event, LinphoneEventCbs *cbs)
| Removes a LinphoneEventCbs object associated with a LinphoneEvent.
LinphoneEventCbs * | linphone_event_get_current_callbacks (const LinphoneEvent *linphone_event)
| Get the current LinphoneEventCbs object associated with a LinphoneEvent.

## 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

  core | LinphoneCore object
  conference_info | the 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

  core | LinphoneCore object
  linphone_event | the LinphoneEvent received
  notified_event | The event as string
  body | the 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

  core | LinphoneCore object
  linphone_event | the LinphoneEvent received
  body | the 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

  core | LinphoneCore object
  error_code | The 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

  core | LinphoneCore object
  linphone_event | the LinphoneEvent received
  publish_event | The event as string
  body | the 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

  core | LinphoneCore object
  linphone_event | the LinphoneEvent
  state | the 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

  core | LinphoneCore object
  payload | the 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

  core | LinphoneCore object
  linphone_event | the LinphoneEvent received
  subscribe_event | The event as string
  body | the 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

  core | LinphoneCore object
  linphone_event | the LinphoneEvent
  state | the new LinphoneSubscriptionState

## ◆ LinphoneEventCbsNotifyResponseCb

typedef void(* LinphoneEventCbsNotifyResponseCb) (LinphoneEvent *linphone_event)

Callback used to notify the response to a sent NOTIFY.

Parameters

  linphone_event | The LinphoneEvent object that has sent the NOTIFY and for which we received a response

## ◆ LinphoneSubscriptionState

typedef enum _LinphoneSubscriptionState LinphoneSubscriptionState

Enum for subscription states.

LinphoneSubscriptionTerminated and LinphoneSubscriptionError are final states.

## Enumeration Type Documentation

## ◆ _LinphonePublishState

enum _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 _LinphoneSubscriptionDir

Enum for subscription direction (incoming or outgoing).

Enumerator
LinphoneSubscriptionIncoming | Incoming subscription.
LinphoneSubscriptionOutgoing | Outgoing subscription.
LinphoneSubscriptionInvalidDir | Invalid subscription direction.

## ◆ _LinphoneSubscriptionState

enum _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

  core | the LinphoneCore
  resource | the destination resource
  event | the 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

  core | the LinphoneCore
  resource | the resource uri for the event
  event | the 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

  core | the LinphoneCore
  resource | the resource uri for the event
  event | the event name
  expires | the 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

  core | the LinphoneCore
  resource | the destination resource
  event | the event name
  expires | the 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

  core | the LinphoneCore
  resource | the destination resource
  proxy | the proxy configuration to use
  event | the event name
  expires | the 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

  core | the LinphoneCore
  resource | the resource uri for the event
  event | the event name
  expires | the lifetime of event being published, -1 if no associated duration, in which case it will not be refreshed.
  body | the 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

  core | the LinphoneCore
  resource | the destination resource
  event | the event name
  expires | the whished duration of the subscription
  body | an 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent object
  cbs | The 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_event | the LinphoneEvent
  name | header's name
  value | the 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_event | LinphoneEvent object.
  reason | The LinphoneReason of denial.

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_event | LinphoneEvent object.
  reason | The LinphoneReason of denial.

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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | the LinphoneEvent
  name | header'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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent object.

Returns
  the current LinphoneSubscriptionState

## ◆ linphone_event_get_to()

const LinphoneAddress * linphone_event_get_to | ( | const LinphoneEvent * | linphone_event | ) |

Get the "to" address of the subscription.

Parameters

  linphone_event | LinphoneEvent 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_event | LinphoneEvent 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_event | a LinphoneEvent corresponding to an incoming subscription previously received and accepted.
  body | an 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent 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_event | LinphoneEvent object
  cbs | The 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

  ev | the LinphoneEvent
  name | header'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_event | the LinphoneEvent
  body | the 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_event | the LinphoneEvent
  body | optional 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_event | LinphoneEvent object.
  user_data | The 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_event | LinphoneEvent object

## ◆ linphone_event_unref()

void linphone_event_unref | ( | LinphoneEvent * | linphone_event | ) |

Decrease reference count.

Parameters

  linphone_event | LinphoneEvent 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_event | the LinphoneEvent
  body | the 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_event | a LinphoneEvent
  body | an optional body to include in the subscription update, may be NULL.

Returns
  0 if successful, error code otherwise