26#include "pjsip/sip_types.h"
27#include "pjsip/sip_msg.h"
28#include "pjsip/sip_multipart.h"
29#include "pjsip-simple/publish.h"
30#include "pjsip-simple/presence.h"
31#include "pjsip-simple/rpid.h"
34#define PRESENCE_FUNCTION_PUBLISH 0
35#define PRESENCE_FUNCTION_SUBSCRIBE 1
36#define PRESENCE_LOCK_FLAG 1
37#define PRESENCE_CLIENT_LOCK_FLAG 2
121 void enable(
bool enabled);
219 std::list<PresSubServer*> sub_server_list_;
220 std::list<PresSubClient*> sub_client_list_;
222 std::recursive_mutex mutex_;
int getModId() const
Return presence module ID which is actually the same as the VOIP link.
~SIPPresence()
Destructor.
pjsip_pres_status * getStatus()
Return presence data.
void fillDoc(pjsip_tx_data *tdata, const pres_msg_data *msg_data)
Fill xml document, the header and the body.
void approvePresSubServer(const std::string &uri, bool flag)
IP2IP context.
void reportPresSubClientNotification(std::string_view uri, pjsip_pres_status *status)
Send a signal to the client on DBus.
void updateStatus(bool status, const std::string ¬e)
Modify the presence data.
void removePresSubServer(PresSubServer *s)
IP2IP context.
void subscribeClient(const std::string &uri, bool flag)
Send a SUBSCRIBE request to PBX/IP2IP.
const std::list< PresSubClient * > & getClientSubscriptions() const
void removePresSubClient(PresSubClient *b)
Remove a buddy from the list.
bool isSupported(int function)
SIPAccount * getAccount() const
Return associated sipaccount.
void enable(bool enabled)
Activate the module.
void notifyPresSubServer()
IP2IP context.
void addPresSubClient(PresSubClient *b)
Add a buddy in the buddy list.
pj_pool_t * getPool() const
Return a pool for generic functions.
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)
void addPresSubServer(PresSubServer *s)
IP2IP context.
void support(int function, bool enabled)
Support the presence function publish/subscribe.
void emitSignal(Args... args)
Simple macro to hide class' copy constructor and assignment operator.
#define NON_COPYABLE(ClassName)
pj_str_t content_type
MIME type of optional message body.
pjsip_multipart_part multipart_parts
List of multipart parts.
pjsip_hdr hdr_list
Additional message headers as linked list.
pjsip_media_type multipart_ctype
Content type of the multipart body.
pj_str_t msg_body
Optional message body to be added to the message, only when the message doesn't have a body.