Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::SIPPresence Class Reference

#include <sippresence.h>

Collaboration diagram for jami::SIPPresence:
Collaboration graph

Public Member Functions

void addPresSubClient (PresSubClient *b)
 Add a buddy in the buddy list.
 
void addPresSubServer (PresSubServer *s)
 IP2IP context.
 
void approvePresSubServer (const std::string &uri, bool flag)
 IP2IP context.
 
void enable (bool enabled)
 Activate the module.
 
void fillDoc (pjsip_tx_data *tdata, const pres_msg_data *msg_data)
 Fill xml document, the header and the body.
 
SIPAccountgetAccount () const
 Return associated sipaccount.
 
const std::list< PresSubClient * > & getClientSubscriptions () const
 
int getModId () const
 Return presence module ID which is actually the same as the VOIP link.
 
std::string getNote ()
 
pj_pool_tgetPool () const
 Return a pool for generic functions.
 
pjsip_pres_statusgetStatus ()
 Return presence data.
 
bool isEnabled ()
 
bool isOnline ()
 
bool isSupported (int function)
 
void lock ()
 
void notifyPresSubServer ()
 IP2IP context.
 
void removePresSubClient (PresSubClient *b)
 Remove a buddy from the list.
 
void removePresSubServer (PresSubServer *s)
 IP2IP context.
 
void reportPresSubClientNotification (std::string_view uri, pjsip_pres_status *status)
 Send a signal to the client on DBus.
 
void sendPresence (bool status, const std::string &note)
 Send the presence data in a PUBLISH to the PBX or in a NOTIFY to a remote subscriber (IP2IP)
 
 SIPPresence (SIPAccount *acc)
 Constructor.
 
void subscribeClient (const std::string &uri, bool flag)
 Send a SUBSCRIBE request to PBX/IP2IP.
 
void support (int function, bool enabled)
 Support the presence function publish/subscribe.
 
bool tryLock ()
 
void unlock ()
 
void updateStatus (bool status, const std::string &note)
 Modify the presence data.
 
 ~SIPPresence ()
 Destructor.
 

Detailed Description

Definition at line 88 of file sippresence.h.

Constructor & Destructor Documentation

◆ SIPPresence()

jami::SIPPresence::SIPPresence ( SIPAccount acc)

Constructor.

Parameters
accthe associated sipaccount

Definition at line 43 of file sippresence.cpp.

References jami::emitSignal(), and updateStatus().

Here is the call graph for this function:

◆ ~SIPPresence()

jami::SIPPresence::~SIPPresence ( )

Destructor.

Definition at line 67 of file sippresence.cpp.

References jami::emitSignal().

Here is the call graph for this function:

Member Function Documentation

◆ addPresSubClient()

void jami::SIPPresence::addPresSubClient ( PresSubClient b)

Add a buddy in the buddy list.

Parameters
bPresSubClient pointer

Definition at line 243 of file sippresence.cpp.

References JAMI_DBG, JAMI_WARN, and MAX_N_SUB_CLIENT.

Referenced by jami::PresSubClient::enable().

◆ addPresSubServer()

void jami::SIPPresence::addPresSubServer ( PresSubServer s)

IP2IP context.

Add a server associated to a subscriber in the list.

Parameters
sPresenceSubcription pointer.

Definition at line 273 of file sippresence.cpp.

References JAMI_WARN, and MAX_N_SUB_SERVER.

◆ approvePresSubServer()

void jami::SIPPresence::approvePresSubServer ( const std::string &  uri,
bool  flag 
)

IP2IP context.

Process new subscription based on client decision.

Parameters
flagclient decision.
uriuri of the remote subscriber

Definition at line 262 of file sippresence.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ enable()

void jami::SIPPresence::enable ( bool  enabled)

Activate the module.

Parameters
enableFlag

Definition at line 106 of file sippresence.cpp.

◆ fillDoc()

void jami::SIPPresence::fillDoc ( pjsip_tx_data tdata,
const pres_msg_data msg_data 
)

Fill xml document, the header and the body.

Definition at line 318 of file sippresence.cpp.

References jami::emitSignal(), jami::Account::getUserAgentName(), and JAMI_DBG.

Referenced by jami::PresSubServer::notify(), and jami::PresSubClient::unsubscribe().

Here is the call graph for this function:

◆ getAccount()

SIPAccount * jami::SIPPresence::getAccount ( ) const

Return associated sipaccount.

Definition at line 82 of file sippresence.cpp.

Referenced by jami::PresSubClient::PresSubClient(), and jami::PresSubClient::subscribe().

◆ getClientSubscriptions()

const std::list< PresSubClient * > & jami::SIPPresence::getClientSubscriptions ( ) const
inline

Definition at line 192 of file sippresence.h.

◆ getModId()

int jami::SIPPresence::getModId ( ) const

Return presence module ID which is actually the same as the VOIP link.

Definition at line 94 of file sippresence.cpp.

References jami::SIPVoIPLink::getModId(), jami::Manager::instance(), and jami::Manager::sipVoIPLink().

Here is the call graph for this function:

◆ getNote()

std::string jami::SIPPresence::getNote ( )
inline

Definition at line 196 of file sippresence.h.

◆ getPool()

pj_pool_t * jami::SIPPresence::getPool ( ) const

Return a pool for generic functions.

Definition at line 100 of file sippresence.cpp.

Referenced by jami::PresSubClient::subscribe().

◆ getStatus()

pjsip_pres_status * jami::SIPPresence::getStatus ( )

Return presence data.

Definition at line 88 of file sippresence.cpp.

Referenced by jami::PresSubServer::approve(), and jami::PresSubServer::notify().

◆ isEnabled()

bool jami::SIPPresence::isEnabled ( )
inline

Definition at line 188 of file sippresence.h.

◆ isOnline()

bool jami::SIPPresence::isOnline ( )
inline

Definition at line 194 of file sippresence.h.

◆ isSupported()

bool jami::SIPPresence::isSupported ( int  function)

Definition at line 121 of file sippresence.cpp.

References jami::emitSignal(), PRESENCE_FUNCTION_PUBLISH, and PRESENCE_FUNCTION_SUBSCRIBE.

Here is the call graph for this function:

◆ lock()

void jami::SIPPresence::lock ( )

Definition at line 300 of file sippresence.cpp.

◆ notifyPresSubServer()

void jami::SIPPresence::notifyPresSubServer ( )

IP2IP context.

Iterate through the subscriber list and send NOTIFY to each.

Definition at line 291 of file sippresence.cpp.

References JAMI_DBG.

Referenced by sendPresence().

◆ removePresSubClient()

void jami::SIPPresence::removePresSubClient ( PresSubClient b)

Remove a buddy from the list.

Parameters
bPresSubClient pointer

Definition at line 255 of file sippresence.cpp.

References JAMI_DBG.

◆ removePresSubServer()

void jami::SIPPresence::removePresSubServer ( PresSubServer s)

IP2IP context.

Remove a server associated to a subscriber from the list.

Parameters
sPresenceSubcription pointer.

Definition at line 284 of file sippresence.cpp.

References JAMI_DBG.

◆ reportPresSubClientNotification()

void jami::SIPPresence::reportPresSubClientNotification ( std::string_view  uri,
pjsip_pres_status status 
)

Send a signal to the client on DBus.

The signal contain the status of a remote user.

Definition at line 179 of file sippresence.cpp.

References jami::emitSignal(), jami::Account::getAccountID(), jami::SIPAccount::getFromUri(), and JAMI_DBG.

Here is the call graph for this function:

◆ sendPresence()

void jami::SIPPresence::sendPresence ( bool  status,
const std::string &  note 
)

Send the presence data in a PUBLISH to the PBX or in a NOTIFY to a remote subscriber (IP2IP)

Definition at line 165 of file sippresence.cpp.

References jami::emitSignal(), jami::SIPAccount::isIP2IP(), notifyPresSubServer(), and updateStatus().

Here is the call graph for this function:

◆ subscribeClient()

void jami::SIPPresence::subscribeClient ( const std::string &  uri,
bool  flag 
)

Send a SUBSCRIBE request to PBX/IP2IP.

Parameters
buddyUriRemote user that we want to subscribe

Definition at line 203 of file sippresence.cpp.

References jami::emitSignal(), JAMI_WARN, MAX_N_SUB_CLIENT, and jami::PresSubClient::subscribe().

Here is the call graph for this function:

◆ support()

void jami::SIPPresence::support ( int  function,
bool  enabled 
)

Support the presence function publish/subscribe.

Parameters
functionPublish or subscribe to enable
enableFlag

Definition at line 112 of file sippresence.cpp.

References jami::emitSignal(), PRESENCE_FUNCTION_PUBLISH, and PRESENCE_FUNCTION_SUBSCRIBE.

Here is the call graph for this function:

◆ tryLock()

bool jami::SIPPresence::tryLock ( )

Definition at line 306 of file sippresence.cpp.

Referenced by jami::PresSubClient::lock().

◆ unlock()

void jami::SIPPresence::unlock ( )

Definition at line 312 of file sippresence.cpp.

Referenced by jami::PresSubClient::lock(), and jami::PresSubClient::unlock().

◆ updateStatus()

void jami::SIPPresence::updateStatus ( bool  status,
const std::string &  note 
)

Modify the presence data.

Parameters
statusis basically "open" or "close"

Definition at line 132 of file sippresence.cpp.

References jami::emitSignal().

Referenced by sendPresence(), and SIPPresence().

Here is the call graph for this function:

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