Liblinphone: linphone::Event Class Reference

Liblinphone 5.0.0

Public Member Functions | List of all members
linphone::Event Class Reference

Object representing an event state, which is subcribed or published. More...

`#include <event.hh>`

Inheritance diagram for linphone::Event:

## Public Member Functions
| Event (void *ptr, bool takeRef=true)
LINPHONECXX_PUBLIC _LinphoneEvent * | cPtr ()
LINPHONECXX_PUBLIC void | addListener (const std::shared_ptr< EventListener > &listener)
LINPHONECXX_PUBLIC void | removeListener (const std::shared_ptr< EventListener > &listener)
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Core > | getCore () const
| Returns back pointer to the Core that created this Event. More...
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ErrorInfo > | getErrorInfo () const
| Get full details about an error occured. More...
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getFrom () const
| Get the "from" address of the subscription. More...
LINPHONECXX_PUBLIC std::string | getName () const
| Get the name of the event as specified in the event package RFC. More...
LINPHONECXX_PUBLIC linphone::PublishState | getPublishState () const
| Get publish state. More...
LINPHONECXX_PUBLIC linphone::Reason | getReason () const
| Return reason code (in case of error state reached). More...
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getRemoteContact () const
| Get the "contact" address of the subscription. More...
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getResource () const
| Get the resource address of the subscription or publish. More...
LINPHONECXX_PUBLIC linphone::SubscriptionDir | getSubscriptionDir ()
| Get subscription direction. More...
LINPHONECXX_PUBLIC linphone::SubscriptionState | getSubscriptionState () const
| Get subscription state. More...
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getTo () const
| Get the "to" address of the subscription. More...
LINPHONECXX_PUBLIC linphone::Status | acceptSubscription ()
| Accept an incoming subcription. More...
LINPHONECXX_PUBLIC void | addCustomHeader (const std::string &name, const std::string &value)
| Add a custom header to an outgoing susbscription or publish. More...
LINPHONECXX_PUBLIC linphone::Status | denySubscription (linphone::Reason reason)
| Deny an incoming subscription with given reason. More...
LINPHONECXX_PUBLIC std::string | getCustomHeader (const std::string &name)
| Obtain the value of a given header for an incoming subscription. More...
LINPHONECXX_PUBLIC linphone::Status | notify (const std::shared_ptr< const linphone::Content > &body)
| Send a notification. More...
LINPHONECXX_PUBLIC void | pausePublish ()
| Prevent an event from refreshing its publish. More...
LINPHONECXX_PUBLIC linphone::Status | refreshPublish ()
| Refresh an outgoing publish keeping the same body. More...
LINPHONECXX_PUBLIC linphone::Status | refreshSubscribe ()
| Refresh an outgoing subscription keeping the same body. More...
LINPHONECXX_PUBLIC void | removeCustomHeader (const std::string &name)
| Remove custom header to an outgoing susbscription or publish. More...
LINPHONECXX_PUBLIC linphone::Status | sendPublish (const std::shared_ptr< const linphone::Content > &body)
| Send a publish created by Core::createPublish(). More...
LINPHONECXX_PUBLIC linphone::Status | sendSubscribe (const std::shared_ptr< const linphone::Content > &body)
| Send a subscription previously created by Core::createSubscribe(). More...
LINPHONECXX_PUBLIC void | terminate ()
| Terminate an incoming or outgoing subscription that was previously acccepted, or a previous publication. More...
LINPHONECXX_PUBLIC linphone::Status | updatePublish (const std::shared_ptr< const linphone::Content > &body)
| Update (refresh) a publish. More...
LINPHONECXX_PUBLIC linphone::Status | updateSubscribe (const std::shared_ptr< const linphone::Content > &body)
| Update (refresh) an outgoing subscription, changing the body. More...

## Detailed Description

Object representing an event state, which is subcribed or published.

See also
  Core::publish()
  Core::subscribe()

## Member Function Documentation

## ◆ acceptSubscription()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::acceptSubscription | ( |  | ) |

Accept an incoming subcription.

Returns
  0 if successful, error code otherwise

## ◆ addCustomHeader()

LINPHONECXX_PUBLIC void linphone::Event::addCustomHeader | ( | const std::string & | name,
|  | const std::string & | value
| ) |  |

Add a custom header to an outgoing susbscription or publish.

Parameters

  value | the header's value.

## ◆ denySubscription()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::denySubscription | ( | linphone::Reason | reason | ) |

Deny an incoming subscription with given reason.

Returns
  0 if successful, error code otherwise

## ◆ getCore()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::Event::getCore | ( |  | ) | const

Returns back pointer to the Core that created this Event.

Returns
  the Core object associated.

## ◆ getCustomHeader()

LINPHONECXX_PUBLIC std::string linphone::Event::getCustomHeader | ( | const std::string & | name | ) |

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

Parameters

  name | header's name

Returns
  the header's value or nullptr if such header doesn't exist.

## ◆ getErrorInfo()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::ErrorInfo> linphone::Event::getErrorInfo | ( |  | ) | const

Get full details about an error occured.

Returns
  a ErrorInfo object.

## ◆ getFrom()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::Event::getFrom | ( |  | ) | const

Get the "from" address of the subscription.

Returns
  the from Address.

## ◆ getName()

LINPHONECXX_PUBLIC std::string linphone::Event::getName | ( |  | ) | const

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

Returns
  the event name.

## ◆ getPublishState()

LINPHONECXX_PUBLIC linphone::PublishState linphone::Event::getPublishState | ( |  | ) | const

Get publish state.

If the event object was not created by a publish mechanism, PublishState::None is returned.

Returns
  the current PublishState

## ◆ getReason()

LINPHONECXX_PUBLIC linphone::Reason linphone::Event::getReason | ( |  | ) | const

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

Returns
  a Reason enum

## ◆ getRemoteContact()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::Event::getRemoteContact | ( |  | ) | const

Get the "contact" address of the subscription.

Returns
  The "contact" address of the subscription

## ◆ getResource()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::Event::getResource | ( |  | ) | const

Get the resource address of the subscription or publish.

Returns
  the resource Address.

## ◆ getSubscriptionDir()

LINPHONECXX_PUBLIC linphone::SubscriptionDir linphone::Event::getSubscriptionDir | ( |  | ) |

Get subscription direction.

If the object wasn't created by a subscription mechanism, SubscriptionDir::InvalidDir is returned.

Returns
  the SubscriptionDir

## ◆ getSubscriptionState()

LINPHONECXX_PUBLIC linphone::SubscriptionState linphone::Event::getSubscriptionState | ( |  | ) | const

Get subscription state.

If the event object was not created by a subscription mechanism, SubscriptionState::None is returned.

Returns
  the current SubscriptionState

## ◆ getTo()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::Event::getTo | ( |  | ) | const

Get the "to" address of the subscription.

Returns
  the "to" Address.

## ◆ notify()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::notify | ( | const std::shared_ptr< const linphone::Content > & | body | ) |

Send a notification.

Parameters

  body | an optional body containing the actual notification data.

Returns
  0 if successful, -1 otherwise.

## ◆ pausePublish()

LINPHONECXX_PUBLIC void linphone::Event::pausePublish | ( |  | ) |

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 ProxyConfig::refreshRegister().

## ◆ refreshPublish()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::refreshPublish | ( |  | ) |

Refresh an outgoing publish keeping the same body.

Returns
  0 if successful, -1 otherwise.

## ◆ refreshSubscribe()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::refreshSubscribe | ( |  | ) |

Refresh an outgoing subscription keeping the same body.

Returns
  0 if successful, -1 otherwise.

## ◆ removeCustomHeader()

LINPHONECXX_PUBLIC void linphone::Event::removeCustomHeader | ( | const std::string & | name | ) |

Remove custom header to an outgoing susbscription or publish.

Parameters

  name | header's name

## ◆ sendPublish()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::sendPublish | ( | const std::shared_ptr< const linphone::Content > & | body | ) |

Send a publish created by Core::createPublish().

Parameters

  body | the new data to be published

Returns
  0 if successful, -1 otherwise.

## ◆ sendSubscribe()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::sendSubscribe | ( | const std::shared_ptr< const linphone::Content > & | body | ) |

Send a subscription previously created by Core::createSubscribe().

Parameters

  body | optional content to attach with the subscription.

Returns
  0 if successful, -1 otherwise.

## ◆ terminate()

LINPHONECXX_PUBLIC void linphone::Event::terminate | ( |  | ) |

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

The Event shall not be used anymore after this operation.

## ◆ updatePublish()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::updatePublish | ( | const std::shared_ptr< const linphone::Content > & | body | ) |

Update (refresh) a publish.

Parameters

  body | the new data to be published

Returns
  0 if successful, error code otherwise

## ◆ updateSubscribe()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::updateSubscribe | ( | const std::shared_ptr< const linphone::Content > & | body | ) |

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

Parameters

  body | an optional body to include in the subscription update, may be nullptr.

Returns
  0 if successful, error code otherwise

The documentation for this class was generated from the following file:

- event.hh