32 #ifndef OPAL_OPAL_MANAGER_H
33 #define OPAL_OPAL_MANAGER_H
49 #include <ptclib/pstun.h>
50 #include <ptclib/url.h>
51 #include <ptclib/pxml.h>
52 #include <ptclib/threadpool.h>
56 #include <ptlib/videoio.h>
63 class PSSLCertificate;
67 #define OPAL_SCRIPT_CALL_TABLE_NAME "OpalCall"
182 const PString & prefix = PString::Empty()
189 const PString & prefix
198 const PString & prefix
204 const PString & prefix
205 )
const {
return dynamic_cast<T *
>(
FindEndPoint(prefix)); }
234 #if OPAL_HAS_PRESENCE
243 virtual PSafePtr<OpalPresentity> AddPresentity(
244 const PString & presentity
249 virtual PSafePtr<OpalPresentity> GetPresentity(
250 const PString & presentity,
251 PSafetyMode mode = PSafeReference
256 virtual PStringList GetPresentities()
const;
260 virtual bool RemovePresentity(
261 const PString & presentity
264 #endif // OPAL_HAS_PRESENCE
286 const PString & partyA,
287 const PString & partyB,
288 void * userData = NULL,
289 unsigned options = 0,
293 const PString & partyA,
294 const PString & partyB,
296 void * userData = NULL,
297 unsigned options = 0,
318 const char * mixerURI = NULL,
319 const char * localURI = NULL
321 #endif // OPAL_HAS_MIXER
329 const PString & token
330 ) {
return activeCalls.FindWithLock(token, PSafeReference) != NULL; }
349 const PString & token,
350 PSafetyMode mode = PSafeReadWrite
351 )
const {
return activeCalls.FindWithLock(token, mode); }
398 const PString & token
411 const PString & token,
413 PSyncPoint * sync = NULL
424 const PString & token,
497 RouteEntry(
const PString & partyA,
const PString & partyB,
const PString & dest);
501 void PrintOn(ostream & strm)
const;
504 bool IsMatch(
const PString & search)
const;
645 const PStringArray & specs
653 const RouteTable & table
668 const PString & source,
669 const PString & destination,
680 PStringSet & routesTried,
681 const PString & a_party,
682 const PString & b_party,
728 const PString & party,
729 void * userData = NULL,
730 unsigned int options = 0,
840 virtual OpalConnection::AnswerCallResponse
OnAnswerCall(
842 const PString & caller
915 const PString & remoteParty
965 const PStringToString & info
1001 MediaTransferBypass,
1004 MediaTransferForward,
1007 MediaTransferTranscode
1115 const PString & token1,
1116 const PString & token2,
1118 unsigned sessionID = 0,
1125 unsigned sessionID = 0
1143 const PString & reason
1152 PVideoInputDevice * & device,
1153 PBoolean & autoDelete
1163 PVideoOutputDevice * & device,
1164 PBoolean & autoDelete
1171 const PVideoDevice::OpenArgs & args,
1172 PVideoInputDevice * & device,
1173 PBoolean & autoDelete
1181 const PVideoDevice::OpenArgs & args,
1182 PVideoOutputDevice * & device,
1183 PBoolean & autoDelete
1185 #endif // OPAL_VIDEO
1196 PBoolean requiresPatchThread =
true
1249 const PString & value
1276 const char * terminators =
"YX#\r\n",
1277 unsigned lastDigitTimeout = 4,
1278 unsigned firstDigitTimeout = 30
1295 const PString & callToken,
1296 const PFilePath & filename,
1303 const PString & callToken
1311 const PString & callToken
1344 const PString & body
1350 const PString & type,
1351 const PString & body,
1353 PString & conversationId
1408 const PString & party,
1410 const PString & extraInfo
1429 const PString & name = PString::Empty()
1443 const PString & uri,
1456 const PString & newChairURI,
1477 virtual bool ApplySSLCredentials(
1479 PSSLContext & context,
1485 const PString & GetSSLCertificateAuthorityFiles()
const {
return m_caFiles; }
1489 void SetSSLCertificateAuthorityFiles(
const PString & files) { m_caFiles = files; }
1493 const PString & GetSSLCertificateFile()
const {
return m_certificateFile; }
1497 void SetSSLCertificateFile(
const PString & file) { m_certificateFile = file; }
1501 const PString & GetSSLPrivateKeyFile()
const {
return m_privateKeyFile; }
1505 void SetSSLPrivateKeyFile(
const PString & file) { m_privateKeyFile = file; }
1509 void SetSSLAutoCreateCertificate(
bool yes) { m_autoCreateCertificate = yes; }
1519 const PIPSocket::Address & remoteAddress
1541 const PIPSocket::Address & localAddr,
1542 const PIPSocket::Address & peerAddr,
1543 const PIPSocket::Address & signalAddr,
1554 PIPSocket::Address & localAddress,
1555 const PIPSocket::Address & remoteAddress
1561 PNatMethods & GetNatMethods()
const {
return *m_natMethods; }
1566 const PString & method,
1567 const PString & server,
1569 unsigned priority = 0
1574 PString GetNATServer(
1575 const PString & method = PString::Empty()
1579 void SetTranslationAddress(
const PString & addr) { SetNATServer(
"Fixed", addr); }
1580 PNatMethod::NatTypes SetSTUNServer(
const PString & addr)
1581 {
return SetNATServer(
"STUN", addr) ? GetNatMethods().GetMethodByName(
"STUN")->GetNatType() : PNatMethod::UnknownNat; }
1582 #endif // OPAL_PTLIB_NAT
1594 void SetTCPPorts(
unsigned tcpBase,
unsigned tcpMax);
1612 void SetUDPPorts(
unsigned udpBase,
unsigned udpMax);
1699 bool updateAll =
true
1709 const PString & name,
1710 bool updateAll =
true
1720 const PString & name,
1721 bool updateAll =
true
1789 const PStringArray & order
1805 const PStringArray & mask
1821 virtual void SetEchoCancelParams(
1822 const OpalEchoCanceler::Params & params
1823 ) { echoCancelParams = params; }
1827 const OpalEchoCanceler::Params & GetEchoCancelParams()
const {
return echoCancelParams; }
1837 const PVideoDevice::OpenArgs & deviceArgs,
1838 OpalVideoFormat::ContentRole role = OpalVideoFormat::eNoRole
1844 OpalVideoFormat::ContentRole role = OpalVideoFormat::eNoRole
1855 const PVideoDevice::OpenArgs & deviceArgs,
1856 OpalVideoFormat::ContentRole role = OpalVideoFormat::eNoRole
1863 OpalVideoFormat::ContentRole role = OpalVideoFormat::eNoRole
1874 const PVideoDevice::OpenArgs & deviceArgs,
1875 OpalVideoFormat::ContentRole role = OpalVideoFormat::eNoRole
1882 OpalVideoFormat::ContentRole role = OpalVideoFormat::eNoRole
1903 const PTimeInterval & newInterval
1913 const PTimeInterval & newInterval
1923 const PTimeInterval & newInterval
1933 const PTimeInterval & newInterval
1943 const PString & server
1992 PScriptLanguage * GetScript()
const {
return m_script; }
1997 const PString & script,
1998 const char * language =
"Lua"
2000 #endif // OPAL_SCRIPT
2036 OpalEchoCanceler::Params echoCancelParams;
2049 PFilePath m_certificateFile;
2050 PFilePath m_privateKeyFile;
2051 bool m_autoCreateCertificate;
2055 PNatMethods * m_natMethods;
2056 PDECLARE_InterfaceNotifier(
OpalManager, OnInterfaceChange);
2057 PInterfaceMonitor::Notifier m_onInterfaceChange;
2070 class CallDict :
public PSafeDictionary<PString, OpalCall>
2078 #if OPAL_HAS_PRESENCE
2079 PSafeDictionary<PString, OpalPresentity> m_presentities;
2080 #endif // OPAL_HAS_PRESENCE
2098 PScriptLanguage * m_script;
2107 P_REMOVE_VIRTUAL_VOID(
OnMessageReceived(
const PURL&,
const PString&,
const PURL&,
const PString&,
const PString&,
const PString&));
2111 P_REMOVE_VIRTUAL(PNatMethod *, GetNatMethod(
const PIPSocket::Address &)
const, NULL);
2124 #endif // OPAL_OPAL_MANAGER_H