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,
317 const char * mixerURI = NULL,
318 const char * localURI = NULL
320 #endif // OPAL_HAS_MIXER
328 const PString & token
329 ) {
return activeCalls.FindWithLock(token, PSafeReference) != NULL; }
348 const PString & token,
349 PSafetyMode mode = PSafeReadWrite
350 )
const {
return activeCalls.FindWithLock(token, mode); }
371 const PString & token
384 const PString & token,
386 PSyncPoint * sync = NULL
397 const PString & token,
470 RouteEntry(
const PString & partyA,
const PString & partyB,
const PString & dest);
474 void PrintOn(ostream & strm)
const;
477 bool IsMatch(
const PString & search)
const;
614 const PStringArray & specs
622 const RouteTable & table
637 const PString & source,
638 const PString & destination,
649 PStringSet & routesTried,
650 const PString & a_party,
651 const PString & b_party,
697 const PString & party,
698 void * userData = NULL,
699 unsigned int options = 0,
809 virtual OpalConnection::AnswerCallResponse
OnAnswerCall(
811 const PString & caller
884 const PString & remoteParty
934 const PStringToString & info
1068 const PString & token1,
1069 const PString & token2,
1071 unsigned sessionID = 0,
1078 unsigned sessionID = 0
1095 PVideoInputDevice * & device,
1096 PBoolean & autoDelete
1106 PVideoOutputDevice * & device,
1107 PBoolean & autoDelete
1120 PBoolean requiresPatchThread =
true
1173 const PString & value
1192 const char * terminators =
"YX#\r\n",
1193 unsigned lastDigitTimeout = 4,
1194 unsigned firstDigitTimeout = 30
1211 const PString & callToken,
1212 const PFilePath & filename,
1219 const PString & callToken
1227 const PString & callToken
1260 const PString & body
1266 const PString & type,
1267 const PString & body,
1269 PString & conversationId
1324 const PString & party,
1326 const PString & extraInfo
1345 const PString & name = PString::Empty()
1359 const PString & uri,
1372 const PString & newChairURI,
1393 virtual bool ApplySSLCredentials(
1395 PSSLContext & context,
1401 const PString & GetSSLCertificateAuthorityFiles()
const {
return m_caFiles; }
1405 void SetSSLCertificateAuthorityFiles(
const PString & files) { m_caFiles = files; }
1409 const PString & GetSSLCertificateFile()
const {
return m_certificateFile; }
1413 void SetSSLCertificateFile(
const PString & file) { m_certificateFile = file; }
1417 const PString & GetSSLPrivateKeyFile()
const {
return m_privateKeyFile; }
1421 void SetSSLPrivateKeyFile(
const PString & file) { m_privateKeyFile = file; }
1425 void SetSSLAutoCreateCertificate(
bool yes) { m_autoCreateCertificate = yes; }
1435 const PIPSocket::Address & remoteAddress
1457 const PIPSocket::Address & localAddr,
1458 const PIPSocket::Address & peerAddr,
1459 const PIPSocket::Address & signalAddr,
1470 PIPSocket::Address & localAddress,
1471 const PIPSocket::Address & remoteAddress
1477 PNatStrategy & GetNatMethods()
const {
return *m_natMethods; }
1484 virtual PNatMethod * GetNatMethod(
1485 const PIPSocket::Address & remoteAddress = PIPSocket::GetDefaultIpAny()
1491 const PString & method,
1492 const PString & server
1497 PString GetNATServer()
const
1499 return (m_natMethod == NULL) ? PString::Empty() : m_natMethod->GetServer();
1504 P_DEPRECATED PString GetTranslationHost()
const;
1508 P_DEPRECATED
bool SetTranslationHost(
1509 const PString & host
1514 P_DEPRECATED PIPSocket::Address GetTranslationAddress()
const;
1518 P_DEPRECATED
void SetTranslationAddress(
1519 const PIPSocket::Address & address
1524 P_DEPRECATED
bool HasTranslationAddress()
const;
1531 P_DEPRECATED PSTUNClient::NatTypes SetSTUNServer(
1532 const PString & server
1534 return SetNATServer(PSTUNClient::GetNatMethodName(), server) ? m_natMethod->GetNatType() : PSTUNClient::UnknownNat;
1539 P_DEPRECATED PString GetSTUNServer()
const
1541 return (dynamic_cast<PSTUNClient *>(m_natMethod) == NULL) ? PString::Empty() : m_natMethod->GetServer();
1546 P_DEPRECATED PSTUNClient * GetSTUNClient()
const {
return dynamic_cast<PSTUNClient *
>(m_natMethod); }
1560 void SetTCPPorts(
unsigned tcpBase,
unsigned tcpMax);
1576 void SetUDPPorts(
unsigned udpBase,
unsigned udpMax);
1661 bool updateAll =
true
1671 const PString & name,
1672 bool updateAll =
true
1682 const PString & name,
1683 bool updateAll =
true
1751 const PStringArray & order
1767 const PStringArray & mask
1783 virtual void SetEchoCancelParams(
1785 ) { echoCancelParams = params; }
1802 const PVideoDevice::OpenArgs & deviceArgs
1818 const PVideoDevice::OpenArgs & deviceArgs
1834 const PVideoDevice::OpenArgs & deviceArgs
1860 const PTimeInterval & newInterval
1870 const PTimeInterval & newInterval
1880 const PTimeInterval & newInterval
1890 const PString & server
1939 PScriptLanguage * GetScript()
const {
return m_script; }
1944 const PString & script,
1945 const char * language =
"Lua"
1947 #endif // OPAL_SCRIPT
2010 PFilePath m_certificateFile;
2011 PFilePath m_privateKeyFile;
2012 bool m_autoCreateCertificate;
2016 PNatStrategy * m_natMethods;
2017 PNatMethod * m_natMethod;
2018 PDECLARE_InterfaceNotifier(
OpalManager, OnInterfaceChange);
2019 PInterfaceMonitor::Notifier m_onInterfaceChange;
2032 class CallDict :
public PSafeDictionary<PString, OpalCall>
2040 #if OPAL_HAS_PRESENCE
2041 PSafeDictionary<PString, OpalPresentity> m_presentities;
2042 #endif // OPAL_HAS_PRESENCE
2060 PScriptLanguage * m_script;
2069 P_REMOVE_VIRTUAL_VOID(
OnMessageReceived(
const PURL&,
const PString&,
const PURL&,
const PString&,
const PString&,
const PString&));
2081 #endif // OPAL_OPAL_MANAGER_H