Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::im Namespace Reference

Classes

struct  InstantMessageException
 
class  MessageEngine
 

Typedefs

using MessageToken = uint64_t
 

Enumerations

enum class  MessageStatus {
  UNKNOWN =0 , IDLE , SENDING , SENT ,
  FAILURE
}
 

Functions

void fillPJSIPMessageBody (pjsip_tx_data &tdata, const std::map< std::string, std::string > &payloads)
 
std::map< std::string, std::string > parseSipMessage (const pjsip_msg *msg)
 Parses given SIP message into a map where the key is the contents of the Content-Type header (along with any parameters) and the value is the message payload.
 
void sendSipMessage (pjsip_inv_session *session, const std::map< std::string, std::string > &payloads)
 Constructs and sends a SIP message.
 

Typedef Documentation

◆ MessageToken

Enumeration Type Documentation

◆ MessageStatus

Enumerator
UNKNOWN 
IDLE 
SENDING 
SENT 
FAILURE 

Definition at line 38 of file message_engine.h.

Function Documentation

◆ fillPJSIPMessageBody()

void jami::im::fillPJSIPMessageBody ( pjsip_tx_data tdata,
const std::map< std::string, std::string > &  payloads 
)

Definition at line 105 of file instant_messaging.cpp.

References jami::createMessageBody(), jami::emitSignal(), JAMI_ERR, and jami::sip_utils::sip_strerror().

Referenced by sendSipMessage().

Here is the call graph for this function:

◆ parseSipMessage()

std::map< std::string, std::string > jami::im::parseSipMessage ( const pjsip_msg msg)

Parses given SIP message into a map where the key is the contents of the Content-Type header (along with any parameters) and the value is the message payload.

Parameters
msgreceived SIP message
Returns
map of content types and message payloads

Definition at line 204 of file instant_messaging.cpp.

References jami::emitSignal(), JAMI_WARN, and jami::parseMessageBody().

Referenced by jami::transaction_request_cb(), and jami::transaction_state_changed_cb().

Here is the call graph for this function:

◆ sendSipMessage()

void jami::im::sendSipMessage ( pjsip_inv_session session,
const std::map< std::string, std::string > &  payloads 
)

Constructs and sends a SIP message.

The expected format of the map key is: type/subtype[; *[; arg=value]] eg: "text/plain; id=1234;part=2;of=1001" note: all whitespace is optional

If the map contains more than one pair, then a multipart/mixed message type will be created containing multiple message parts. Note that all of the message parts must be able to fit into one message... they will not be split into multiple messages.

Parameters
sessionSIP session
payloadsa map where the mime type and optional parameters are the key and the message payload is the value

Exception: throw InstantMessageException if no message sent

Definition at line 139 of file instant_messaging.cpp.

References jami::emitSignal(), fillPJSIPMessageBody(), JAMI_ERR, JAMI_WARN, jami::sip_utils::SIP_METHODS::MESSAGE, and jami::sip_utils::sip_strerror().

Here is the call graph for this function: