1#if defined(HAVE_CONFIG_H)
49#if defined(WIN32) && !defined(__GNUC__)
50#pragma warning( disable : 4355 )
55#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
77 mAppTimers(mTuSelector),
83 mTUFifo.setDescription(
"SipStack::mTUFifo");
96 mPollGrpIsMine(!pollGrp),
98 mSecurity( pSecurity ? pSecurity : new
Security()),
102 mDnsStub(new
DnsStub(additional, socketFunc, handler, mPollGrp)),
106 mInterruptorIsMine(!handler),
109 mCongestionManager(0),
110 mTuSelector(mTUFifo),
111 mAppTimers(mTuSelector),
112 mStatsManager(*this),
114 mTransactionControllerThread(0),
115 mTransportSelectorThread(0),
116 mInternalThreadsRunning(false),
117 mProcessingHasStarted(false),
118 mShuttingDown(false),
119 mStatisticsManagerEnabled(true),
120 mSocketFunc(socketFunc),
135 mTUFifo.setDescription(
"SipStack::mTUFifo");
144 mTuSelector(mTUFifo),
145 mAppTimers(mTuSelector),
162 mPollGrpIsMine=
false;
184 mInterruptorIsMine =
false;
188 mInterruptorIsMine =
true;
196 mAsyncProcessHandler,
203 mCongestionManager = 0;
209 mTransactionControllerThread = 0;
210 mTransportSelectorThread = 0;
212 mInternalThreadsRunning =
false;
213 mProcessingHasStarted =
false;
214 mShuttingDown =
false;
215 mStatisticsManagerEnabled =
true;
226 DebugLog (<<
"SipStack::~SipStack()");
231 delete mTransactionControllerThread;
232 mTransactionControllerThread=0;
233 delete mTransportSelectorThread;
234 mTransportSelectorThread=0;
236 delete mTransactionController;
250 if(mInterruptorIsMine)
252 delete mAsyncProcessHandler;
253 mAsyncProcessHandler=0;
260 if(mInternalThreadsRunning)
265 mInternalThreadsRunning=
true;
270 delete mTransactionControllerThread;
272 mTransactionControllerThread->
run();
274 delete mTransportSelectorThread;
276 mTransportSelectorThread->
run();
282 InfoLog (<<
"Shutting down sip stack " <<
this);
285 Lock lock(mShutdownMutex);
287 mShuttingDown =
true;
302 if(mTransactionControllerThread)
304 mTransactionControllerThread->
shutdown();
305 mTransactionControllerThread->
join();
308 if(mTransportSelectorThread)
310 mTransportSelectorThread->
shutdown();
311 mTransportSelectorThread->
join();
313 mInternalThreadsRunning=
false;
325 for(SecureTransportMap::iterator itS = mSecureTransports.begin(); itS != mSecureTransports.end(); itS++)
327 itS->second->onReload();
334 mTransportSipMessageLoggingHandlers.clear();
338 mTransportSipMessageLoggingHandlers.push_back(handler);
350 mTransportSipMessageLoggingHandlers.push_back(handler);
351 for(
auto& t : mNonSecureTransports)
353 t.second->addSipMessageLoggingHandler(handler);
355 for(
auto& t : mSecureTransports)
357 t.second->addSipMessageLoggingHandler(handler);
366 const Data& ipInterface,
367 const Data& sipDomainname,
368 const Data& privateKeyPassPhrase,
370 unsigned transportFlags,
371 const Data& certificateFilename,
const Data& privateKeyFilename,
374 std::shared_ptr<WsConnectionValidator> wsConnectionValidator,
375 std::shared_ptr<WsCookieContextFactory> wsCookieContextFactory,
381 if(!ipInterface.
empty())
387 ErrLog(<<
"Failed to create transport, invalid ipInterface specified (IP address required): V6 "
389 << ipInterface.
c_str());
390 throw Transport::Exception(
"Invalid ipInterface specified (IP address required)", __FILE__,__LINE__);
397 ErrLog(<<
"Failed to create transport, invalid ipInterface specified (IP address required): V4 "
399 << ipInterface.
c_str());
400 throw Transport::Exception(
"Invalid ipInterface specified (IP address required)", __FILE__,__LINE__);
406 if(!netNs.
empty() && protocol !=
TCP)
408 ErrLog(<<
"Failed to create transport, netns is currently only supported for TCP. Cannot use netns: " << netNs);
420 transport =
new UdpTransport(
stateMacFifo, port, version, stun, ipInterface, mSocketFunc, *mCompression, transportFlags);
427#if defined( USE_SSL )
442 privateKeyPassPhrase);
444 CritLog (<<
"Can't add TLS transport: TLS not supported in this stack. You don't have openssl.");
445 throw Transport::Exception(
"Can't add TLS transport: TLS not supported in this stack. You don't have openssl.", __FILE__,__LINE__);
449#if defined( USE_DTLS )
460 privateKeyPassPhrase);
462 CritLog (<<
"Can't add DTLS transport: DTLS not supported in this stack.");
463 throw Transport::Exception(
"Can't add DTLS transport: DTLS not supported in this stack.", __FILE__,__LINE__);
475 wsConnectionValidator,
476 wsCookieContextFactory);
480#if defined( USE_SSL )
493 wsConnectionValidator,
494 wsCookieContextFactory,
497 privateKeyPassPhrase);
499 CritLog (<<
"Can't add WSS transport: Secure Websockets not supported in this stack. You don't have openssl.");
500 throw Transport::Exception(
"Can't add WSS transport: Secure Websockets not supported in this stack. You don't have openssl.", __FILE__,__LINE__);
504 CritLog (<<
"Can't add unknown transport.");
511 ErrLog(<<
"Failed to create transport: "
512 << (version ==
V4 ?
"V4" :
"V6") <<
" "
514 << (ipInterface.
empty() ?
"ANY" : ipInterface.
c_str())
528 Tuple tuple(transport->interfaceName(), transport->port(),
529 transport->ipVersion(), transport->transport(),
532 if(!
isSecure(transport->transport()))
534 if(mNonSecureTransports.find(tuple) == mNonSecureTransports.end())
537 transport->setKey(mNextTransportKey++);
539 mNonSecureTransports[tuple] = transport.get();
544 ErrLog(<<
"Failed to add non-secure transport, transport with similar properties already exists: " << tuple);
545 throw Transport::Exception(
"Failed to add non-secure transport, transport with similar properties already exists.", __FILE__,__LINE__);
552 if(mSecureTransports.find(tlsKey) == mSecureTransports.end())
555 transport->setKey(mNextTransportKey++);
557 mSecureTransports[tlsKey] = transport.get();
562 ErrLog(<<
"Failed to add secure transport, transport with similar properties already exists: "
563 << tuple <<
" (domain=" << transport->tlsDomain() <<
")");
564 throw Transport::Exception(
"Failed to add secure transport, transport with similar properties already exists.", __FILE__,__LINE__);
569 if (!transport->interfaceName().empty())
571 addAlias(transport->interfaceName(), transport->port());
577 if(transport->ipVersion()==
V4)
579 ipIfs.push_back(std::make_pair<Data,Data>(
"lo0",
"127.0.0.1"));
581 while(!ipIfs.empty())
585 addAlias(ipIfs.back().second, transport->port());
591 Lock lock(mPortsMutex);
592 mPorts[transport->port()]++;
596 if(mCongestionManager)
598 transport->setCongestionManager(mCongestionManager);
602 if (!mTransportSipMessageLoggingHandlers.empty())
604 transport->setSipMessageLoggingHandlers(mTransportSipMessageLoggingHandlers);
607 if(mProcessingHasStarted)
610 mTransactionController->
addTransport(std::move(transport));
626 for(NonSecureTransportMap::iterator itNS = mNonSecureTransports.begin(); itNS != mNonSecureTransports.end(); itNS++)
628 if(itNS->first.mTransportKey == transportKey)
630 removeTuple = itNS->first;
631 transportToRemove = itNS->second;
632 mNonSecureTransports.erase(itNS);
637 if(!transportToRemove)
639 for(SecureTransportMap::iterator itS = mSecureTransports.begin(); itS != mSecureTransports.end(); itS++)
641 if(itS->first.mTuple.mTransportKey == transportKey)
643 removeTuple = itS->first.mTuple;
644 transportToRemove = itS->second;
645 mSecureTransports.erase(itS);
650 if(!transportToRemove)
652 WarningLog (<<
"removeTransport: could not find transport specified by transportKey=" << transportKey);
656 if(mSecureTransports.size() == 0 && mNonSecureTransports.size() == 0)
659 Lock lock(mDomainsMutex);
677 ipIfs.push_back(std::make_pair<Data,Data>(
"lo0",
"127.0.0.1"));
679 while(!ipIfs.empty())
691 Lock lock(mPortsMutex);
692 std::map<int, unsigned int>::iterator itP = mPorts.find(transportToRemove->
port());
693 if(itP != mPorts.end())
696 if(--itP->second == 0)
703 if(mProcessingHasStarted)
726 DebugLog (<<
"Adding domain alias: " << domain <<
":" << portToUse);
729 Lock lock(mDomainsMutex);
730 mDomains[domain +
":" +
Data(portToUse)]++;
734 mUri.
host() = domain;
735 mUri.
port() = portToUse;
744 DebugLog (<<
"Removing domain alias: " << domain <<
":" << portToUse);
747 Lock lock(mDomainsMutex);
748 DomainsMap::iterator it = mDomains.find(domain +
":" +
Data(portToUse));
749 if(it != mDomains.end())
751 if(--it->second == 0)
766 int err = gethostname(hostName,
sizeof(hostName));
769 ErrLog(<<
"gethostname failed with return " << err <<
" Returning \"localhost\"");
774 struct addrinfo hints = {};
775 struct addrinfo* res = NULL;
776 hints.ai_family = AF_INET;
777 hints.ai_socktype = SOCK_STREAM;
779 err = getaddrinfo(hostName, NULL, &hints, &res);
780 if (err != 0 || res == NULL)
782 ErrLog(<<
"getaddrinfo failed - name server is probably down: " << gai_strerror(err));
787 Data retHost(res->ai_canonname ? res->ai_canonname : hostName);
797 int err = gethostname(hostName,
sizeof(hostName));
800 ErrLog(<<
"gethostname failed with return " << err <<
" Returning "
806 struct addrinfo hints = {};
807 struct addrinfo* res = NULL;
808 hints.ai_family = AF_INET;
809 hints.ai_socktype = SOCK_STREAM;
811 err = getaddrinfo(hostName, NULL, &hints, &res);
812 if (err != 0 || res == NULL)
814 ErrLog(<<
"getaddrinfo failed, returning \"127.0.0.1\": " << gai_strerror(err));
819 struct sockaddr_in* addr = (
struct sockaddr_in*)res->ai_addr;
822 ErrLog(<<
"getaddrinfo returned no address, returning \"127.0.0.1\"");
829 char addrBuf[INET_ADDRSTRLEN];
830 inet_ntop(AF_INET, &addr->sin_addr, addrBuf,
sizeof(addrBuf));
833 return Data(addrBuf);
839 auto key = domain +
":" +
842 Lock lock(mDomainsMutex);
843 return mDomains.find(key) != mDomains.end();
849 Lock lock(mPortsMutex);
850 return mPorts.find(port) != mPorts.end();
856 Lock lock(mDomainsMutex);
859 CritLog(<<
"There are no associated transports");
860 throw Exception(
"No associated transports", __FILE__, __LINE__);
880 mTransactionController->
send(toSend);
886 DebugLog (<<
"SEND: " << msg->brief());
890 msg->setTransactionUser(tu);
894 mTransactionController->
send(msg.release());
900 if (tu) msg->setTransactionUser(tu);
901 msg->setForceTarget(uri);
904 mTransactionController->
send(msg.release());
912 if (tu) msg->setTransactionUser(tu);
913 msg->setDestination(destination);
916 mTransactionController->
send(msg.release());
931 mTransactionController->
send(toSend);
946 mTransactionController->
send(toSend);
950SipStack::checkAsyncProcessHandler()
952 if (mAsyncProcessHandler)
978 post(message, std::chrono::seconds(secondsLater), tu);
986 post(message, std::chrono::milliseconds(ms), tu);
991 std::chrono::duration<double> interval,
998 auto ms = (
uint32_t)std::chrono::duration_cast<std::chrono::milliseconds>(interval).count();
999 Lock lock(mAppTimerMutex);
1000 mAppTimers.
add(ms,toPost);
1003 checkAsyncProcessHandler();
1008 unsigned int secondsLater,
1011 post(std::move(message), std::chrono::seconds(secondsLater), tu);
1020 post(std::move(message), std::chrono::milliseconds(ms), tu);
1025 std::chrono::duration<double> interval,
1029 if (tu) message->setTransactionUser(tu);
1031 auto ms = (
uint32_t)std::chrono::duration_cast<std::chrono::milliseconds>(interval).count();
1032 Lock lock(mAppTimerMutex);
1033 mAppTimers.
add(ms, message.release());
1036 checkAsyncProcessHandler();
1054 return mTUFifo.messageAvailable();
1062 if (mTUFifo.messageAvailable())
1066 Message* msg = mTUFifo.getNext();
1092 if (mTUFifo.messageAvailable())
1095 Message* msg = mTUFifo.getNext();
1119 if(!mTransactionControllerThread)
1121 mTransactionController->
process();
1129 if(!mTransportSelectorThread)
1135 Lock lock(mAppTimerMutex);
1162 Lock lock(mAppTimerMutex);
1163 mProcessingHasStarted =
true;
1165 unsigned int dnsNextProcess = (mDnsThread ?
1167 unsigned int tcNextProcess = mTransactionControllerThread ? INT_MAX :
1226 checkAsyncProcessHandler();
1233 checkAsyncProcessHandler();
1293 return mStatisticsManagerEnabled;
1299 return mStatisticsManagerEnabled;
1305 strm <<
"SipStack: " << (this->mSecurity ?
"with security " :
"without security ") << std::endl;
1307 Lock lock(mDomainsMutex);
1308 strm <<
"domains: " <<
Inserter(this->mDomains) << std::endl;
1310 strm <<
" TUFifo size=" << this->mTUFifo.size() << std::endl
1311 <<
" Timers size=" << this->mTransactionController->mTimers.
size() << std::endl;
1313 Lock lock(mAppTimerMutex);
1314 strm <<
" AppTimers size=" << this->mAppTimers.
size() << std::endl;
1316 strm <<
" ServerTransactionMap size=" << this->mTransactionController->mServerTransactionMap.
size() << std::endl
1317 <<
" ClientTransactionMap size=" << this->mTransactionController->mClientTransactionMap.
size() << std::endl
1319 <<
" Exact interface / Specific port=" <<
Inserter(this->mTransactionController->mTransportSelector.mExactTransports) << std::endl
1320 <<
" Any interface / Specific port=" <<
Inserter(this->mTransactionController->mTransportSelector.mAnyInterfaceTransports) << std::endl
1321 <<
" Exact interface / Any port =" <<
Inserter(this->mTransactionController->mTransportSelector.mAnyPortTransports) << std::endl
1322 <<
" Any interface / Any port=" <<
Inserter(this->mTransactionController->mTransportSelector.mAnyPortAnyInterfaceTransports) << std::endl
1323 <<
" TLS Transports=" <<
Inserter(this->mTransactionController->mTransportSelector.mTlsTransports) << std::endl;
1330 return stack.
dump(strm);
#define WarningLog(args_)
#define resip_assert(x)
This file needs to work for both C and C++ code.
static FdPollGrp * createDefaultPollGrp()
Handles cross-platform sockets compatibility.
A base-class for messages used by applications.
virtual void handleProcessNotification()=0
The abstract base-class for all exceptions thrown by resip code.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
static const Data Empty
Constant that represents a zero-length data.
const char * c_str() const
Returns a null-terminated string representing.
bool empty() const noexcept
Checks whether the Data is empty.
Data & clear()
Clears the contents of this Data.
virtual unsigned int getTimeTillNextProcessMS()
static NameserverList EmptyNameserverList
std::vector< GenericIPAddress > NameserverList
void setEnumDomains(const std::map< Data, Data > &domains)
void getDnsCacheDump(std::pair< unsigned long, unsigned long > key, GetDnsCacheDumpHandler *handler)
void setEnumSuffixes(const std::vector< Data > &suffixes)
static bool isIpV6Address(const Data &ipAddress)
static std::list< std::pair< Data, Data > > getInterfaces(const Data &matchingInterface=Data::Empty)
static bool isIpV4Address(const Data &ipAddress)
static FdPollGrp * create(const char *implName=NULL)
factory
virtual ImplType getImplType() const =0
virtual void buildFdSet(FdSet &fdSet)=0
virtual bool processFdSet(FdSet &fdset)=0
virtual bool waitAndProcess(int ms=0)=0
Wait at most {ms} milliseconds.
Object-oriented wrapper for your platform's file-descriptor set.
A templated, threadsafe message-queue class.
The base-class used for message-passing.
virtual Brief brief() const
return a facet for brief encoding of message
virtual Message * clone() const =0
void setTransactionUser(TransactionUser *t)
Used to 'artificially' interrupt a select call.
Represents a SIP message.
void setDestination(const Tuple &tuple)
Used by the stateless interface to specify where to send a request/response.
void setForceTarget(const Uri &uri)
deal with a notion of an "out-of-band" forced target for SIP routing
virtual Message * clone() const
void setFromTU()
Mark message as internally generated.
This class holds constructor-time initialization arguments for SipStack.
Compression * mCompression
AfterSocketCreationFuncPtr mSocketFunc
const DnsStub::NameserverList * mExtraNameserverList
AsyncProcessHandler * mAsyncProcessHandler
thrown when the stack is unable to function.
This is the primary point of interaction between the app-layer and the stack.
Fifo< TransactionMessage > & stateMacFifo()
Returns the fifo that subclasses of Transport should use for the rxFifo cons.
friend class TransactionController
void shutdownAndJoinThreads()
Shutdown and join any threads that the SipStack is running.
static Data getHostname()
Get one of the names for this host (calls through to gethostbyname) and is not threadsafe.
Security * getSecurity() const
Returns a pointer to the embedded Security object, 0 if not set.
DnsStub & getDnsStub() const
EncodeStream & dump(EncodeStream &strm) const
output current state of the stack - for debug
void clearDnsCache()
Clear the DNS Cache.
void invokeAfterSocketCreationFunc(TransportType type=UNKNOWN_TRANSPORT)
void getDnsCacheDump(std::pair< unsigned long, unsigned long > key, GetDnsCacheDumpHandler *handler)
Get a string representation of the DNS Cache.
bool isMyPort(int port) const
Returns true if port is handled by this stack.
void send(const SipMessage &msg, TransactionUser *tu=0)
allows a TU to send a message
Transport * addTransport(TransportType protocol, int port, IpVersion version=V4, StunSetting stun=StunDisabled, const Data &ipInterface=Data::Empty, const Data &sipDomainname=Data::Empty, const Data &privateKeyPassPhrase=Data::Empty, SecurityTypes::SSLType sslType=SecurityTypes::DynamicTLS, unsigned transportFlags=0, const Data &certificateFilename="", const Data &privateKeyFilename="", SecurityTypes::TlsClientVerificationMode cvm=SecurityTypes::None, bool useEmailAsSIP=false, std::shared_ptr< WsConnectionValidator >=nullptr, std::shared_ptr< WsCookieContextFactory >=nullptr, const Data &netNs=Data::Empty)
Used by the application to add in a new built-in transport.
void cancelClientInviteTransaction(const Data &tid, const Tokens *reasons)
Tells the stack that the TU wishes to CANCEL an INVITE request.
void reloadCertificates()
reload the TLS X.509 certificates
void setFallbackPostNotify(AsyncProcessHandler *handler)
virtual void process(FdSet &fdset)
This allows the executive to give processing time to stack components.
bool isMyDomain(const Data &domain, int port) const
Returns true if domain is handled by this stack.
SipMessage * receive()
retrieve a SipMessage off the old TuFifo
void addTransportSipMessageLoggingHandler(std::shared_ptr< Transport::SipMessageLoggingHandler > handler)
Used by the application to provide a handler that will get called for all inbound and outbound SIP me...
void registerTransactionUser(TransactionUser &, const bool front=false)
add a TU to the TU selection chain
void removeTransport(unsigned int transportKey)
Used to remove a previously added transport.
static Data getHostAddress()
Get one of the IP address for this host (calls through to gethostbyname) and is not threadsafe.
void shutdown()
perform orderly shutdown
void abandonServerTransaction(const Data &tid)
Tells the stack that the TU has abandoned a server transaction.
void onReload()
reload configuration
virtual unsigned int getTimeTillNextProcessMS()
Returns time in milliseconds when process next needs to be called.
void terminateFlow(const resip::Tuple &flow)
void logDnsCache()
Log the DNS Cache to WarningLog for Debugging.
void post(std::unique_ptr< ApplicationMessage > message, unsigned int secondsLater, TransactionUser *tu=0)
Makes the message available to the TU at some later time, specified in seconds.
void sendTo(std::unique_ptr< SipMessage > msg, const Uri &uri, TransactionUser *tu=0)
this is only if you want to send to a destination not in the route.
void unregisterTransactionUser(TransactionUser &)
Removes a TU from the TU selection chain.
virtual void buildFdSet(FdSet &fdset)
Build the FD set to use in a select to find out when process(FdSet&) must be called again.
void requestTransactionUserShutdown(TransactionUser &)
Queue a shutdown request to the specified TU.
void setTransportSipMessageLoggingHandler(std::shared_ptr< Transport::SipMessageLoggingHandler > handler)
Used by the application to provide a handler that will get called for all inbound and outbound SIP me...
SipStack(const SipStackOptions &options)
Constructor.
void zeroOutStatistics()
Resets all of the cumulative statistics counters.
const Uri & getUri() const
Get one of the domains/ports that are handled by this stack in Uri form.
void enableFlowTimer(const resip::Tuple &flow)
void run()
Causes this SipStack object to create and run threads for carrying out processing.
bool pollStatistics()
Immediately polls for statistics to be logged and sent to external handlers, instead of waiting for n...
bool hasMessage() const
does the stack have new messages for the TU?
void reloadDnsServers()
Check if DnsServers list has changed, and if so reinitializes the DNS resolver (ares).
void postMS(std::unique_ptr< ApplicationMessage > message, unsigned int ms, TransactionUser *tu=0)
Makes the message available to the TU at some later time, specified in milli-seconds.
virtual void processTimers()
Check all timers.
Message * receiveAny()
retrieve a message off the old TuFifo
void setInterval(unsigned long intvSecs)
static const int DefaultSipPort
unsigned int msTillNextTimer()
provides the time in milliseconds before the next timer will fire
virtual uint64_t process()
gets the set of timers that have fired, and inserts TimerMsg into the state machine fifo and applicat...
static unsigned getMaxSystemTimeWaitMs(void)
On windows, change getSystemTime() to not use the actual clock time returned by ::GetSystemTime().
static uint64_t getTimeMs()
Returns the current clock time in milliseconds.
void invokeAfterSocketCreationFunc(TransportType type)
void addTransport(std::unique_ptr< Transport > transport)
void send(SipMessage *msg)
void cancelClientInviteTransaction(const Data &tid, const resip::Tokens *reasons)
TransportSelector & transportSelector()
void process(int timeout=0)
unsigned int getTimeTillNextProcessMS()
static unsigned int MaxTUFifoTimeDepthSecs
void abandonServerTransaction(const Data &tid)
void enableFlowTimer(const resip::Tuple &flow)
void removeTransport(unsigned int transportKey)
static unsigned int MaxTUFifoSize
void registerMarkListener(MarkListener *listener)
void unregisterMarkListener(MarkListener *listener)
void terminateFlow(const resip::Tuple &flow)
The base-class for an RFC 3261 Transaction User.
unsigned int getTimeTillNextProcessMS()
void removeTransport(unsigned int transportKey)
void addTransport(std::unique_ptr< Transport > transport, bool isStackRunning)
Add/Remove a transport.
void setPollGrp(FdPollGrp *pollGrp)
Configure a PollGrp to use (instead of buildFdSet/process) Must be called before adding any transport...
void process(FdSet &fdset)
Calls process on all suitable transports NOTE that TransportSelector no longer handles DNSInterface N...
Fifo< TransactionMessage > & stateMacFifo()
General exception class for Transport.
The base class for Transport classes.
IpVersion ipVersion() const
const Data & interfaceName() const
uint64_t add(unsigned int timeMs, Message *payload)
void requestTransactionUserShutdown(TransactionUser &)
void add(Message *msg, TimeLimitFifo< Message >::DepthUsage usage)
void setFallbackPostNotify(AsyncProcessHandler *handler)
unsigned int getTimeTillNextProcessMS()
void unregisterTransactionUser(TransactionUser &)
void registerTransactionUser(TransactionUser &, const bool front=false)
Represents a network address.
static const Data & toData(TransportType)
Converts the TransportType to a string representation of the transport type, e.g.
TransportKey mTransportKey
A Transport based on UDP.
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
void unregisterMarkListener(MarkListener *listener)
Removed a registered BlacklistListener handler from the DNS Interface for a particualr Resource Recor...
volatile bool & statisticsManagerEnabled()
Enable Statistics Manager.
void addAlias(const Data &domain, int port)
add an alias for this sip element
void registerMarkListener(MarkListener *listener)
Register a handler with the DNS Interface for notifications of when a Dns Resource Record has been bl...
void setEnumSuffixes(const std::vector< Data > &suffixes)
Specify which enum domains will be searched when sending.
void setEnumDomains(const std::map< Data, Data > &domains)
Specify which domains in the To: Uri will be subject to ENUM.
void removeAlias(const Data &domain, int port)
removes an alias from this sip element
void setStatisticsInterval(unsigned long seconds)
Sets the interval that determines the time between Statistics messages.
TlsClientVerificationMode
SSLType
Note: Before adding to the SSLType enum, please see the comments about mTlsCtx in resip/stack/ssl/Sec...
dcm! – add UnusedChecking(_enum) below;
const _Tp & resipMin(const _Tp &__a, const _Tp &__b)
InserterClass< T > Inserter(const T &t)
Templatized function to construct an instance of InserterClass for a container to be inserted.
void(* AfterSocketCreationFuncPtr)(Socket s, int transportType, const char *file, int line)
void initNetwork()
set up network - does nothing in unix but needed for windows
std::unique_lock< Mutex > Lock
A convenience class to lock a Lockable (such as a Mutex) on object creation, and unlock on destructio...
bool isSecure(TransportType type)
Returns true if passed in transport type is a secure transport protocol.
TransportType
An enumeration of transport protocols.
IpVersion
An enumeration of IP versions.
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)