26#include <dhtnet/ip_utils.h>
31#include <pjlib-util.h>
33#include <pjnath/stun_config.h>
50class SipTransportBroker;
111 std::string_view
fromUri)
const;
131 std::
string& address,
137 std::
string& address,
149 tp.u.transport = transport;
158 std::atomic_bool running_ {
true};
159 std::thread sipThread_;
pjsip_endpoint * getEndpoint()
void cancelKeepAliveTimer(pj_timer_entry &timer)
Abort currently registered timer.
bool findLocalAddressFromSTUN(pjsip_transport *transport, pj_str_t *stunServerName, int stunPort, std::string &address, pj_uint16_t &port) const
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.
static pjsip_tpselector getTransportSelector(pjsip_transport *transport)
Initialize the transport selector.
pj_caching_pool * getMemoryPoolFactory()
Get the memory pool factory since each calls has its own memory pool.
void shutdown()
Destroy structures.
pj_caching_pool * getCachingPool() noexcept
std::function< void(std::vector< dhtnet::IpAddr >)> SrvResolveCallback
std::unique_ptr< SipTransportBroker > sipTransportBroker
Instance that maintain and manage transport (UDP, TLS)
void createDefaultSipUdpTransport()
Create the default UDP transport according ot Ip2Ip profile settings.
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_pool_t * getPool() noexcept
void resolveSrvName(const std::string &name, pjsip_transport_type_e type, SrvResolveCallback &&cb)
static void createSDPOffer(pjsip_inv_session *inv)
void registerKeepAliveTimer(pj_timer_entry &timer, pj_time_val &delay)
Register a new keepalive registration timer to this endpoint.
void emitSignal(Args... args)
Simple macro to hide class' copy constructor and assignment operator.
#define NON_COPYABLE(ClassName)