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

Namespaces

namespace  SIP_METHODS
 

Classes

class  PJDialogLock
 
class  PjsipErrorCategory
 PjsipErrorCategory - a PJSIP error category for std::error_code. More...
 
class  PjsipFailure
 PJSIP related exception Based on std::system_error with code() returning std::error_code with PjsipErrorCategory category. More...
 

Functions

void addContactHeader (const std::string &contactHdr, pjsip_tx_data *tdata)
 
void addUserAgentHeader (const std::string &userAgent, pjsip_tx_data *tdata)
 
constexpr std::string_view as_view (const pj_str_t &str) noexcept
 
const pj_str_t CONST_PJ_STR (const std::string &str) noexcept
 
constexpr pj_str_t CONST_PJ_STR (const std::string_view &str) noexcept
 
template<typename T , std::size_t N>
constexpr const pj_str_t CONST_PJ_STR (T(&a)[N]) noexcept
 
pjsip_route_hdrcreateRouteSet (const std::string &route, pj_pool_t *hdr_pool)
 
std::string fetchHeaderValue (pjsip_msg *msg, const std::string &field)
 Helper function to parser header from incoming sip messages.
 
std::string_view getHostFromUri (std::string_view uri)
 
static constexpr const chargetKeyExchangeName (KeyExchangeProtocol kx)
 
static KeyExchangeProtocol getKeyExchangeProtocol (std::string_view name)
 
std::vector< std::string > getPeerAllowMethods (const pjsip_rx_data *rdata)
 
std::string_view getPeerUserAgent (const pjsip_rx_data *rdata)
 
void logMessageHeaders (const pjsip_hdr *hdr_list)
 
std::string parseDisplayName (const pjsip_contact_hdr *header)
 
std::string parseDisplayName (const pjsip_from_hdr *header)
 
std::string parseDisplayName (const pjsip_name_addr *sip_name_addr)
 
std::string sip_strerror (pj_status_t code)
 
static std::unique_ptr< pj_pool_t, decltype(pj_pool_release)& > smart_alloc_pool (pjsip_endpoint *endpt, const char *const name, pj_size_t initial, pj_size_t inc)
 
void sockaddr_to_host_port (pj_pool_t *pool, pjsip_host_port *host_port, const pj_sockaddr *addr)
 
std::string streamId (const std::string &callId, std::string_view label)
 
std::string_view stripSipUriPrefix (std::string_view sipUri)
 

Variables

constexpr std::string_view DEFAULT_AUDIO_STREAMID = "audio_0"
 
static constexpr int DEFAULT_AUTO_SELECT_PORT {0}
 
static constexpr int DEFAULT_SIP_PORT {5060}
 
static constexpr int DEFAULT_SIP_TLS_PORT {5061}
 
constexpr std::string_view DEFAULT_VIDEO_STREAMID = "video_0"
 
static constexpr int POOL_TP_INC {512}
 
static constexpr int POOL_TP_INIT {512}
 
static constexpr int TRANSPORT_INFO_LENGTH {64}
 
constexpr pj_str_t USER_AGENT_STR = CONST_PJ_STR("User-Agent")
 

Function Documentation

◆ addContactHeader()

void jami::sip_utils::addContactHeader ( const std::string &  contactHdr,
pjsip_tx_data tdata 
)

Definition at line 175 of file sip_utils.cpp.

References jami::emitSignal(), and JAMI_WARN.

Referenced by jami::transaction_request_cb().

Here is the call graph for this function:

◆ addUserAgentHeader()

void jami::sip_utils::addUserAgentHeader ( const std::string &  userAgent,
pjsip_tx_data tdata 
)

Definition at line 201 of file sip_utils.cpp.

References CONST_PJ_STR(), jami::emitSignal(), USER_AGENT_STR, and jami::userAgent().

Referenced by jami::transaction_request_cb().

Here is the call graph for this function:

◆ as_view()

◆ CONST_PJ_STR() [1/3]

const pj_str_t jami::sip_utils::CONST_PJ_STR ( const std::string &  str)
inlinenoexcept

Definition at line 95 of file sip_utils.h.

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

Here is the call graph for this function:

◆ CONST_PJ_STR() [2/3]

constexpr pj_str_t jami::sip_utils::CONST_PJ_STR ( const std::string_view &  str)
inlineconstexprnoexcept

Definition at line 101 of file sip_utils.h.

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

Here is the call graph for this function:

◆ CONST_PJ_STR() [3/3]

◆ createRouteSet()

pjsip_route_hdr * jami::sip_utils::createRouteSet ( const std::string &  route,
pj_pool_t hdr_pool 
)

Definition at line 79 of file sip_utils.cpp.

References jami::emitSignal(), and JAMI_DBG.

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

Here is the call graph for this function:

◆ fetchHeaderValue()

std::string jami::sip_utils::fetchHeaderValue ( pjsip_msg msg,
const std::string &  field 
)

Helper function to parser header from incoming sip messages.

Returns
Header from SIP message

Definition at line 59 of file sip_utils.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ getHostFromUri()

std::string_view jami::sip_utils::getHostFromUri ( std::string_view  uri)

Definition at line 161 of file sip_utils.cpp.

Referenced by jami::SIPAccount::newOutgoingCall().

◆ getKeyExchangeName()

static constexpr const char * jami::sip_utils::getKeyExchangeName ( KeyExchangeProtocol  kx)
staticconstexpr

Definition at line 113 of file sip_utils.h.

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

Referenced by jami::SipAccountConfig::serialize(), and jami::SipAccountConfig::toMap().

Here is the call graph for this function:

◆ getKeyExchangeProtocol()

static KeyExchangeProtocol jami::sip_utils::getKeyExchangeProtocol ( std::string_view  name)
inlinestatic

Definition at line 119 of file sip_utils.h.

References jami::emitSignal(), jami::NONE, and jami::SDES.

Referenced by jami::SipAccountConfig::fromMap(), and jami::SipAccountConfig::unserialize().

Here is the call graph for this function:

◆ getPeerAllowMethods()

std::vector< std::string > jami::sip_utils::getPeerAllowMethods ( const pjsip_rx_data rdata)

Definition at line 239 of file sip_utils.cpp.

References jami::emitSignal(), and JAMI_ERR.

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

Here is the call graph for this function:

◆ getPeerUserAgent()

std::string_view jami::sip_utils::getPeerUserAgent ( const pjsip_rx_data rdata)

Definition at line 223 of file sip_utils.cpp.

References as_view(), jami::emitSignal(), JAMI_ERR, and USER_AGENT_STR.

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

Here is the call graph for this function:

◆ logMessageHeaders()

void jami::sip_utils::logMessageHeaders ( const pjsip_hdr hdr_list)

Definition at line 262 of file sip_utils.cpp.

References jami::emitSignal(), and JAMI_LOG.

Referenced by jami::transaction_request_cb().

Here is the call graph for this function:

◆ parseDisplayName() [1/3]

std::string jami::sip_utils::parseDisplayName ( const pjsip_contact_hdr header)

Definition at line 128 of file sip_utils.cpp.

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

Here is the call graph for this function:

◆ parseDisplayName() [2/3]

std::string jami::sip_utils::parseDisplayName ( const pjsip_from_hdr header)

Definition at line 121 of file sip_utils.cpp.

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

Here is the call graph for this function:

◆ parseDisplayName() [3/3]

std::string jami::sip_utils::parseDisplayName ( const pjsip_name_addr sip_name_addr)

Definition at line 106 of file sip_utils.cpp.

References as_view(), jami::emitSignal(), jami::utf8_make_valid(), and jami::utf8_validate().

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

Here is the call graph for this function:

◆ sip_strerror()

std::string jami::sip_utils::sip_strerror ( pj_status_t  code)

◆ smart_alloc_pool()

static std::unique_ptr< pj_pool_t, decltype(pj_pool_release)& > jami::sip_utils::smart_alloc_pool ( pjsip_endpoint endpt,
const char *const  name,
pj_size_t  initial,
pj_size_t  inc 
)
inlinestatic

Definition at line 173 of file sip_utils.h.

References jami::emitSignal().

Referenced by jami::tls::ChanneledSIPTransport::ChanneledSIPTransport().

Here is the call graph for this function:

◆ sockaddr_to_host_port()

void jami::sip_utils::sockaddr_to_host_port ( pj_pool_t pool,
pjsip_host_port host_port,
const pj_sockaddr addr 
)

Definition at line 296 of file sip_utils.cpp.

References jami::emitSignal().

Referenced by jami::tls::ChanneledSIPTransport::ChanneledSIPTransport().

Here is the call graph for this function:

◆ streamId()

std::string jami::sip_utils::streamId ( const std::string &  callId,
std::string_view  label 
)

◆ stripSipUriPrefix()

std::string_view jami::sip_utils::stripSipUriPrefix ( std::string_view  sipUri)

Definition at line 135 of file sip_utils.cpp.

References jami::emitSignal().

Referenced by jami::transaction_request_cb().

Here is the call graph for this function:

Variable Documentation

◆ DEFAULT_AUDIO_STREAMID

◆ DEFAULT_AUTO_SELECT_PORT

constexpr int jami::sip_utils::DEFAULT_AUTO_SELECT_PORT {0}
staticconstexpr

Definition at line 55 of file sip_utils.h.

◆ DEFAULT_SIP_PORT

constexpr int jami::sip_utils::DEFAULT_SIP_PORT {5060}
staticconstexpr

Definition at line 53 of file sip_utils.h.

Referenced by jami::SIPVoIPLink::findLocalAddressFromSTUN().

◆ DEFAULT_SIP_TLS_PORT

constexpr int jami::sip_utils::DEFAULT_SIP_TLS_PORT {5061}
staticconstexpr

Definition at line 54 of file sip_utils.h.

◆ DEFAULT_VIDEO_STREAMID

constexpr std::string_view jami::sip_utils::DEFAULT_VIDEO_STREAMID = "video_0"
constexpr

◆ POOL_TP_INC

constexpr int jami::sip_utils::POOL_TP_INC {512}
staticconstexpr

◆ POOL_TP_INIT

constexpr int jami::sip_utils::POOL_TP_INIT {512}
staticconstexpr

◆ TRANSPORT_INFO_LENGTH

constexpr int jami::sip_utils::TRANSPORT_INFO_LENGTH {64}
staticconstexpr

◆ USER_AGENT_STR

constexpr pj_str_t jami::sip_utils::USER_AGENT_STR = CONST_PJ_STR("User-Agent")
constexpr

Definition at line 47 of file sip_utils.cpp.

Referenced by addUserAgentHeader(), and getPeerUserAgent().