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>
68 #define OPAL_URL_PARAM_PREFIX "OPAL-"
70 #define OPAL_OPT_AUTO_START "AutoStart"
71 #define OPAL_OPT_CALL_IDENTIFIER "Call-Identifier"
72 #define OPAL_OPT_CALLING_PARTY_URL "Calling-Party-URL"
73 #define OPAL_OPT_CALLING_PARTY_NUMBER "Calling-Party-Number"
74 #define OPAL_OPT_CALLING_PARTY_NAME "Calling-Party-Name"
75 #define OPAL_OPT_CALLING_PARTY_DOMAIN "Calling-Party-Domain"
76 #define OPAL_OPT_CALLING_DISPLAY_NAME "Calling-Display-Name"
77 #define OPAL_OPT_CALLED_PARTY_NAME "Called-Party-Name"
78 #define OPAL_OPT_CALLED_DISPLAY_NAME "Called-Display-Name"
79 #define OPAL_OPT_REDIRECTING_PARTY "Redirecting-Party"
80 #define OPAL_OPT_PRESENTATION_BLOCK "Presentation-Block"
81 #define OPAL_OPT_ORIGINATOR_ADDRESS "Originator-Address"
82 #define OPAL_OPT_INTERFACE "Interface"
83 #define OPAL_OPT_USER_INPUT_MODE "User-Input-Mode"
85 #define OPAL_OPT_ENABLE_INBAND_DTMF "EnableInbandDTMF"
86 #define OPAL_OPT_ENABLE_INBAND_DTMF "EnableInbandDTMF"
87 #define OPAL_OPT_DETECT_INBAND_DTMF "DetectInBandDTMF"
88 #define OPAL_OPT_SEND_INBAND_DTMF "SendInBandDTMF"
89 #define OPAL_OPT_DTMF_MULT "dtmfmult"
90 #define OPAL_OPT_DTMF_DIV "dtmfdiv"
91 #define OPAL_OPT_DISABLE_JITTER "Disable-Jitter"
92 #define OPAL_OPT_MAX_JITTER "Max-Jitter"
93 #define OPAL_OPT_MIN_JITTER "Min-Jitter"
94 #define OPAL_OPT_RECORD_AUDIO "Record-Audio"
95 #define OPAL_OPT_ALERTING_TYPE "Alerting-Type"
96 #define OPAL_OPT_REMOVE_CODEC "Remove-Codec"
102 #define OPAL_OPT_SILENCE_DETECT_MODE "Silence-Detect"
124 #define OPAL_OPT_VIDUP_METHODS "Video-Update-Picture-Method"
125 #define OPAL_OPT_VIDUP_METHOD_OOB 1
126 #define OPAL_OPT_VIDUP_METHOD_RTCP 2
127 #define OPAL_OPT_VIDUP_METHOD_PLI 4
128 #define OPAL_OPT_VIDUP_METHOD_FIR 8
129 #define OPAL_OPT_VIDUP_METHOD_DEFAULT 3
406 EndedByTransportFail,
411 EndedByCapabilityExchange,
412 EndedByCallForwarded,
413 EndedBySecurityDenial,
415 EndedByLocalCongestion,
417 EndedByRemoteCongestion,
421 EndedByTemporaryFailure,
423 EndedByDurationLimit,
424 EndedByInvalidConferenceID,
426 EndedByNoRingBackTone,
428 EndedByAcceptingCallWaiting,
429 EndedByGkAdmissionFailed,
431 EndedByCallCompletedElsewhere,
432 EndedByCertificateAuthority,
433 EndedByIllegalAddress
438 CallEndReasonCodes reason = NumCallEndReasons,
443 ) :
code((CallEndReasonCodes)(reason&0xff)),
q931((reason>>8)&0xff) { }
445 __inline
operator CallEndReasonCodes()
const {
return code; }
462 AnswerCallAlertWithMedia,
463 AnswerCallDeferredWithMedia,
465 AnswerCallNowAndReleaseCurrent
526 const PString & token,
527 unsigned options = 0,
584 __inline Phases
GetPhase()
const {
return m_phase; }
590 __inline
bool IsReleased()
const {
return m_phase >= ReleasingPhase; }
637 CallEndReason reason = EndedByLocalUser,
638 PSyncPoint * sync = NULL
647 CallEndReason reason = EndedByLocalUser
667 const PString & remoteParty
783 const PString & calleeName,
804 const PString & callerName
818 AnswerCallResponse response
910 const PStringToString & info,
924 CallEndReason reason = EndedByLocalUser,
925 bool synchronous =
false
970 const PString & forwardParty
1047 bool transfer =
false
1050 #if OPAL_T38_CAPABILITY
1053 virtual bool SwitchFaxMediaStreams(
1061 virtual void OnSwitchedFaxMediaStreams(
1070 virtual bool OnSwitchingFaxMediaStreams(
1073 #endif // OPAL_T38_CAPABILITY
1147 const PString & streamID,
1270 unsigned sessionID = 0,
1276 virtual PNatMethod * GetNatMethod(
1277 const PIPSocket::Address & remoteAddress = PIPSocket::GetDefaultIpAny()
1300 PVideoInputDevice * & device,
1301 PBoolean & autoDelete
1310 PVideoOutputDevice * & device,
1311 PBoolean & autoDelete
1317 const PVideoDevice::OpenArgs & device,
1318 unsigned sessionID = 0
1325 const PVideoDevice::OpenArgs & device,
1326 unsigned sessionID = 0,
1327 bool preview =
false
1336 unsigned sessionID = 0,
1364 unsigned & percentage
1438 SendUserInputAsQ931,
1439 SendUserInputAsString,
1440 SendUserInputAsTone,
1441 SendUserInputAsRFC2833,
1442 SendUserInputAsInlineRFC2833 = SendUserInputAsRFC2833,
1443 SendUserInputInBand,
1444 SendUserInputAsProtocolDefault
1469 const PString & value
1490 unsigned duration = 0
1500 const PString & value
1519 unsigned duration = 500
1525 unsigned timeout = 30
1533 const PString & input
1539 const char * terminators =
"YX#\r\n",
1540 unsigned lastDigitTimeout = 4,
1541 unsigned firstDigitTimeout = 30
1596 const PString & newChairURI,
1883 const StringOptions & options,
1917 PMutex m_phaseMutex;
1956 PDTMFDecoder m_dtmfDecoder;
1957 bool m_detectInBandDTMF;
1958 unsigned m_dtmfScaleMultiplier;
1959 unsigned m_dtmfScaleDivisor;
1960 PNotifier m_dtmfDetectNotifier;
1963 bool m_sendInBandDTMF;
1965 PBYTEArray m_inBandDTMF;
1966 PINDEX m_emittedInBandDTMF;
1967 PMutex m_inBandMutex;
1968 PNotifier m_dtmfSendNotifier;
1999 void SetAutoStart(
const PString & mediaType, OpalMediaType::AutoStartMode autoStart);
2006 PString m_scriptTableName;
2008 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptSetOption);
2009 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptGetLocalPartyURL);
2010 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptGetRemotePartyURL);
2011 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptGetCalledPartyURL);
2012 PDECLARE_ScriptFunctionNotifier(
OpalConnection, ScriptGetRedirectingParty);
2013 #endif // OPAL_SCRIPT
2029 P_REMOVE_VIRTUAL(PBoolean, IsConnectionOnHold(),
false);
2030 P_REMOVE_VIRTUAL_VOID(OnMediaPatchStart(
unsigned,
bool));
2031 P_REMOVE_VIRTUAL_VOID(OnMediaPatchStop(
unsigned,
bool));
2036 P_REMOVE_VIRTUAL(
bool, HoldConnection(),
false);
2037 P_REMOVE_VIRTUAL(
bool, RetrieveConnection(),
false);
2038 P_REMOVE_VIRTUAL(
bool, IsConnectionOnHold(
bool),
false);
2040 P_REMOVE_VIRTUAL(PBoolean, IsMediaBypassPossible(
unsigned)
const,
false);
2046 P_REMOVE_VIRTUAL_VOID(OnSwitchedFaxMediaStreams(
bool));
2050 #endif // OPAL_OPAL_CONNECTION_H