Commit 4d603bc4 authored by Adrien Béraud's avatar Adrien Béraud Committed by Andreas Traczyk

sip: register pjsip thread

Change-Id: I65ba7e0ad6b9490e0816e175ea95574f34626851
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent d078df0a
......@@ -265,6 +265,7 @@ IceTransport::Impl::Impl(const char* name, int component_count, bool master,
auto& iceTransportFactory = Manager::instance().getIceTransportFactory();
config_ = iceTransportFactory.getIceCfg(); // config copy
sip_utils::register_thread();
pool_.reset(pj_pool_create(iceTransportFactory.getPoolFactory(),
"IceTransport.pool", 512, 512, NULL));
if (not pool_)
......@@ -609,6 +610,7 @@ IceTransport::Impl::addReflectiveCandidate(int comp_id, const IpAddr& base, cons
// This implies we hope they'll not be modification of transport_id meaning in future
// and no conflics with the borrowed STUN config.
// HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK-HACK
sip_utils::register_thread();
// borrowed from pjproject/pjnath/ice_strans.c, modified to be C++11'ized.
static auto CREATE_TP_ID = [](pj_uint8_t type, pj_uint8_t idx) {
......
......@@ -352,6 +352,7 @@ SipsIceTransport::handleEvents()
rxPending_.clear();
}
sip_utils::register_thread();
for (auto it = rx.begin(); it != rx.end(); ++it) {
auto& pck = *it;
pj_pool_reset(rdata_.tp_info.pool);
......
......@@ -64,6 +64,7 @@ Sdp::Sdp(const std::string& id)
, sdesNego_ {CryptoSuites}
, telephoneEventPayload_(101) // same as asterisk
{
sip_utils::register_thread();
memPool_.reset(pj_pool_create(&getSIPVoIPLink()->getCachingPool()->factory,
id.c_str(), POOL_INITIAL_SIZE,
POOL_INCREMENT_SIZE, NULL));
......@@ -327,6 +328,7 @@ void Sdp::setLocalMediaAudioCapabilities(const std::vector<std::shared_ptr<Accou
void
Sdp::printSession(const pjmedia_sdp_session *session, const char* header)
{
sip_utils::register_thread();
static constexpr size_t BUF_SZ = 4095;
std::unique_ptr<pj_pool_t, decltype(pj_pool_release)&> tmpPool_(
pj_pool_create(&getSIPVoIPLink()->getCachingPool()->factory, "printSdp", BUF_SZ, BUF_SZ, nullptr),
......@@ -482,6 +484,7 @@ void Sdp::startNegotiation()
std::string
Sdp::getFilteredSdp(const pjmedia_sdp_session* session, unsigned media_keep, unsigned pt_keep)
{
sip_utils::register_thread();
static constexpr size_t BUF_SZ = 4096;
std::unique_ptr<pj_pool_t, decltype(pj_pool_release)&> tmpPool_(
pj_pool_create(&getSIPVoIPLink()->getCachingPool()->factory,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment