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>
62 class PSSLCertificate;
66 #define OPAL_SCRIPT_CALL_TABLE_NAME "OpalCall"
181 const PString & prefix = PString::Empty()
188 const PString & prefix
197 const PString & prefix
203 const PString & prefix
233 #if OPAL_HAS_PRESENCE
242 virtual PSafePtr<OpalPresentity> AddPresentity(
243 const PString & presentity
248 virtual PSafePtr<OpalPresentity> GetPresentity(
249 const PString & presentity,
250 PSafetyMode mode = PSafeReference
255 virtual PStringList GetPresentities()
const;
259 virtual bool RemovePresentity(
260 const PString & presentity
263 #endif // OPAL_HAS_PRESENCE
285 const PString & partyA,
286 const PString & partyB,
287 void * userData = NULL,
288 unsigned options = 0,
292 const PString & partyA,
293 const PString & partyB,
295 void * userData = NULL,
296 unsigned options = 0,
306 const PString & token
307 ) {
return activeCalls.FindWithLock(token, PSafeReference) != NULL; }
326 const PString & token,
327 PSafetyMode mode = PSafeReadWrite
328 )
const {
return activeCalls.FindWithLock(token, mode); }
349 const PString & token
362 const PString & token,
364 PSyncPoint * sync = NULL
375 const PString & token,
448 RouteEntry(
const PString & partyA,
const PString & partyB,
const PString & dest);
452 void PrintOn(ostream & strm)
const;
455 bool IsMatch(
const PString & search)
const;
592 const PStringArray & specs
600 const RouteTable & table
615 const PString & source,
616 const PString & destination,
627 PStringSet & routesTried,
628 const PString & a_party,
629 const PString & b_party,
675 const PString & party,
676 void * userData = NULL,
677 unsigned int options = 0,
787 virtual OpalConnection::AnswerCallResponse
OnAnswerCall(
789 const PString & caller
862 const PString & remoteParty
912 const PStringToString & info
1046 const PString & token1,
1047 const PString & token2,
1049 unsigned sessionID = 0,
1056 unsigned sessionID = 0
1073 PVideoInputDevice * & device,
1074 PBoolean & autoDelete
1084 PVideoOutputDevice * & device,
1085 PBoolean & autoDelete
1098 PBoolean requiresPatchThread =
true
1151 const PString & value
1170 const char * terminators =
"YX#\r\n",
1171 unsigned lastDigitTimeout = 4,
1172 unsigned firstDigitTimeout = 30
1189 const PString & callToken,
1190 const PFilePath & filename,
1197 const PString & callToken
1205 const PString & callToken
1238 const PString & body
1244 const PString & type,
1245 const PString & body,
1247 PString & conversationId
1302 const PString & party,
1304 const PString & extraInfo
1323 const PString & name = PString::Empty()
1337 const PString & uri,
1350 const PString & newChairURI,
1371 virtual bool ApplySSLCredentials(
1373 PSSLContext & context,
1379 const PString & GetSSLCertificateAuthorityFiles()
const {
return m_caFiles; }
1383 void SetSSLCertificateAuthorityFiles(
const PString & files) { m_caFiles = files; }
1387 const PString & GetSSLCertificateFile()
const {
return m_certificateFile; }
1391 void SetSSLCertificateFile(
const PString & file) { m_certificateFile = file; }
1395 const PString & GetSSLPrivateKeyFile()
const {
return m_privateKeyFile; }
1399 void SetSSLPrivateKeyFile(
const PString & file) { m_privateKeyFile = file; }
1403 void SetSSLAutoCreateCertificate(
bool yes) { m_autoCreateCertificate = yes; }
1413 const PIPSocket::Address & remoteAddress
1435 const PIPSocket::Address & localAddr,
1436 const PIPSocket::Address & peerAddr,
1437 const PIPSocket::Address & signalAddr,
1448 PIPSocket::Address & localAddress,
1449 const PIPSocket::Address & remoteAddress
1455 PNatStrategy & GetNatMethods()
const {
return *m_natMethods; }
1462 virtual PNatMethod * GetNatMethod(
1463 const PIPSocket::Address & remoteAddress = PIPSocket::GetDefaultIpAny()
1469 const PString & method,
1470 const PString & server
1475 PString GetNATServer()
const
1477 return (m_natMethod == NULL) ? PString::Empty() : m_natMethod->GetServer();
1482 P_DEPRECATED PString GetTranslationHost()
const;
1486 P_DEPRECATED
bool SetTranslationHost(
1487 const PString & host
1492 P_DEPRECATED PIPSocket::Address GetTranslationAddress()
const;
1496 P_DEPRECATED
void SetTranslationAddress(
1497 const PIPSocket::Address & address
1502 P_DEPRECATED
bool HasTranslationAddress()
const;
1509 P_DEPRECATED PSTUNClient::NatTypes SetSTUNServer(
1510 const PString & server
1512 return SetNATServer(PSTUNClient::GetNatMethodName(), server) ? m_natMethod->GetNatType() : PSTUNClient::UnknownNat;
1517 P_DEPRECATED PString GetSTUNServer()
const
1519 return (dynamic_cast<PSTUNClient *>(m_natMethod) == NULL) ? PString::Empty() : m_natMethod->GetServer();
1524 P_DEPRECATED PSTUNClient * GetSTUNClient()
const {
return dynamic_cast<PSTUNClient *
>(m_natMethod); }
1538 void SetTCPPorts(
unsigned tcpBase,
unsigned tcpMax);
1554 void SetUDPPorts(
unsigned udpBase,
unsigned udpMax);
1639 bool updateAll =
true
1649 const PString & name,
1650 bool updateAll =
true
1660 const PString & name,
1661 bool updateAll =
true
1729 const PStringArray & order
1745 const PStringArray & mask
1761 virtual void SetEchoCancelParams(
1763 ) { echoCancelParams = params; }
1780 const PVideoDevice::OpenArgs & deviceArgs
1796 const PVideoDevice::OpenArgs & deviceArgs
1812 const PVideoDevice::OpenArgs & deviceArgs
1838 const PTimeInterval & newInterval
1848 const PTimeInterval & newInterval
1858 const PTimeInterval & newInterval
1868 const PString & server
1917 PScriptLanguage * GetScript()
const {
return m_script; }
1922 const PString & script,
1923 const char * language =
"Lua"
1925 #endif // OPAL_SCRIPT
1988 PFilePath m_certificateFile;
1989 PFilePath m_privateKeyFile;
1990 bool m_autoCreateCertificate;
1994 PNatStrategy * m_natMethods;
1995 PNatMethod * m_natMethod;
1996 PDECLARE_InterfaceNotifier(
OpalManager, OnInterfaceChange);
1997 PInterfaceMonitor::Notifier m_onInterfaceChange;
2010 class CallDict :
public PSafeDictionary<PString, OpalCall>
2018 #if OPAL_HAS_PRESENCE
2019 PSafeDictionary<PString, OpalPresentity> m_presentities;
2020 #endif // OPAL_HAS_PRESENCE
2038 PScriptLanguage * m_script;
2047 P_REMOVE_VIRTUAL_VOID(
OnMessageReceived(
const PURL&,
const PString&,
const PURL&,
const PString&,
const PString&,
const PString&));
2059 #endif // OPAL_OPAL_MANAGER_H