OPAL Version 3.10.4

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

h323con.h
Go to the documentation of this file.
1 /*
2 * h323con.h
3 *
4 * H.323 protocol handler
5 *
6 * Open H323 Library
7 *
8 * Copyright (c) 1998-2001 Equivalence Pty. Ltd.
9 *
10 * The contents of this file are subject to the Mozilla Public License
11 * Version 1.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.mozilla.org/MPL/
14 *
15 * Software distributed under the License is distributed on an "AS IS"
16 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 * the License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * The Original Code is Open H323 Library.
21 *
22 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23 *
24 * Portions of this code were written with the assisance of funding from
25 * Vovida Networks, Inc. http://www.vovida.com.
26 *
27 * Contributor(s): ______________________________________.
28 *
29 * $Revision: 26728 $
30 * $Author: rjongbloed $
31 * $Date: 2011-12-01 22:59:14 -0600 (Thu, 01 Dec 2011) $
32 */
33
34 #ifndef OPAL_H323_H323CON_H
35 #define OPAL_H323_H323CON_H
36
37 #ifdef P_USE_PRAGMA
38 #pragma interface
39 #endif
40
41 #include <opal/buildopts.h>
42
43 #if OPAL_H323
44
45 #include <opal/rtpconn.h>
46 #include <opal/guid.h>
47 #include <opal/buildopts.h>
48 #include <h323/h323caps.h>
49 #include <ptclib/dtmf.h>
50
51
52 /* The following classes have forward references to avoid including the VERY
53 large header files for H225 and H245. If an application requires access
54 to the protocol classes they can include them, but for simple usage their
55 inclusion can be avoided.
56 */
57 class PPER_Stream;
58 class PASN_OctetString;
59
60 class H225_EndpointType;
61 class H225_TransportAddress;
62 class H225_ArrayOf_PASN_OctetString;
63 class H225_ProtocolIdentifier;
64 class H225_AdmissionRequest;
65 class H225_AdmissionConfirm;
66 class H225_AdmissionReject;
67 class H225_InfoRequestResponse;
68 class H225_DisengageRequest;
69 class H225_FeatureSet;
70
71 class H245_TerminalCapabilitySet;
72 class H245_TerminalCapabilitySetReject;
73 class H245_OpenLogicalChannel;
74 class H245_OpenLogicalChannelAck;
75 class H245_TransportAddress;
76 class H245_UserInputIndication;
77 class H245_RequestMode;
78 class H245_RequestModeAck;
79 class H245_RequestModeReject;
80 class H245_ModeDescription;
81 class H245_ArrayOf_ModeDescription;
82 class H245_SendTerminalCapabilitySet;
83 class H245_MultiplexCapability;
84 class H245_FlowControlCommand;
85 class H245_MiscellaneousCommand;
86 class H245_MiscellaneousIndication;
87 class H245_JitterIndication;
88 class H245_ArrayOf_GenericParameter;
89
90 class H323SignalPDU;
91 class H323ControlPDU;
92 class H323EndPoint;
93 class H323TransportAddress;
94
95 class H235Authenticators;
96
97 class H245NegMasterSlaveDetermination;
98 class H245NegTerminalCapabilitySet;
99 class H245NegLogicalChannels;
100 class H245NegRequestMode;
101 class H245NegRoundTripDelay;
102
103 class H450xDispatcher;
104 class H4502Handler;
105 class H4504Handler;
106 class H4506Handler;
107 class H4507Handler;
108 class H45011Handler;
109
110 class OpalCall;
111
112 #if OPAL_H460
113 class H460_FeatureSet;
114 #endif
115
116
119 #define OPAL_OPT_Q931_BEARER_CAPS "Q931-Bearer-Caps"
120
121
123
130 class H323Connection : public OpalRTPConnection
131 {
132 PCLASSINFO(H323Connection, OpalRTPConnection);
133
134 public:
139 H323Connection(
140 OpalCall & call,
141 H323EndPoint & endpoint,
142 const PString & token,
143 const PString & alias,
144 const H323TransportAddress & address,
145 unsigned options = 0,
146 OpalConnection::StringOptions * stringOptions = NULL
147 );
148
151 ~H323Connection();
153
164 virtual bool IsNetworkConnection() const { return true; }
165
168 virtual PString GetPrefixName() const;
169
171 virtual void OnApplyStringOptions();
172
179 virtual PBoolean SetUpConnection();
180
190 virtual PBoolean SetAlerting(
191 const PString & calleeName,
192 PBoolean withMedia
193 );
194
199 virtual PBoolean SetConnected();
200
205 virtual PBoolean SetProgressed();
206
214 virtual void OnEstablished();
215
233 virtual void OnReleased();
234
239 virtual PString GetDestinationAddress();
240
254 virtual PString GetAlertingType() const;
255
269 virtual bool SetAlertingType(const PString & info);
270
273 unsigned GetProgressIndicator() const { return m_progressIndicator; }
274
277 void SetProgressIndicator(unsigned indicator) { m_progressIndicator = indicator; }
278
286 virtual OpalMediaFormatList GetMediaFormats() const;
287
290 virtual unsigned GetNextSessionID(
291 const OpalMediaType & mediaType,
292 bool isSource
293 );
294
295 #if OPAL_FAX
296
298 virtual bool SwitchFaxMediaStreams(
299 bool enableFax
300 );
301 #endif
302
305 virtual OpalMediaStreamPtr OpenMediaStream(
306 const OpalMediaFormat & mediaFormat,
307 unsigned sessionID,
308 bool isSource
309 );
310
315 virtual bool CloseMediaStream(
316 OpalMediaStream & stream
317 );
318
323 virtual PBoolean GetMediaInformation(
324 unsigned sessionID,
325 MediaInformation & info
326 ) const;
328
333 void AttachSignalChannel(
334 const PString & token,
335 H323Transport * channel,
336 PBoolean answeringCall
337 );
338
341 PBoolean WriteSignalPDU(
342 H323SignalPDU & pdu
343 );
344
348 virtual void HandleSignallingChannel();
349
353 virtual PBoolean HandleSignalPDU(
354 H323SignalPDU & pdu
355 );
356
360 virtual void HandleTunnelPDU(
361 H323SignalPDU * txPDU
362 );
363
371 virtual PBoolean OnReceivedSignalSetup(
372 const H323SignalPDU & pdu
373 );
374
381 virtual PBoolean OnReceivedSignalSetupAck(
382 const H323SignalPDU & pdu
383 );
384
391 virtual PBoolean OnReceivedSignalInformation(
392 const H323SignalPDU & pdu
393 );
394
403 virtual PBoolean OnReceivedCallProceeding(
404 const H323SignalPDU & pdu
405 );
406
415 virtual PBoolean OnReceivedProgress(
416 const H323SignalPDU & pdu
417 );
418
425 virtual PBoolean OnReceivedAlerting(
426 const H323SignalPDU & pdu
427 );
428
437 virtual PBoolean OnReceivedSignalConnect(
438 const H323SignalPDU & pdu
439 );
440
449 virtual PBoolean OnReceivedFacility(
450 const H323SignalPDU & pdu
451 );
452
459 virtual PBoolean OnReceivedSignalNotify(
460 const H323SignalPDU & pdu
461 );
462
469 virtual PBoolean OnReceivedSignalStatus(
470 const H323SignalPDU & pdu
471 );
472
479 virtual PBoolean OnReceivedStatusEnquiry(
480 const H323SignalPDU & pdu
481 );
482
487 virtual void OnReceivedReleaseComplete(
488 const H323SignalPDU & pdu
489 );
490
497 virtual PBoolean OnUnknownSignalPDU(
498 const H323SignalPDU & pdu
499 );
500
507 virtual void OnSendARQ(
508 H225_AdmissionRequest & arq
509 );
510
516 virtual void OnReceivedACF(
517 const H225_AdmissionConfirm & acf
518 );
519
525 virtual void OnReceivedARJ(
526 const H225_AdmissionReject & arj
527 );
528
535 virtual void OnSendIRR(
536 H225_InfoRequestResponse & irr
537 ) const;
538
545 virtual void OnSendDRQ(
546 H225_DisengageRequest & drq
547 ) const;
548
560 virtual PBoolean OnIncomingCall(
561 const H323SignalPDU & setupPDU,
562 H323SignalPDU & alertingPDU
563 );
564
574 virtual PBoolean ForwardCall(
575 const PString & forwardParty
576 );
577
584 virtual bool TransferConnection(
585 const PString & remoteParty
586 );
587
595 virtual bool Hold(
596 bool fromRemote,
597 bool placeOnHold
598 );
599
604 virtual bool IsOnHold(
605 bool fromRemote
606 );
607
608 #if OPAL_H450
609
614 bool TransferCall(
615 const PString & remoteParty,
616 const PString & callIdentity = PString::Empty()
618 );
619
624 void ConsultationTransfer(
625 const PString & primaryCallToken
626 );
627
634 virtual void HandleConsultationTransfer(
635 const PString & callIdentity,
637 H323Connection & incoming
638 );
639
642 PBoolean IsTransferringCall() const;
643
646 PBoolean IsTransferredCall() const;
647
652 virtual void HandleTransferCall(
653 const PString & token,
654 const PString & identity
655 );
656
661 int GetCallTransferInvokeId();
662
670 virtual void HandleCallTransferFailure(
671 const int returnError
672 );
673
678 void SetAssociatedCallToken(
679 const PString & token
680 );
681
686 virtual void OnConsultationTransferSuccess(
687 H323Connection & secondaryCall
688 );
689
694 bool HoldCall(
695 PBoolean localHold
696 );
697
703 bool RetrieveCall();
704
711 void SetHoldMedia(
712 PChannel * audioChannel
713 );
714
717 PBoolean IsMediaOnHold() const;
718
721 PBoolean IsLocalHold() const;
722
725 PBoolean IsRemoteHold() const;
726
729 PBoolean IsCallOnHold() const;
730
735 virtual void IntrudeCall(
736 unsigned capabilityLevel
737 );
738
743 virtual void HandleIntrudeCall(
744 const PString & token,
745 const PString & identity
746 );
747
753 void SetCallIntrusion() { isCallIntrusion = true; }
754
755 PBoolean IsCallIntrusion() { return isCallIntrusion; }
756
759 unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
760
764 virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
765 const PString & callToken,
766 unsigned callIntrusionProtectionLevel
767 );
768
769 virtual void SetIntrusionImpending();
770
771 virtual void SetForcedReleaseAccepted();
772
773 virtual void SetIntrusionNotAuthorized();
774
781 void SendCallWaitingIndication(
782 const unsigned nbOfAddWaitingCalls = 0
783 );
784
785 #endif
786
813 virtual AnswerCallResponse OnAnswerCall(
814 const PString & callerName,
815 const H323SignalPDU & setupPDU,
816 H323SignalPDU & connectPDU,
817 H323SignalPDU & progressPDU
818 );
819
820 virtual AnswerCallResponse OnAnswerCall(
821 const PString & callerName
822 );
823
834 void AnsweringCall(
835 AnswerCallResponse response
836 );
837
848 virtual CallEndReason SendSignalSetup(
849 const PString & alias,
850 const H323TransportAddress & address
851 );
852
864 virtual PBoolean OnSendSignalSetup(
865 H323SignalPDU & setupPDU
866 );
867
876 virtual PBoolean OnSendCallProceeding(
877 H323SignalPDU & callProceedingPDU
878 );
879
891 virtual PBoolean OnSendReleaseComplete(
892 H323SignalPDU & releaseCompletePDU
893 );
894
905 virtual PBoolean OnAlerting(
906 const H323SignalPDU & alertingPDU,
907 const PString & user
908 );
909
924 virtual PBoolean OnInsufficientDigits();
925
938 virtual void SendMoreDigits(
939 const PString & digits
940 );
941
951 virtual PBoolean OnOutgoingCall(
952 const H323SignalPDU & connectPDU
953 );
954
966 virtual PBoolean SendFastStartAcknowledge(
967 H225_ArrayOf_PASN_OctetString & array
968 );
969
981 virtual PBoolean HandleFastStartAcknowledge(
982 const H225_ArrayOf_PASN_OctetString & array
983 );
985
999 virtual PBoolean CreateOutgoingControlChannel(
1000 const H225_TransportAddress & h245Address
1001 );
1002
1015 virtual PBoolean CreateIncomingControlChannel(
1016 H225_TransportAddress & h245Address
1017 );
1018
1023 virtual PBoolean WriteControlPDU(
1024 const H323ControlPDU & pdu
1025 );
1026
1029 virtual PBoolean StartControlNegotiations();
1030
1033 virtual void HandleControlChannel();
1034
1041 virtual PBoolean HandleControlData(
1042 PPER_Stream & strm
1043 );
1044
1051 virtual PBoolean HandleControlPDU(
1052 const H323ControlPDU & pdu
1053 );
1054
1064 virtual PBoolean OnUnknownControlPDU(
1065 const H323ControlPDU & pdu
1066 );
1067
1071 virtual PBoolean OnH245Request(
1072 const H323ControlPDU & pdu
1073 );
1074
1078 virtual PBoolean OnH245Response(
1079 const H323ControlPDU & pdu
1080 );
1081
1085 virtual PBoolean OnH245Command(
1086 const H323ControlPDU & pdu
1087 );
1088
1092 virtual PBoolean OnH245Indication(
1093 const H323ControlPDU & pdu
1094 );
1095
1098 virtual PBoolean OnH245_SendTerminalCapabilitySet(
1099 const H245_SendTerminalCapabilitySet & pdu
1100 );
1101
1106 virtual PBoolean OnH245_FlowControlCommand(
1107 const H245_FlowControlCommand & pdu
1108 );
1109
1114 virtual PBoolean OnH245_MiscellaneousCommand(
1115 const H245_MiscellaneousCommand & pdu
1116 );
1117
1122 virtual PBoolean OnH245_MiscellaneousIndication(
1123 const H245_MiscellaneousIndication & pdu
1124 );
1125
1130 virtual PBoolean OnH245_JitterIndication(
1131 const H245_JitterIndication & pdu
1132 );
1133
1134 #if OPAL_H239
1135
1137 virtual bool OnH239Message(
1138 unsigned subMessage,
1139 const H245_ArrayOf_GenericParameter & params
1140 );
1141
1145 virtual bool OnH239FlowControlRequest(
1146 unsigned logicalChannel,
1147 unsigned bitRate
1148 );
1149
1153 virtual bool OnH239FlowControlResponse(
1154 unsigned logicalChannel,
1155 bool rejected
1156 );
1157
1161 virtual bool OnH239PresentationRequest(
1162 unsigned logicalChannel,
1163 unsigned symmetryBreaking,
1164 unsigned terminalLabel
1165 );
1166
1172 virtual bool SendH239PresentationRequest(
1173 unsigned logicalChannel,
1174 unsigned symmetryBreaking,
1175 unsigned terminalLabel
1176 );
1177
1181 virtual bool OnH239PresentationResponse(
1182 unsigned logicalChannel,
1183 unsigned terminalLabel,
1184 bool rejected
1185 );
1186
1190 virtual bool OnH239PresentationRelease(
1191 unsigned logicalChannel,
1192 unsigned terminalLabel
1193 );
1194
1199 virtual bool SendH239PresentationRelease(
1200 unsigned logicalChannel,
1201 unsigned terminalLabel
1202 );
1203
1207 virtual bool OnH239PresentationIndication(
1208 unsigned logicalChannel,
1209 unsigned terminalLabel
1210 );
1211 #endif
1212
1215 enum ControlProtocolErrors {
1216 e_MasterSlaveDetermination,
1217 e_CapabilityExchange,
1218 e_LogicalChannel,
1219 e_ModeRequest,
1220 e_RoundTripDelay
1221 };
1222
1234 virtual PBoolean OnControlProtocolError(
1235 ControlProtocolErrors errorSource,
1236 const void * errorData = NULL
1237 );
1238
1246 virtual void OnSendCapabilitySet(
1247 H245_TerminalCapabilitySet & pdu
1248 );
1249
1261 virtual PBoolean OnReceivedCapabilitySet(
1262 const H323Capabilities & remoteCaps,
1263 const H245_MultiplexCapability * muxCap,
1264 H245_TerminalCapabilitySetReject & reject
1265 );
1266
1269 virtual bool SendCapabilitySet(
1270 PBoolean empty
1271 );
1272
1275 virtual bool IsSendingCapabilitySet();
1276
1285 virtual void OnSetLocalCapabilities();
1286
1289 PBoolean IsH245Master() const;
1290
1293 void StartRoundTripDelay();
1294
1297 PTimeInterval GetRoundTripDelay() const;
1299
1339 virtual void OnSelectLogicalChannels();
1340
1343 virtual void SelectDefaultLogicalChannel(
1344 const OpalMediaType & mediaType,
1345 unsigned sessionID
1346 );
1347
1351 virtual void SelectFastStartChannels(
1352 unsigned sessionID,
1353 PBoolean transmitter,
1354 PBoolean receiver
1355 );
1356
1360 virtual void StartFastStartChannel(
1361 unsigned sessionID,
1362 H323Channel::Directions direction
1363 );
1364
1379 virtual PBoolean OpenLogicalChannel(
1380 const H323Capability & capability,
1381 unsigned sessionID,
1382 H323Channel::Directions dir
1383 );
1384
1385 virtual void SendFlowControlCommand(
1386 unsigned channelNumber,
1387 unsigned newBitRate
1388 );
1389
1399 virtual PBoolean OnOpenLogicalChannel(
1400 const H245_OpenLogicalChannel & openPDU,
1401 H245_OpenLogicalChannelAck & ackPDU,
1402 unsigned & errorCode
1403 );
1404
1412 virtual PBoolean OnConflictingLogicalChannel(
1413 H323Channel & channel
1414 );
1415
1420 virtual H323Channel * CreateLogicalChannel(
1421 const H245_OpenLogicalChannel & open,
1422 PBoolean startingFast,
1423 unsigned & errorCode
1424 );
1425
1460 virtual H323Channel * CreateRealTimeLogicalChannel(
1461 const H323Capability & capability,
1462 H323Channel::Directions dir,
1463 unsigned sessionID,
1464 const H245_H2250LogicalChannelParameters * param,
1466 RTP_QOS * rtpqos = NULL
1467 );
1468
1472 virtual H323_RTPChannel * CreateRTPChannel(
1473 const H323Capability & capability,
1474 H323Channel::Directions direction,
1475 RTP_Session & rtp
1476 );
1477
1488 virtual PBoolean OnCreateLogicalChannel(
1489 const H323Capability & capability,
1490 H323Channel::Directions dir,
1491 unsigned & errorCode
1492 );
1493
1498 virtual PBoolean OnStartLogicalChannel(
1499 H323Channel & channel
1500 );
1501
1504 virtual void CloseLogicalChannel(
1505 unsigned number,
1506 PBoolean fromRemote
1507 );
1508
1511 virtual void CloseLogicalChannelNumber(
1512 const H323ChannelNumber & number
1513 );
1514
1517 virtual void CloseAllLogicalChannels(
1518 PBoolean fromRemote
1519 );
1520
1526 virtual void OnClosedLogicalChannel(
1527 const H323Channel & channel
1528 );
1529
1538 virtual PBoolean OnClosingLogicalChannel(
1539 H323Channel & channel
1540 );
1541
1550 virtual void OnLogicalChannelFlowControl(
1551 H323Channel * channel,
1552 long bitRateRestriction
1553 );
1554
1563 virtual void OnLogicalChannelJitter(
1564 H323Channel * channel,
1565 DWORD jitter,
1566 int skippedFrameCount,
1567 int additionalBuffer
1568 );
1569
1573 H323Channel * GetLogicalChannel(
1574 unsigned number,
1575 PBoolean fromRemote
1576 ) const;
1577
1583 H323Channel * FindChannel(
1584 unsigned sessionId,
1585 PBoolean fromRemote
1586 ) const;
1588
1595 virtual PBoolean SetBandwidthAvailable(
1596 unsigned newBandwidth,
1597 PBoolean force = false
1598 );
1599
1604 virtual unsigned GetBandwidthUsed() const;
1606
1614 virtual SendUserInputModes GetRealSendUserInputMode() const;
1615
1629 virtual PBoolean SendUserInputString(
1630 const PString & value
1631 );
1632
1657 virtual PBoolean SendUserInputTone(
1658 char tone,
1659 unsigned duration = 0
1660 );
1661
1668 virtual PBoolean SendUserInputIndicationQ931(
1669 const PString & value
1670 );
1671
1678 virtual PBoolean SendUserInputIndicationString(
1679 const PString & value
1680 );
1681
1686 virtual PBoolean SendUserInputIndicationTone(
1687 char tone,
1688 unsigned duration = 0,
1689 unsigned logicalChannel = 0,
1690 unsigned rtpTimestamp = 0
1691 );
1692
1701 virtual PBoolean SendUserInputIndication(
1702 const H245_UserInputIndication & pdu
1703 );
1704
1709 virtual void OnUserInputIndication(
1710 const H245_UserInputIndication & pdu
1711 );
1713
1719 virtual H323_RTP_Session * GetSessionCallbacks(
1720 unsigned sessionID
1721 ) const;
1722
1728 virtual RTP_Session * UseSession(
1729 const OpalTransport & transport,
1730 unsigned sessionID,
1731 const OpalMediaType & mediatype,
1732 RTP_QOS * rtpqos = NULL
1733 );
1734
1742 virtual void OnRTPStatistics(
1743 const RTP_Session & session
1744 ) const;
1745
1749 virtual PString GetSessionCodecNames(
1750 unsigned sessionID
1751 ) const;
1752
1754
1772 virtual PBoolean RequestModeChange(
1773 const PString & newModes
1774 );
1775
1783 virtual PBoolean RequestModeChange(
1784 const H245_ArrayOf_ModeDescription & newModes
1785 );
1786
1789 virtual PBoolean OnRequestModeChange(
1790 const H245_RequestMode & pdu,
1791 H245_RequestModeAck & ack,
1792 H245_RequestModeReject & reject,
1793 PINDEX & selectedMode
1794 );
1795
1802 virtual void OnModeChanged(
1803 const H245_ModeDescription & newMode
1804 );
1805
1810 virtual void OnAcceptModeChange(
1811 const H245_RequestModeAck & pdu
1812 );
1813
1818 virtual void OnRefusedModeChange(
1819 const H245_RequestModeReject * pdu
1820 );
1822
1830 virtual PBoolean RequestModeChangeT38(
1831 const char * capabilityNames = "T.38\nT38FaxUDP"
1832 );
1833
1843 virtual PBoolean GetAdmissionRequestAuthentication(
1844 const H225_AdmissionRequest & arq,
1845 H235Authenticators & authenticators
1846 );
1848
1853 H323EndPoint & GetEndPoint() const { return endpoint; }
1854
1857 PBoolean HadAnsweredCall() const { return !originating; }
1858
1861 PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
1862
1867 unsigned GetDistinctiveRing() const { return distinctiveRing; }
1868
1875 void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
1876
1880 const PString & GetCallToken() const { return GetToken(); }
1881
1884 unsigned GetCallReference() const { return callReference; }
1885
1888 inline const OpalGloballyUniqueID & GetCallIdentifier() const
1889 { return callIdentifier; }
1890
1893 virtual PString GetIdentifier() const;
1894
1897 const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
1898
1901 void SetLocalPartyName(const PString & name);
1902
1905 const PStringList & GetLocalAliasNames() const { return localAliasNames; }
1906
1909 virtual void SetRemotePartyInfo(
1910 const H323SignalPDU & pdu
1911 );
1912
1915 void SetRemoteApplication(
1916 const H225_EndpointType & pdu
1917 );
1918
1923 PString GetRemotePartyURL() const;
1924
1927 const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
1928
1931 const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
1932
1935 unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
1936
1939 const H323Transport * GetSignallingChannel() const { return signallingChannel; }
1940
1943 unsigned GetSignallingVersion() const { return h225version; }
1944
1947 const H323Transport & GetControlChannel() const;
1948
1951 OpalTransport & GetTransport() const;
1952
1955 unsigned GetControlVersion() const { return h245version; }
1956
1959 unsigned GetUUIEsRequested() const { return uuiesRequested; }
1960
1963 void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
1964
1967 const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
1968
1971 void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
1972
1975 const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
1976
1979 void SetDestExtraCallInfo(
1980 const PString & info
1981 ) { destExtraCallInfo = info; }
1982
1985 void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
1986
1992 int GetRemoteCallWaiting() const { return remoteCallWaiting; }
1993
1998 void SetEnforcedDurationLimit(
1999 unsigned seconds
2000 );
2002
2003 #if OPAL_H239
2004
2006 bool GetLocalH239Control() const { return m_h239Control; }
2007
2010 void SetLocalH239Control(
2011 bool on
2012 ) { m_h239Control = on; }
2013
2016 bool GetRemoteH239Control() const;
2017
2020 OpalMediaFormatList GetRemoteH239Formats() const;
2021 #endif
2022
2023 virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
2024
2025 virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
2026
2027 #if OPAL_H460
2028
2030 virtual H460_FeatureSet * GetFeatureSet();
2031 #endif
2032
2033
2034 #if OPAL_H450
2035
2039 H4507Handler& getH4507handler(){return *h4507handler;}
2040 #endif
2041
2047 virtual bool OnMediaCommand(
2048 OpalMediaStream & stream,
2049 const OpalMediaCommand & command
2050 );
2051
2052 protected:
2058 virtual void InternalEstablishedConnectionCheck();
2059 PBoolean InternalEndSessionCheck(PPER_Stream & strm);
2060 void SetRemoteVersions(const H225_ProtocolIdentifier & id);
2061 void MonitorCallStatus();
2062 PDECLARE_NOTIFIER(PThread, H323Connection, StartOutgoing);
2063 PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
2064 PDECLARE_NOTIFIER(PThread, H323Connection, NewIncomingControlChannel);
2065
2066 H323EndPoint & endpoint;
2067
2068 H323TransportAddress m_remoteConnectAddress;
2069 int remoteCallWaiting; // Number of call's waiting at the remote endpoint
2070 PBoolean gatekeeperRouted;
2071 unsigned distinctiveRing;
2072 unsigned callReference;
2073 unsigned m_progressIndicator;
2074 OpalGloballyUniqueID callIdentifier;
2075 OpalGloballyUniqueID conferenceIdentifier;
2076
2077 PString localDestinationAddress;
2078 PStringList localAliasNames;
2079 H323Capabilities localCapabilities; // Capabilities local system supports
2080 PString destExtraCallInfo;
2081 H323Capabilities remoteCapabilities; // Capabilities remote system supports
2082 unsigned remoteMaxAudioDelayJitter;
2083 PTimer roundTripDelayTimer;
2084 WORD maxAudioDelayJitter;
2085 unsigned uuiesRequested;
2086 PString gkAccessTokenOID;
2087 PBYTEArray gkAccessTokenData;
2088 PBoolean addAccessTokenToSetup;
2089
2090 H323Transport * signallingChannel;
2091 H323Transport * controlChannel;
2092 OpalListener * controlListener;
2093 PBoolean h245Tunneling;
2094 H323SignalPDU * h245TunnelRxPDU;
2095 H323SignalPDU * h245TunnelTxPDU;
2096 H323SignalPDU * setupPDU;
2097 H323SignalPDU * alertingPDU;
2098 H323SignalPDU * connectPDU;
2099 H323SignalPDU * progressPDU;
2100
2101 enum ConnectionStates {
2102 NoConnectionActive,
2103 AwaitingGatekeeperAdmission,
2104 AwaitingTransportConnect,
2105 AwaitingSignalConnect,
2106 AwaitingLocalAnswer,
2107 HasExecutedSignalConnect,
2108 EstablishedConnection,
2109 ShuttingDownConnection,
2110 NumConnectionStates
2111 } connectionState;
2112
2113 unsigned h225version;
2114 unsigned h245version;
2115 PBoolean h245versionSet;
2116 PBoolean doH245inSETUP;
2117 PBoolean lastPDUWasH245inSETUP;
2118
2119 PBoolean mustSendDRQ;
2120 PBoolean mediaWaitForConnect;
2121 PBoolean transmitterSidePaused;
2122 bool remoteTransmitPaused;
2123 PBoolean earlyStart;
2124 PString t38ModeChangeCapabilities;
2125 PSyncPoint digitsWaitFlag;
2126 PBoolean endSessionNeeded;
2127 PSyncPoint endSessionReceived;
2128 PTimer enforcedDurationLimit;
2129
2130 // Used as part of a local call hold operation involving MOH
2131 PChannel * holdMediaChannel;
2132 PBoolean isConsultationTransfer;
2133
2135 PBoolean isCallIntrusion;
2136 unsigned callIntrusionProtectionLevel;
2137
2138 enum FastStartStates {
2139 FastStartDisabled,
2140 FastStartInitiate,
2141 FastStartResponse,
2142 FastStartAcknowledged,
2143 NumFastStartStates
2144 };
2145 FastStartStates fastStartState;
2146 H323LogicalChannelList fastStartChannels;
2147 OpalMediaStreamPtr fastStartMediaStream;
2148
2149 #if PTRACING
2150 static const char * GetConnectionStatesName(ConnectionStates s);
2151 friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << GetConnectionStatesName(s); }
2152 static const char * GetFastStartStateName(FastStartStates s);
2153 friend ostream & operator<<(ostream & o, FastStartStates s) { return o << GetFastStartStateName(s); }
2154 #endif
2155
2156
2157 // The following pointers are to protocol procedures, they are pointers to
2158 // hide their complexity from the H323Connection classes users.
2159 H245NegMasterSlaveDetermination * masterSlaveDeterminationProcedure;
2160 H245NegTerminalCapabilitySet * capabilityExchangeProcedure;
2161 H245NegLogicalChannels * logicalChannels;
2162 H245NegRequestMode * requestModeProcedure;
2163 H245NegRoundTripDelay * roundTripDelayProcedure;
2164
2165 #if OPAL_H239
2166 bool m_h239Control;
2167 #endif
2168
2169 #if OPAL_H450
2170 H450xDispatcher * h450dispatcher;
2171 H4502Handler * h4502handler;
2172 H4504Handler * h4504handler;
2173 H4506Handler * h4506handler;
2174 H4507Handler * h4507handler;
2175 H45011Handler * h45011handler;
2176 #endif
2177
2178 #if OPAL_H460
2179 H460_FeatureSet * features;
2180 #endif
2181
2182 private:
2183 PChannel * SwapHoldMediaChannels(PChannel * newChannel);
2184
2185 P_REMOVE_VIRTUAL_VOID(CleanUpOnCallEnd());
2186 P_REMOVE_VIRTUAL_VOID(OnCleared());
2187 };
2188
2189
2190 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
2191
2192
2193 #endif // OPAL_H323
2194
2195 #endif // OPAL_H323_H323CON_H
2196
2197