Ring Daemon 16.0.0
|
#include <sippresence.h>
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. | |
SIPAccount * | getAccount () 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_t * | getPool () const |
Return a pool for generic functions. | |
pjsip_pres_status * | getStatus () |
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 ¬e) |
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 ¬e) |
Modify the presence data. | |
~SIPPresence () | |
Destructor. | |
Definition at line 88 of file sippresence.h.
jami::SIPPresence::SIPPresence | ( | SIPAccount * | acc | ) |
Constructor.
acc | the associated sipaccount |
Definition at line 43 of file sippresence.cpp.
References jami::emitSignal(), and updateStatus().
jami::SIPPresence::~SIPPresence | ( | ) |
Destructor.
Definition at line 67 of file sippresence.cpp.
References jami::emitSignal().
void jami::SIPPresence::addPresSubClient | ( | PresSubClient * | b | ) |
Add a buddy in the buddy list.
b | PresSubClient pointer |
Definition at line 243 of file sippresence.cpp.
References JAMI_DBG, JAMI_WARN, and MAX_N_SUB_CLIENT.
Referenced by jami::PresSubClient::enable().
void jami::SIPPresence::addPresSubServer | ( | PresSubServer * | s | ) |
IP2IP context.
Add a server associated to a subscriber in the list.
s | PresenceSubcription pointer. |
Definition at line 273 of file sippresence.cpp.
References JAMI_WARN, and MAX_N_SUB_SERVER.
IP2IP context.
Process new subscription based on client decision.
flag | client decision. |
uri | uri of the remote subscriber |
Definition at line 262 of file sippresence.cpp.
References jami::emitSignal().
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().
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().
|
inline |
Definition at line 192 of file sippresence.h.
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().
|
inline |
Definition at line 196 of file sippresence.h.
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().
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().
|
inline |
Definition at line 188 of file sippresence.h.
|
inline |
Definition at line 194 of file sippresence.h.
Definition at line 121 of file sippresence.cpp.
References jami::emitSignal(), PRESENCE_FUNCTION_PUBLISH, and PRESENCE_FUNCTION_SUBSCRIBE.
void jami::SIPPresence::lock | ( | ) |
Definition at line 300 of file sippresence.cpp.
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().
void jami::SIPPresence::removePresSubClient | ( | PresSubClient * | b | ) |
Remove a buddy from the list.
b | PresSubClient pointer |
Definition at line 255 of file sippresence.cpp.
References JAMI_DBG.
void jami::SIPPresence::removePresSubServer | ( | PresSubServer * | s | ) |
IP2IP context.
Remove a server associated to a subscriber from the list.
s | PresenceSubcription pointer. |
Definition at line 284 of file sippresence.cpp.
References JAMI_DBG.
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.
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().
Send a SUBSCRIBE request to PBX/IP2IP.
buddyUri | Remote 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().
Support the presence function publish/subscribe.
function | Publish or subscribe to enable |
enable | Flag |
Definition at line 112 of file sippresence.cpp.
References jami::emitSignal(), PRESENCE_FUNCTION_PUBLISH, and PRESENCE_FUNCTION_SUBSCRIBE.
bool jami::SIPPresence::tryLock | ( | ) |
Definition at line 306 of file sippresence.cpp.
Referenced by jami::PresSubClient::lock().
void jami::SIPPresence::unlock | ( | ) |
Definition at line 312 of file sippresence.cpp.
Referenced by jami::PresSubClient::lock(), and jami::PresSubClient::unlock().
Modify the presence data.
status | is basically "open" or "close" |
Definition at line 132 of file sippresence.cpp.
References jami::emitSignal().
Referenced by sendPresence(), and SIPPresence().