Liblinphone  5.3.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

LINPHONECXX_PUBLIC Event (void *ptr, bool takeRef=true)
 
LINPHONECXX_PUBLIC _LinphoneEvent * cPtr ()
 
LINPHONECXX_PUBLIC void addListener (const std::shared_ptr< EventListener > &listener)
 Add an application listener to the Event instance. More...
 
LINPHONECXX_PUBLIC void removeListener (const std::shared_ptr< EventListener > &listener)
 Remove a previously added listener from the Event instance. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::CoregetCore () const
 Returns back pointer to the Core that created this Event. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ErrorInfogetErrorInfo () const
 Get full details about an error occured. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AddressgetFrom () 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::AddressgetRemoteContact () const
 Get the "contact" address of the subscription. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AddressgetResource () 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::AddressgetTo () const
 Get the "to" address of the subscription. More...
 
LINPHONECXX_PUBLIC linphone::Status acceptPublish ()
 Accept an incoming publish. 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 denyPublish (linphone::Reason reason)
 Deny an incoming publish with given reason. 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

◆ acceptPublish()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::acceptPublish ( )

Accept an incoming publish.

Returns
0 if successful, error code otherwise

◆ 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
nameheader's name
valuethe header's value.

◆ addListener()

LINPHONECXX_PUBLIC void linphone::Event::addListener ( const std::shared_ptr< EventListener > &  listener)

Add an application listener to the Event instance.

Parameters
listenerthe application listener

◆ denyPublish()

LINPHONECXX_PUBLIC linphone::Status linphone::Event::denyPublish ( linphone::Reason  reason)

Deny an incoming publish with given reason.

Returns
0 if successful, error code otherwise

◆ 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
nameheader'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
bodyan 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
nameheader's name

◆ removeListener()

LINPHONECXX_PUBLIC void linphone::Event::removeListener ( const std::shared_ptr< EventListener > &  listener)

Remove a previously added listener from the Event instance.

Parameters
listenerthe application listener

◆ sendPublish()

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

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

Parameters
bodythe 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
bodyoptional 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
bodythe 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
bodyan 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: