Ring Daemon 16.0.0
|
#include <sipvoiplink.h>
Public Types | |
typedef std::function< void(std::vector< dhtnet::IpAddr >)> | SrvResolveCallback |
Public Member Functions | |
void | cancelKeepAliveTimer (pj_timer_entry &timer) |
Abort currently registered timer. | |
void | createDefaultSipUdpTransport () |
Create the default UDP transport according ot Ip2Ip profile settings. | |
bool | findLocalAddressFromSTUN (pjsip_transport *transport, pj_str_t *stunServerName, int stunPort, std::string &address, pj_uint16_t &port) const |
void | findLocalAddressFromTransport (pjsip_transport *transport, pjsip_transport_type_e transportType, const std::string &host, std::string &address, pj_uint16_t &port) const |
Get the correct address to use (ie advertised) from a uri. | |
pj_caching_pool * | getCachingPool () noexcept |
pjsip_endpoint * | getEndpoint () |
pj_caching_pool * | getMemoryPoolFactory () |
Get the memory pool factory since each calls has its own memory pool. | |
pjsip_module * | getMod () |
int | getModId () |
pj_pool_t * | getPool () noexcept |
std::shared_ptr< SIPAccountBase > | guessAccount (std::string_view userName, std::string_view server, std::string_view fromUri) const |
Guess the account related to an incoming SIP call. | |
void | handleEvents () |
Event listener. | |
void | registerKeepAliveTimer (pj_timer_entry &timer, pj_time_val &delay) |
Register a new keepalive registration timer to this endpoint. | |
void | resolveSrvName (const std::string &name, pjsip_transport_type_e type, SrvResolveCallback &&cb) |
void | shutdown () |
Destroy structures. | |
SIPVoIPLink () | |
~SIPVoIPLink () | |
Static Public Member Functions | |
static void | createSDPOffer (pjsip_inv_session *inv) |
static pjsip_tpselector | getTransportSelector (pjsip_transport *transport) |
Initialize the transport selector. | |
Public Attributes | |
std::unique_ptr< SipTransportBroker > | sipTransportBroker |
Instance that maintain and manage transport (UDP, TLS) | |
Friends | |
class | SIPTest |
Definition at line 57 of file sipvoiplink.h.
typedef std::function<void(std::vector<dhtnet::IpAddr>)> jami::SIPVoIPLink::SrvResolveCallback |
Definition at line 101 of file sipvoiplink.h.
jami::SIPVoIPLink::SIPVoIPLink | ( | ) |
Definition at line 611 of file sipvoiplink.cpp.
References jami::sip_utils::CONST_PJ_STR(), jami::emitSignal(), jami::endpt_, handleEvents(), jami::sip_utils::SIP_METHODS::INFO, jami::invite_session_state_changed_cb(), JAMI_DBG, JAMI_ERR, JAMI_WARN, jami::sip_utils::SIP_METHODS::MESSAGE, jami::PresSubServer::mod_presence_server, jami::mod_ua_, jami::on_rx_offer2(), jami::sip_utils::SIP_METHODS::OPTIONS, jami::outgoing_request_forked_cb(), jami::sip_utils::SIP_METHODS::PUBLISH, jami::reinvite_received_cb(), jami::sdp_create_offer_cb(), jami::sdp_media_update_cb(), jami::sip_utils::sip_strerror(), sipTransportBroker, jami::tp_state_callback(), jami::transaction_request_cb(), jami::transaction_response_cb(), jami::transaction_state_changed_cb(), and TRY.
jami::SIPVoIPLink::~SIPVoIPLink | ( | ) |
Definition at line 739 of file sipvoiplink.cpp.
void jami::SIPVoIPLink::cancelKeepAliveTimer | ( | pj_timer_entry & | timer | ) |
Abort currently registered timer.
Definition at line 836 of file sipvoiplink.cpp.
References jami::emitSignal(), and jami::endpt_.
void jami::SIPVoIPLink::createDefaultSipUdpTransport | ( | ) |
Create the default UDP transport according ot Ip2Ip profile settings.
|
static |
Definition at line 1435 of file sipvoiplink.cpp.
References jami::emitSignal(), and jami::sdp_create_offer_cb().
bool jami::SIPVoIPLink::findLocalAddressFromSTUN | ( | pjsip_transport * | transport, |
pj_str_t * | stunServerName, | ||
int | stunPort, | ||
std::string & | address, | ||
pj_uint16_t & | port | ||
) | const |
Definition at line 1604 of file sipvoiplink.cpp.
References jami::sip_utils::as_view(), jami::sip_utils::DEFAULT_SIP_PORT, jami::emitSignal(), JAMI_DBG, JAMI_DEBUG, JAMI_ERR, JAMI_ERROR, JAMI_WARN, JAMI_WARNING, and RETURN_FALSE_IF_NULL.
void jami::SIPVoIPLink::findLocalAddressFromTransport | ( | pjsip_transport * | transport, |
pjsip_transport_type_e | transportType, | ||
const std::string & | host, | ||
std::string & | address, | ||
pj_uint16_t & | port | ||
) | const |
Get the correct address to use (ie advertised) from a uri.
The corresponding transport that should be used with that uri will be discovered.
uri | The uri from which we want to discover the address to use |
transport | The transport to use to discover the address |
Definition at line 1559 of file sipvoiplink.cpp.
References jami::sip_utils::as_view(), jami::emitSignal(), jami::endpt_, getTransportSelector(), JAMI_WARN, and RETURN_IF_NULL.
|
noexcept |
Definition at line 606 of file sipvoiplink.cpp.
pjsip_endpoint * jami::SIPVoIPLink::getEndpoint | ( | ) |
Definition at line 588 of file sipvoiplink.cpp.
References jami::endpt_.
pj_caching_pool * jami::SIPVoIPLink::getMemoryPoolFactory | ( | ) |
Get the memory pool factory since each calls has its own memory pool.
pjsip_module * jami::SIPVoIPLink::getMod | ( | ) |
Definition at line 594 of file sipvoiplink.cpp.
References jami::mod_ua_.
int jami::SIPVoIPLink::getModId | ( | ) |
Definition at line 1429 of file sipvoiplink.cpp.
References jami::mod_ua_.
Referenced by jami::SIPPresence::getModId().
|
noexcept |
Definition at line 600 of file sipvoiplink.cpp.
|
inlinestatic |
Initialize the transport selector.
transport | A transport associated with an account |
Definition at line 145 of file sipvoiplink.h.
References jami::emitSignal().
Referenced by findLocalAddressFromTransport(), and jami::transaction_request_cb().
std::shared_ptr< SIPAccountBase > jami::SIPVoIPLink::guessAccount | ( | std::string_view | userName, |
std::string_view | server, | ||
std::string_view | fromUri | ||
) | const |
Guess the account related to an incoming SIP call.
Definition at line 766 of file sipvoiplink.cpp.
References jami::emitSignal(), jami::FULL, jami::Manager::getAllAccounts(), jami::Manager::instance(), JAMI_LOG, and jami::NONE.
Referenced by jami::transaction_request_cb().
void jami::SIPVoIPLink::handleEvents | ( | ) |
Event listener.
Each event send by the call manager is received and handled from here
Definition at line 801 of file sipvoiplink.cpp.
References jami::emitSignal(), jami::endpt_, JAMI_ERR, and jami::sip_utils::sip_strerror().
Referenced by SIPVoIPLink().
void jami::SIPVoIPLink::registerKeepAliveTimer | ( | pj_timer_entry & | timer, |
pj_time_val & | delay | ||
) |
Register a new keepalive registration timer to this endpoint.
Definition at line 810 of file sipvoiplink.cpp.
References jami::emitSignal(), jami::endpt_, JAMI_DEBUG, JAMI_ERR, and JAMI_WARN.
void jami::SIPVoIPLink::resolveSrvName | ( | const std::string & | name, |
pjsip_transport_type_e | type, | ||
SrvResolveCallback && | cb | ||
) |
Definition at line 1484 of file sipvoiplink.cpp.
References jami::emitSignal(), jami::endpt_, jami::getResolveCallbackMap(), JAMI_DBG, JAMI_ERR, JAMI_WARN, jami::SafeResolveCallbackMap::registerCallback(), jami::resolver_callback(), and jami::runOnMainThread().
void jami::SIPVoIPLink::shutdown | ( | ) |
Destroy structures.
Definition at line 742 of file sipvoiplink.cpp.
References jami::emitSignal(), jami::endpt_, jami::Manager::instance(), JAMI_DBG, JAMI_ERR, jami::Call::SIP, and sipTransportBroker.
Definition at line 161 of file sipvoiplink.h.
std::unique_ptr<SipTransportBroker> jami::SIPVoIPLink::sipTransportBroker |
Instance that maintain and manage transport (UDP, TLS)
Definition at line 99 of file sipvoiplink.h.
Referenced by jami::SIPAccount::newOutgoingCall(), shutdown(), SIPVoIPLink(), and jami::transaction_request_cb().