35 #ifndef OPAL_OPAL_CONNECTION_H
36 #define OPAL_OPAL_CONNECTION_H
48 #include <ptclib/dtmf.h>
49 #include <ptlib/safecoll.h>
54 #include <ptclib/script.h>
62 class OpalEchoCanceler;
68 #define OPAL_URL_PARAM_PREFIX "OPAL-"
69 #define OPAL_MAKE_URL_PARAM(opt) ";" OPAL_URL_PARAM_PREFIX opt
70 #define OPAL_MAKE_URL_PARAM2(opt, val) OPAL_MAKE_URL_PARAM(opt) "=" val
72 #define OPAL_OPT_AUTO_START "AutoStart"
77 #define OPAL_OPT_CALL_IDENTIFIER "Call-Identifier"
78 #define OPAL_OPT_CALLING_PARTY_URL "Calling-Party-URL"
79 #define OPAL_OPT_CALLING_PARTY_NUMBER "Calling-Party-Number"
80 #define OPAL_OPT_CALLING_PARTY_NAME "Calling-Party-Name"
81 #define OPAL_OPT_CALLING_PARTY_DOMAIN "Calling-Party-Domain"
82 #define OPAL_OPT_CALLING_DISPLAY_NAME "Calling-Display-Name"
83 #define OPAL_OPT_CALLED_PARTY_NAME "Called-Party-Name"
84 #define OPAL_OPT_CALLED_DISPLAY_NAME "Called-Display-Name"
85 #define OPAL_OPT_REDIRECTING_PARTY "Redirecting-Party"
86 #define OPAL_OPT_PRESENTATION_BLOCK "Presentation-Block"
87 #define OPAL_OPT_ORIGINATOR_ADDRESS "Originator-Address"
88 #define OPAL_OPT_INTERFACE "Interface"
89 #define OPAL_OPT_USER_INPUT_MODE "User-Input-Mode"
91 #define OPAL_OPT_ENABLE_INBAND_DTMF "EnableInbandDTMF"
92 #define OPAL_OPT_ENABLE_INBAND_DTMF "EnableInbandDTMF"
93 #define OPAL_OPT_DETECT_INBAND_DTMF "DetectInBandDTMF"
94 #define OPAL_OPT_SEND_INBAND_DTMF "SendInBandDTMF"
95 #define OPAL_OPT_DTMF_MULT "dtmfmult"
96 #define OPAL_OPT_DTMF_DIV "dtmfdiv"
97 #define OPAL_OPT_DISABLE_JITTER "Disable-Jitter"
98 #define OPAL_OPT_MAX_JITTER "Max-Jitter"
99 #define OPAL_OPT_MIN_JITTER "Min-Jitter"
100 #define OPAL_OPT_RECORD_AUDIO "Record-Audio"
101 #define OPAL_OPT_ALERTING_TYPE "Alerting-Type"
102 #define OPAL_OPT_REMOVE_CODEC "Remove-Codec"
108 #define OPAL_OPT_SILENCE_DETECT_MODE "Silence-Detect"
130 #define OPAL_OPT_VIDUP_METHODS "Video-Update-Picture-Method"
131 #define OPAL_OPT_VIDUP_METHOD_OOB 1
132 #define OPAL_OPT_VIDUP_METHOD_RTCP 2
133 #define OPAL_OPT_VIDUP_METHOD_PLI 4
134 #define OPAL_OPT_VIDUP_METHOD_FIR 8
135 #define OPAL_OPT_VIDUP_METHOD_DEFAULT 3
366 PCaselessString
name;
412 EndedByTransportFail,
417 EndedByCapabilityExchange,
418 EndedByCallForwarded,
419 EndedBySecurityDenial,
421 EndedByLocalCongestion,
423 EndedByRemoteCongestion,
427 EndedByTemporaryFailure,
429 EndedByDurationLimit,
430 EndedByInvalidConferenceID,
432 EndedByNoRingBackTone,
434 EndedByAcceptingCallWaiting,
435 EndedByGkAdmissionFailed,
437 EndedByCallCompletedElsewhere,
438 EndedByCertificateAuthority,
439 EndedByIllegalAddress,
443 struct CallEndReason {
445 CallEndReasonCodes reason = NumCallEndReasons,
450 ) :
code((CallEndReasonCodes)(reason&0xff)),
q931((reason>>8)&0xff) { }
452 __inline
operator CallEndReasonCodes()
const {
return code; }
473 AnswerCallAlertWithMedia,
474 AnswerCallDeferredWithMedia,
476 AnswerCallNowAndReleaseCurrent
540 const PString & token,
541 unsigned options = 0,
598 __inline Phases
GetPhase()
const {
return m_phase; }
601 __inline
bool IsEstablished()
const {
return m_phase == EstablishedPhase; }
604 __inline
bool IsReleased()
const {
return m_phase >= ReleasingPhase; }
652 PSyncPoint * sync = NULL
681 const PString & remoteParty
803 const PString & calleeName,
824 const PString & callerName
838 AnswerCallResponse response
930 const PStringToString & info,
944 CallEndReason reason = EndedByLocalUser,
945 bool synchronous =
false
990 const PString & forwardParty
1073 bool transfer =
false
1076 #if OPAL_T38_CAPABILITY
1079 virtual bool SwitchFaxMediaStreams(
1087 virtual void OnSwitchedFaxMediaStreams(
1096 virtual bool OnSwitchingFaxMediaStreams(
1099 #endif // OPAL_T38_CAPABILITY
1179 const PString & streamID,
1238 const PString & reason
1311 unsigned sessionID = 0,
1337 unsigned sessionID = 0,
1350 #endif // OPAL_VIDEO
1365 unsigned & percentage
1439 SendUserInputAsQ931,
1440 SendUserInputAsString,
1441 SendUserInputAsTone,
1442 SendUserInputAsRFC2833,
1443 SendUserInputAsInlineRFC2833 = SendUserInputAsRFC2833,
1444 SendUserInputInBand,
1445 SendUserInputAsProtocolDefault
1470 const PString & value
1488 unsigned duration = 0
1498 const PString & value
1525 unsigned duration = 500
1531 unsigned timeout = 30
1539 const PString & input
1545 const char * terminators =
"YX#\r\n",
1546 unsigned lastDigitTimeout = 4,
1547 unsigned firstDigitTimeout = 30
1602 const PString & newChairURI,
1858 OpalEchoCanceler * GetEchoCanceler()
const {
return echoCanceler; }
1928 PMutex m_phaseMutex;
1952 OpalEchoCanceler * echoCanceler;
1967 PDTMFDecoder m_dtmfDecoder;
1968 bool m_detectInBandDTMF;
1969 unsigned m_dtmfScaleMultiplier;
1970 unsigned m_dtmfScaleDivisor;
1971 PNotifier m_dtmfDetectNotifier;
1974 bool m_sendInBandDTMF;
1976 PBYTEArray m_inBandDTMF;
1977 PINDEX m_emittedInBandDTMF;
1978 PMutex m_inBandMutex;
1979 PNotifier m_dtmfSendNotifier;
2001 PString m_scriptTableName;
2003 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptSetOption);
2004 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptGetLocalPartyURL);
2005 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptGetRemotePartyURL);
2006 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptGetCalledPartyURL);
2007 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptGetRedirectingParty);
2008 #endif // OPAL_SCRIPT
2024 P_REMOVE_VIRTUAL(PBoolean, IsConnectionOnHold(),
false);
2025 P_REMOVE_VIRTUAL_VOID(OnMediaPatchStart(
unsigned,
bool));
2026 P_REMOVE_VIRTUAL_VOID(OnMediaPatchStop(
unsigned,
bool));
2031 P_REMOVE_VIRTUAL(
bool, HoldConnection(),
false);
2032 P_REMOVE_VIRTUAL(
bool, RetrieveConnection(),
false);
2033 P_REMOVE_VIRTUAL(
bool, IsConnectionOnHold(
bool),
false);
2035 P_REMOVE_VIRTUAL(PBoolean, IsMediaBypassPossible(
unsigned)
const,
false);
2041 P_REMOVE_VIRTUAL_VOID(OnSwitchedFaxMediaStreams(
bool));
2045 P_REMOVE_VIRTUAL(PNatMethod *, GetNatMethod(
const PIPSocket::Address &)
const,NULL);
2047 P_REMOVE_VIRTUAL(
bool,Hold(
bool,
bool),
false);
2050 #endif // OPAL_OPAL_CONNECTION_H