1#if defined(HAVE_CONFIG_H)
81#define DEFAULT_TLS_METHOD SecurityTypes::DynamicTLS
88#if defined(USE_POSTGRESQL)
94#define RESIPROCATE_SUBSYSTEM resip::Subsystem::REPRO
111 const Data& messageWithHeaders,
112 const Data& instanceName)
130 InfoLog(<<
"\r\n*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*\r\n"
131 <<
"OUTBOUND: Src=" << source <<
", Dst=" << destination <<
"\r\n\r\n"
133 <<
"*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*");
137 InfoLog(<<
"\r\n*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*\r\n"
138 <<
"OUTBOUND(retransmit): Src=" << source <<
", Dst=" << destination <<
"\r\n\r\n"
140 <<
"*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*");
144 InfoLog(<<
"\r\n*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*v*\r\n"
145 <<
"INBOUND: Src=" << source <<
", Dst=" << destination <<
"\r\n\r\n"
147 <<
"*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*");
157 ConfigParse::NestedConfigMap::iterator it = m.find(configIndex);
160 WarningLog(<<
"Failed to find Database settings for index " << configIndex);
166 if (dbType ==
"berkeleydb")
172 else if (dbType ==
"mysql")
176 if (!mySQLServer.
empty())
178 return new MySqlDb(dbConfig, mySQLServer,
186 ErrLog(<<
"Database" << configIndex <<
" type MySQL support not compiled into repro");
190 else if (dbType ==
"postgresql")
195 if (!postgreSQLConnInfo.
empty() || !postgreSQLServer.
empty())
197 return new PostgreSqlDb(dbConfig, postgreSQLConnInfo, postgreSQLServer,
205 ErrLog(<<
"Database" << configIndex <<
" type PostgreSQL support not compiled into repro");
211 ErrLog(<<
"Database" << configIndex <<
" type '" << dbType <<
"' not supported / invalid");
220 , mThreadedStack(false)
226 , mAsyncProcessHandler(0)
230 , mRuntimeAbstractDb(0)
231 , mRegistrationPersistenceManager(0)
232 , mPublicationPersistenceManager(0)
234 , mAsyncProcessorDispatcher(0)
246 , mRegSyncServerV4(0)
247 , mRegSyncServerV6(0)
248 , mRegSyncServerAMQP(0)
249 , mRegSyncServerThread(0)
250 , mCommandServerThread(0)
251 , mCongestionManager(0)
276 Data defaultConfigFilename(
"repro.config");
284 std::cerr <<
"Error parsing configuration: " << ex << std::endl;
302 std::cerr <<
"Already running, will not start two instances. Please stop existing process and/or delete PID file.";
304 syslog(LOG_DAEMON | LOG_CRIT,
"Already running, will not start two instances. Please stop existing process and/or delete PID file.");
341 InfoLog( <<
"Trying to drop privileges, configured uid = " << runAsUser <<
" gid = " << runAsGroup);
510 mPluginManager->onReload();
571 std::vector<Data> pluginNames;
576 return mPluginManager->loadPlugins(pluginNames);
578 if (pluginNames.empty())
return true;
580 CritLog(<<
"LoadPlugins is specified in the configuration but repro was compiled without plugin support");
589 std::set<Data> values;
593 for(std::set<Data>::iterator it = values.begin();
594 it != values.end(); it++)
596 opts |= Security::parseOpenSSLCTXOption(*it);
609 WarningLog(<<
"Overriding T1! (new value is " << overrideT1 <<
")");
620 if(messageSizeLimit > 0)
622 DebugLog(<<
"Using maximum message size "<< messageSizeLimit <<
" on stream-based transports");
639 cipherList = ciphers;
651 std::vector<Data> caDirNames;
653 for(std::vector<Data>::const_iterator caDir = caDirNames.begin();
654 caDir != caDirNames.end(); caDir++)
658 std::vector<Data> caFileNames;
660 for(std::vector<Data>::const_iterator caFile = caFileNames.begin();
661 caFile != caFileNames.end(); caFile++)
692 std::vector<resip::Data> dnsServersConfig;
694 for(std::vector<resip::Data>::iterator it = dnsServersConfig.begin(); it != dnsServersConfig.end(); it++)
698 InfoLog(<<
"Using DNS Server from config: " << *it);
714 std::vector<Data> enumSuffixes;
716 if (enumSuffixes.size() > 0)
722 std::map<Data,Data> enumDomains;
723 std::vector<Data> _enumDomains;
725 if (enumSuffixes.size() > 0)
727 for(std::vector<Data>::iterator it = _enumDomains.begin(); it != _enumDomains.end(); it++)
729 enumDomains[*it] = *it;
740 if(!captureHost.
empty())
744 auto agent = std::make_shared<HepAgent>(captureHost, capturePort, captureAgentID);
753 bool allTransportsSpecifyRecordRoute=
false;
772 else if(
isEqualNoCase(clientNATDetectionMode,
"PRIVATE_TO_PUBLIC"))
778 if(tcpConnectionGCAge > 0)
784 if(outboundFlowTimer > 0)
787 if(tcpConnectionGCAge == 0)
808 && !(allTransportsSpecifyRecordRoute || !recordRouteUri.
host().
empty()))
810 CritLog(<<
"In order for outbound support, the Record-Route flow-token"
811 " hack, or force-record-route to work, you MUST specify a Record-Route URI. Launching "
816 forceRecordRoute=
false;
823 if(statsLogInterval > 0)
849 WarningLog( <<
"CongestionManagementMetric specified as an unknown value (" << metricData <<
"), defaulting to WAIT_TIME.");
872 if(defaultDatabaseIndex >= 0)
877 CritLog(<<
"Failed to get configuration database");
887 if(!mySQLServer.
empty())
889 WarningLog(<<
"Using deprecated parameter MySQLServer, please update to indexed Database definitions.");
904 if(runtimeDatabaseIndex >= 0)
909 CritLog(<<
"Failed to get runtime database");
917 Data runtimeMySQLServer;
919 if(!runtimeMySQLServer.
empty())
921 WarningLog(<<
"Using deprecated parameter RuntimeMySQLServer, please update to indexed Database definitions.");
934 CritLog(<<
"Failed to open configuration database");
940 CritLog(<<
"Failed to open runtime configuration database");
978 auto profile = std::make_shared<MasterProfile>();
980 profile->clearSupportedMethods();
981 profile->addSupportedMethod(resip::REGISTER);
992 profile->allowBadRegistrationEnabled() =
true;
994#ifdef PACKAGE_VERSION
999 if(!serverText.
empty())
1001 profile->setUserAgent(serverText);
1013 if (registrarEnabled || certServerEnabled || presenceEnabled)
1021 if (registrarEnabled)
1030 methodList.push_back(resip::REGISTER);
1039 if (certServerEnabled)
1047 methodList.push_back(resip::SUBSCRIBE);
1048 methodList.push_back(resip::PUBLISH);
1058 if (presenceEnabled)
1074 methodList.push_back(SUBSCRIBE);
1075 methodList.push_back(PUBLISH);
1121 if(numAsyncProcessorWorkerThreads > 0)
1126 numAsyncProcessorWorkerThreads);
1142 mPluginManager->onRequestProcessorChainPopulated(*
mMonkeys);
1154 mPluginManager->onResponseProcessorChainPopulated(*
mLemurs);
1166 mPluginManager->onTargetProcessorChainPopulated(*
mBaboons);
1181#ifdef PACKAGE_VERSION
1186 if(!serverText.
empty())
1221 StaticRegStore::StaticRegRecordMap::iterator it = staticRegList.begin();
1222 for(; it != staticRegList.end(); it++)
1226 Uri aor(it->second.mAor);
1236 catch(resip::ParseBuffer::Exception& e)
1239 ErrLog(<<
"Failed to apply a static registration due to parse error: " << e);
1250 std::vector<resip::Data> httpServerBindAddresses;
1256 if(httpServerBindAddresses.empty())
1260 httpServerBindAddresses.push_back(
"0.0.0.0");
1264 httpServerBindAddresses.push_back(
"::");
1268 for(std::vector<resip::Data>::iterator it = httpServerBindAddresses.begin(); it != httpServerBindAddresses.end(); it++)
1290 if (!webAdminV4 || !webAdminV4->
isSane())
1292 CritLog(<<
"Failed to start WebAdminV4");
1321 if (!webAdminV6 || !webAdminV6->
isSane())
1323 CritLog(<<
"Failed to start WebAdminV6");
1342 CritLog(<<
"Failed to start any WebAdmin");
1355 std::list<RegSyncServer*> regSyncServerList;
1357 if(!regSyncBrokerTopic.
empty())
1359#ifdef BUILD_QPID_PROTON
1382 if(!regSyncServerList.empty())
1387 if(!regSyncPeerAddress.
empty())
1390 if (remoteRegSyncPort == 0)
1394 if(remoteRegSyncPort != 0)
1397 regSyncPeerAddress, remoteRegSyncPort,
1410 std::vector<resip::Data> commandServerBindAddresses;
1420 if(commandPort != 0)
1422 if(commandServerBindAddresses.empty())
1426 commandServerBindAddresses.push_back(
"0.0.0.0");
1430 commandServerBindAddresses.push_back(
"::");
1434 for(std::vector<resip::Data>::iterator it = commandServerBindAddresses.begin(); it != commandServerBindAddresses.end(); it++)
1440 if(pCommandServerV4->
isSane())
1446 CritLog(<<
"Failed to start CommandServerV4");
1447 delete pCommandServerV4;
1455 if(pCommandServerV6->
isSane())
1461 CritLog(<<
"Failed to start CommandServerV6");
1462 delete pCommandServerV6;
1468#ifdef BUILD_QPID_PROTON
1469 std::vector<resip::Data> commandServerQueues;
1471 for(
Data& brokerUrl : commandServerQueues)
1474 if(pCommandServerQueue->
isSane())
1480 CritLog(<<
"Failed to start CommandServerQueue");
1481 delete pCommandServerQueue;
1485 std::vector<resip::Data> commandServerTopics;
1487 for(
Data& brokerUrl : commandServerTopics)
1490 if(pCommandServerTopic->
isSane())
1496 CritLog(<<
"Failed to start CommandServerTopic");
1497 delete pCommandServerTopic;
1513 auto matcher = std::make_shared<ExtendedDomainMatcher>();
1516 std::vector<Data> configDomains;
1519 for (std::vector<Data>::const_iterator i=configDomains.begin();
1520 i != configDomains.end(); ++i)
1522 InfoLog (<<
"Adding domain " << *i <<
" from command line");
1523 matcher->addDomain(*i);
1531 std::vector<Data> configDomainSuffixes;
1534 for (std::vector<Data>::const_iterator i=configDomainSuffixes.begin();
1535 i != configDomainSuffixes.end(); ++i)
1537 InfoLog (<<
"Adding domain suffix " << *i <<
" from command line");
1538 matcher->addDomainSuffix(*i);
1547 for (ConfigStore::ConfigData::const_iterator i=dList.begin();
1548 i != dList.end(); ++i)
1550 InfoLog (<<
"Adding domain " << i->second.mDomain <<
" from config");
1551 matcher->addDomain( i->second.mDomain );
1608 allTransportsSpecifyRecordRoute=
false;
1613 std::shared_ptr<BasicWsConnectionValidator> basicWsConnectionValidator;
1614 std::shared_ptr<WsCookieContextFactory> wsCookieContextFactory;
1615 if(!wsCookieAuthSharedSecret.
empty())
1617 basicWsConnectionValidator = std::make_shared<BasicWsConnectionValidator>(wsCookieAuthSharedSecret);
1622 wsCookieContextFactory = std::make_shared<BasicWsCookieContextFactory>(infoCookieName, extraCookieName, macCookieName);
1629 DebugLog(<<
"Found " << m.size() <<
" interface(s) defined in the advanced format");
1643 allTransportsSpecifyRecordRoute =
true;
1646 for(ConfigParse::NestedConfigMap::iterator it = m.begin();
1650 int idx = it->first;
1652 Data transportPrefix =
"Transport" +
Data(idx);
1653 DebugLog(<<
"checking values for transport: " << idx);
1666 pb.
data(ipAddr, anchor);
1670 pb.
data(portData, anchor);
1673 CritLog(<<
"Malformed IP-address found in " << transportPrefix <<
"Interface setting: " << ipAddr);
1678 CritLog(<<
"Invalid port found in " << transportPrefix <<
" setting: " << port);
1683 CritLog(<<
"Unknown transport type found in " << transportPrefix <<
"Type setting: " << tc.
getConfigData(
"Type",
"UDP"));
1702 if(!tlsCertificate.
empty())
1706 if(!tlsPrivateKey.
empty())
1719 tlsPrivateKeyPassPhrase,
1722 tlsCertificate, tlsPrivateKey,
1725 basicWsConnectionValidator, wsCookieContextFactory);
1732#if defined(RESIP_SIPSTACK_HAVE_FDPOLL)
1742 if(!recordRouteUri.
empty())
1760 InfoLog (<<
"Transport specific record-route enabled (generated): " << rr);
1766 InfoLog (<<
"Transport specific record-route enabled: " << rr);
1771 ErrLog (<<
"Invalid uri provided in " << transportPrefix <<
"RecordRouteUri setting (ignoring): " << e);
1772 allTransportsSpecifyRecordRoute =
false;
1777 allTransportsSpecifyRecordRoute =
false;
1783 CritLog(<<
"Port not specified in " << transportPrefix <<
" setting: expected format is <IPAddress>:<Port>");
1793 if(!isV4Address && !isV6Address)
1795 if (!ipAddress.
empty())
1797 ErrLog(<<
"Malformed IP-address found in IPAddress setting, ignoring (binding to all interfaces): " << ipAddress);
1821 if (tlsPort || wssPort || dtlsPort)
1829 if(!tlsCertificate.
empty())
1833 if(!tlsPrivateKey.
empty())
1852 if (
mUseV4 && isV4Address)
mSipStack->
addTransport(
TLS, tlsPort,
V4,
StunEnabled, ipAddress, tlsDomain, tlsPrivateKeyPassPhrase, sslType, 0, tlsCertificate, tlsPrivateKey, cvm, useEmailAsSIP);
1853 if (
mUseV6 && isV6Address)
mSipStack->
addTransport(
TLS, tlsPort,
V6,
StunEnabled, ipAddress, tlsDomain, tlsPrivateKeyPassPhrase, sslType, 0, tlsCertificate, tlsPrivateKey, cvm, useEmailAsSIP);
1857 if (
mUseV4 && isV4Address)
mSipStack->
addTransport(
WS, wsPort,
V4,
StunEnabled, ipAddress,
Data::Empty,
Data::Empty,
SecurityTypes::NoSSL, 0,
Data::Empty,
Data::Empty,
SecurityTypes::None,
false, basicWsConnectionValidator, wsCookieContextFactory);
1858 if (
mUseV6 && isV6Address)
mSipStack->
addTransport(
WS, wsPort,
V6,
StunEnabled, ipAddress,
Data::Empty,
Data::Empty,
SecurityTypes::NoSSL, 0,
Data::Empty,
Data::Empty,
SecurityTypes::None,
false, basicWsConnectionValidator, wsCookieContextFactory);
1862 if (
mUseV4 && isV4Address)
mSipStack->
addTransport(
WSS, wssPort,
V4,
StunEnabled, ipAddress, tlsDomain, tlsPrivateKeyPassPhrase, sslType, 0, tlsCertificate, tlsPrivateKey, cvm, useEmailAsSIP, basicWsConnectionValidator, wsCookieContextFactory);
1863 if (
mUseV6 && isV6Address)
mSipStack->
addTransport(
WSS, wssPort,
V6,
StunEnabled, ipAddress, tlsDomain, tlsPrivateKeyPassPhrase, sslType, 0, tlsCertificate, tlsPrivateKey, cvm, useEmailAsSIP, basicWsConnectionValidator, wsCookieContextFactory);
1867 if (
mUseV4 && isV4Address)
mSipStack->
addTransport(
DTLS, dtlsPort,
V4,
StunEnabled, ipAddress, tlsDomain, tlsPrivateKeyPassPhrase, sslType, 0, tlsCertificate, tlsPrivateKey);
1868 if (
mUseV6 && isV6Address)
mSipStack->
addTransport(
DTLS, dtlsPort,
V6,
StunEnabled, ipAddress, tlsDomain, tlsPrivateKeyPassPhrase, sslType, 0, tlsCertificate, tlsPrivateKey);
1874 std::cerr <<
"Likely a port is already in use" << endl;
1936 WarningLog(<<
"Could not start RequestFilter Processor due to no worker thread pool (NumAsyncProcessorWorkerThreads=0)");
1945 std::vector<Data> routeSet;
1947 if (routeSet.empty())
1972 WarningLog(<<
"Could not start MessageSilo Processor due to no worker thread pool (NumAsyncProcessorWorkerThreads=0) or Registrar");
1998#ifndef RESIP_FIXED_POINT
2021 (*it)->handleStatisticsMessage(statsMessage);
2027 (*it)->handleStatisticsMessage(statsMessage);
#define WarningLog(args_)
#define DEFAULT_TLS_METHOD
ReproLogger g_ReproLogger
#define resip_assert(x)
This file needs to work for both C and C++ code.
AbstractDb * getDatabase(int configIndex)
virtual bool operator()(Log::Level level, const Subsystem &subsystem, const Data &appName, const char *file, int line, const Data &message, const Data &messageWithHeaders, const Data &instanceName)
return true to also do default logging, false to supress default logging.
virtual void outboundRetransmit(const Tuple &source, const Tuple &destination, const SendData &data)
virtual ~ReproSipMessageLoggingHandler()
virtual void inboundMessage(const Tuple &source, const Tuple &destination, const SipMessage &msg)
virtual void outboundMessage(const Tuple &source, const Tuple &destination, const SipMessage &msg)
virtual std::shared_ptr< resip::DumFeature > getCertificateAuthManager()=0
virtual std::unique_ptr< Processor > getCertificateAuthenticator()=0
virtual std::unique_ptr< Processor > getDigestAuthenticator()=0
virtual resip::Dispatcher * getDispatcher()=0
virtual bool digestAuthEnabled()=0
virtual bool certificateAuthEnabled()=0
virtual void setDum(resip::DialogUsageManager *dum)=0
virtual std::shared_ptr< resip::ServerAuthManager > getServerAuthManager()=0
std::map< resip::Data, AbstractDb::ConfigRecord > ConfigData
const ConfigData & getConfigs() const
void addProcessor(std::unique_ptr< Processor >)
void createDataStore(AbstractDb *db, AbstractDb *runtimedb=0)
virtual AbstractDb * getDatabase(int configIndex)
void setServerText(const resip::Data &text)
void addTransportRecordRoute(unsigned int transportKey, const resip::NameAddr &recordRoute)
void setProxy(Proxy *proxy)
virtual void addRegistrarHandler(RegistrarHandler *handler)
virtual bool run(int argc, char **argv)
virtual void createAuthenticatorFactory()
virtual void createCommandServer()
virtual bool createWebAdmin()
resip::DialogUsageManager * mDum
virtual void setOpenSSLCTXOptionsFromConfig(const resip::Data &configVar, long &opts)
std::list< CommandServer * > mCommandServerList
resip::RegistrationPersistenceManager * mRegistrationPersistenceManager
virtual void makeResponseProcessorChain(repro::ProcessorChain &chain)
std::shared_ptr< resip::DomainMatcher > mDomainMatcher
resip::SipStack * mSipStack
CommandServerThread * mCommandServerThread
resip::ThreadIf * mStackThread
virtual void addDomains(resip::TransactionUser &tu)
RegSyncServerThread * mRegSyncServerThread
ProxyConfig * mProxyConfig
virtual void makeTargetProcessorChain(repro::ProcessorChain &chain)
virtual void addProcessor(repro::ProcessorChain &chain, std::unique_ptr< repro::Processor > processor)
std::list< WebAdmin * > mWebAdminList
virtual bool loadPlugins()
PresenceServer * mPresenceServer
AuthenticatorFactory * mAuthFactory
virtual void makeRequestProcessorChain(repro::ProcessorChain &chain)
resip::FdPollGrp * mFdPollGrp
resip::CongestionManager * mCongestionManager
RegSyncServer * mRegSyncServerV6
resip::ThreadIf * mDumThread
resip::Data mDefaultRealm
RegSyncClient * mRegSyncClient
WebAdminThread * mWebAdminThread
RegSyncServer * mRegSyncServerAMQP
virtual bool createProxy()
resip::PublicationPersistenceManager * mPublicationPersistenceManager
ProcessorChain * mMonkeys
resip::Dispatcher * mAsyncProcessorDispatcher
RegSyncServer * mRegSyncServerV4
virtual void initDomainMatcher()
ProcessorChain * mBaboons
virtual void cleanupObjects()
virtual bool addTransports(bool &allTransportsSpecifyRecordRoute)
virtual void populateRegistrations()
virtual void createRegSync()
virtual bool createDatastore()
virtual bool createSipStack()
virtual bool operator()(resip::StatisticsMessage &statsMessage)
TransportRecordRouteMap mStartupTransportRecordRoutes
virtual void createDialogUsageManager()
AbstractDb * mRuntimeAbstractDb
resip::AsyncProcessHandler * mAsyncProcessHandler
StaticRegRecordMap & getStaticRegList()
std::map< std::pair< resip::Uri, resip::Uri >, StaticRegRecord > StaticRegRecordMap
StaticRegStore mStaticRegStore
static const VersionUtils & instance()
The abstract base-class for all exceptions thrown by resip code.
const Data & getMessage() const noexcept
static long OpenSSLCTXClearOptions
static void setAllowWildcardCertificates(bool bEnable)
void addDomainPrivateKeyPEM(const Data &domainName, const Data &privateKeyPEM, const Data &privateKeyPassPhrase=Data::Empty)
static long OpenSSLCTXSetOptions
Note:
void addDomainCertPEM(const Data &domainName, const Data &certPEM)
virtual void parseConfig(int argc, char **argv, const resip::Data &defaultConfigFilename)
int getConfigInt(const resip::Data &name, int defaultValue) const
NestedConfigMap getConfigNested(const resip::Data &mapsPrefix) const
resip::Data getConfigData(const resip::Data &name, const resip::Data &defaultValue, bool useDefaultIfEmpty=false) const
HashMap< int, NestedConfigParse > NestedConfigMap
unsigned long getConfigUnsignedLong(const resip::Data &name, unsigned long defaultValue) const
bool getConfigBool(const resip::Data &name, bool defaultValue) const
static void setMessageSizeMax(size_t max)
static bool EnableAgressiveGc
Enable Agressive Connection Garbage Collection to have resip perform garbage collection on every new ...
static uint64_t MinimumGcAge
connection must have no inbound traffic for greater than this time (in ms) before it is garbage colle...
static uint64_t MinimumGcHeadroom
If the difference between the number of permitted FDs (reported by periodic calls to getrlimit()) and...
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.
static Data fromFile(const Data &filename)
bool empty() const noexcept
Checks whether the Data is empty.
Data & lowercase()
Converts this Data to lowercase.
int convertInt() const
Takes the contents of the Data and converts them to an integer.
void setServerRegistrationHandler(ServerRegistrationHandler *)
If no such handler, UAS will respond to REGISTER with 405 Method Not Allowed.
void setServerAuthManager(std::shared_ptr< ServerAuthManager > server)
If there is no ServerAuthManager, the server does not authenticate requests.
void setRegistrationPersistenceManager(RegistrationPersistenceManager *)
Sets a manager to handle storage of registration or publication state.
void setMasterProfile(const std::shared_ptr< MasterProfile > &masterProfile)
void addIncomingFeature(std::shared_ptr< DumFeature > feat)
TargetCommand::Target & dumIncomingTarget()
void setPublicationPersistenceManager(PublicationPersistenceManager *)
A generic thread-bank class.
std::vector< GenericIPAddress > NameserverList
static bool isIpV6Address(const Data &ipAddress)
static bool isIpAddress(const Data &ipAddress)
static bool isIpV4Address(const Data &ipAddress)
This class creates a thread in which to run one or more SipStacks.
Interface functor for external logging.
static FdPollGrp * create(const char *implName=NULL)
factory
This is a general-purpose congestion manager.
MetricType
Enumeration of congestion metric types this class supports.
@ WAIT_TIME
The expected service time (the time it takes for new items to be serviced) This is the recommended me...
@ SIZE
The current size of the fifo.
@ TIME_DEPTH
The age of the oldest item in the fifo.
Implementation of a persistence manager.
Implementation of a persistence manager.
static void setAllowInboundFlowTokensForNonDirectClients(bool enabled)
static void setOutboundVersion(int version)
static bool getRRTokenHackEnabled()
static void setRportEnabled(bool enable)
static void setAssumeFirstHopSupportsFlowTokensEnabled(bool enabled)
static void setRRTokenHackEnabled(bool enabled)
static bool getOutboundSupported()
static InteropHelper::ClientNATDetectionMode getClientNATDetectionMode()
static void setClientNATDetectionMode(InteropHelper::ClientNATDetectionMode mode)
@ ClientNATDetectionEnabled
@ ClientNATDetectionDisabled
@ ClientNATDetectionPrivateToPublicOnly
static void setFlowTimerSeconds(unsigned int seconds)
static void setOutboundSupported(bool supported)
static bool getRportEnabled()
static void setAssumeFirstHopSupportsOutboundEnabled(bool enabled)
static void initialize(Type type, Level level, const Data &appName, const char *logFileName=0, ExternalLogger *externalLogger=0, const Data &syslogFacility="LOG_DAEMON", MessageStructure messageStructure=Unstructured, const Data &instanceName="")
std::vector< Data > EventList
std::vector< MethodTypes > MethodList
std::vector< Data > SchemeList
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Provides string-parsing functionality with protection from buffer overflow.
const char * skipBackToChar(char c)
CurrentPosition skipToEnd()
const char * skipBackChar()
CurrentPosition position() const
CurrentPosition skipChar()
void data(Data &data, const char *start) const
make the passed in data share memory with the buffer (uses Data::Share)
virtual update_status_t updateContact(const Uri &aor, const ContactInstanceRecord &rec)=0
void addCADirectory(const Data &caDirectory)
void addCAFile(const Data &caFile)
void dropPrivileges(const Data &runAsUser, const Data &runAsGroup)
void setPidFile(const Data &pidFile)
void installSignalHandler()
bool checkPosixProcessControl(const Data &dependentSettings)
SecurityTypes::TlsClientVerificationMode getConfigClientVerificationMode(const resip::Data &name, SecurityTypes::TlsClientVerificationMode defaultValue)
SecurityTypes::SSLType getConfigSSLType(const resip::Data &name, SecurityTypes::SSLType defaultValue)
bool getConfigValue(const resip::Data &name, resip::Uri &value)
Represents a SIP message.
This is the primary point of interaction between the app-layer and the stack.
void shutdownAndJoinThreads()
Shutdown and join any threads that the SipStack is running.
Security * getSecurity() const
Returns a pointer to the embedded Security object, 0 if not set.
void setExternalStatsHandler(ExternalStatsHandler *handler)
Installs a handler for the stacks internal StatisticsManager.
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 setFixBadCSeqNumbers(bool pFixBadCSeqNumbers)
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 onReload()
reload configuration
void run()
Causes this SipStack object to create and run threads for carrying out processing.
Class used to specify what sub-system given sections of code belong to, for use by the logging system...
static const char * Outbound
static const char * Presence
static const char * Credential
static const char * Certificate
static unsigned long TcpConnectTimeout
static void resetT1(unsigned long t1)
Represents the "token" element in the RFC 3261 grammar.
static uint64_t DnsGreylistDurationMs
The base-class for an RFC 3261 Transaction User.
void setMessageFilterRuleList(MessageFilterRuleList &rules)
Sets this TransactionUser's MessageFilterRuleList.
void setDomainMatcher(std::shared_ptr< DomainMatcher > domainMatcher) noexcept
Replaces the default DomainMatcher.
The base class for Transport classes.
unsigned int getKey() const
virtual void setRcvBufLen(int buflen)
Represents a network address.
static const Data & toDataLower(TransportType type)
static TransportType toTransport(const Data &)
Converts a string representation of transport type, i.e.
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
const Data & param(const ExtensionParameter ¶m) const
Const accessor for non-natively-supported parameter types.
volatile bool & statisticsManagerEnabled()
Enable Statistics Manager.
void setEnumSuffixes(const std::vector< Data > &suffixes)
Specify which enum domains will be searched when sending.
void setFixBadDialogIdentifiers(bool pFixBadDialogIdentifiers)
Specify whether the stack should fix corrupted/changed dialog identifiers (ie, Call-Id and tags) in r...
void setEnumDomains(const std::map< Data, Data > &domains)
Specify which domains in the To: Uri will be subject to ENUM.
void setCongestionManager(CongestionManager *manager)
Sets the CongestionManager used by the stack.
void setStatisticsInterval(unsigned long seconds)
Sets the interval that determines the time between Statistics messages.
This Class is used to implement a primitive form of RPC using loose XML formatting.
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;
bool isEqualNoCase(const Data &left, const Data &right)
std::vector< MessageFilterRule > MessageFilterRuleList
static const uint64_t NeverExpire
bool isSecure(TransportType type)
Returns true if passed in transport type is a secure transport protocol.
TransportType
An enumeration of transport protocols.