diff --git a/src/ice_transport.cpp b/src/ice_transport.cpp index d7140adbc5dad7ab72e473e14991d230ec7562bf..a3c22ec81cfc879508a9eb3ffce4ec4017c34c75 100644 --- a/src/ice_transport.cpp +++ b/src/ice_transport.cpp @@ -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) { diff --git a/src/ringdht/sips_transport_ice.cpp b/src/ringdht/sips_transport_ice.cpp index 3356efed446e57446653baf251128aedf9901cbd..41ddac2342dfa496223d5be4c03d032ce52a15a5 100644 --- a/src/ringdht/sips_transport_ice.cpp +++ b/src/ringdht/sips_transport_ice.cpp @@ -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); diff --git a/src/sip/sdp.cpp b/src/sip/sdp.cpp index 974f2af83a416cc7fd58023990d1d631dee97778..2ee4ea63fc25c8905932fe23c6cea1a82eea1e84 100644 --- a/src/sip/sdp.cpp +++ b/src/sip/sdp.cpp @@ -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,