OPAL  Version 3.14.3
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: 32213 $
30  * $Author: rjongbloed $
31  * $Date: 2014-06-25 10:57:02 +1000 (Wed, 25 Jun 2014) $
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_config.h>
42 
43 #if OPAL_H323
44 
45 #include <rtp/rtpconn.h>
46 #include <opal/guid.h>
47 #include <opal_config.h>
48 #include <h323/h323caps.h>
49 #include <h323/h235dh.h>
50 #include <h460/h460.h>
51 #include <ptclib/dtmf.h>
52 
53 
54 /* The following classes have forward references to avoid including the VERY
55  large header files for H225 and H245. If an application requires access
56  to the protocol classes they can include them, but for simple usage their
57  inclusion can be avoided.
58  */
59 class PPER_Stream;
60 class PASN_OctetString;
61 class PASN_Sequence;
62 
63 class H225_EndpointType;
64 class H225_TransportAddress;
65 class H225_ArrayOf_PASN_OctetString;
66 class H225_ProtocolIdentifier;
67 class H225_AdmissionRequest;
68 class H225_AdmissionConfirm;
69 class H225_AdmissionReject;
70 class H225_InfoRequestResponse;
71 class H225_DisengageRequest;
72 class H225_FeatureSet;
73 class H225_H245Security;
74 
75 class H245_TerminalCapabilitySet;
76 class H245_TerminalCapabilitySetReject;
77 class H245_OpenLogicalChannel;
78 class H245_OpenLogicalChannelAck;
79 class H245_TransportAddress;
80 class H245_UserInputIndication;
81 class H245_RequestMode;
82 class H245_RequestModeAck;
83 class H245_RequestModeReject;
84 class H245_ModeDescription;
85 class H245_ArrayOf_ModeDescription;
86 class H245_SendTerminalCapabilitySet;
87 class H245_MultiplexCapability;
88 class H245_FlowControlCommand;
89 class H245_MiscellaneousCommand;
90 class H245_MiscellaneousIndication;
91 class H245_JitterIndication;
92 class H245_ArrayOf_GenericParameter;
93 class H245_ArrayOf_GenericInformation;
94 
95 class H323SignalPDU;
96 class H323ControlPDU;
97 class H323EndPoint;
101 
102 class H235Authenticators;
103 
107 class H245NegRequestMode;
109 
110 class H450xDispatcher;
111 class H4502Handler;
112 class H4504Handler;
113 class H4506Handler;
114 class H4507Handler;
115 class H45011Handler;
116 
117 class OpalCall;
118 
119 class H460_FeatureSet;
120 
121 
124 #define OPAL_OPT_Q931_BEARER_CAPS "Q931-Bearer-Caps"
125 
126 
128 
136 {
137  PCLASSINFO(H323Connection, OpalRTPConnection);
138 
139  public:
145  OpalCall & call,
147  const PString & token,
148  const PString & alias,
149  const H323TransportAddress & address,
150  unsigned options = 0,
151  OpalConnection::StringOptions * stringOptions = NULL
152  );
153 
156  ~H323Connection();
158 
169  virtual bool IsNetworkConnection() const { return true; }
170 
173  virtual PString GetPrefixName() const;
174 
176  virtual void OnApplyStringOptions();
177 
184  virtual PBoolean SetUpConnection();
185 
195  virtual PBoolean SetAlerting(
196  const PString & calleeName,
197  PBoolean withMedia
198  );
199 
204  virtual PBoolean SetConnected();
205 
210  virtual PBoolean SetProgressed();
211 
219  virtual void OnEstablished();
220 
238  virtual void OnReleased();
239 
243 
248  virtual PString GetDestinationAddress();
249 
263  virtual PString GetAlertingType() const;
264 
278  virtual bool SetAlertingType(const PString & info);
279 
282  unsigned GetProgressIndicator() const { return m_progressIndicator; }
283 
286  void SetProgressIndicator(unsigned indicator) { m_progressIndicator = indicator; }
287 
295  virtual OpalMediaFormatList GetMediaFormats() const;
296 
301  virtual PStringArray GetMediaCryptoSuites() const;
302 
305  virtual unsigned GetNextSessionID(
306  const OpalMediaType & mediaType,
307  bool isSource
308  );
309 
310 #if OPAL_T38_CAPABILITY
311 
313  virtual bool SwitchFaxMediaStreams(
314  bool toT38
315  );
316 #endif
317 
321  const OpalMediaFormat & mediaFormat,
322  unsigned sessionID,
323  bool isSource
324  );
325 
330  virtual void OnClosedMediaStream(
331  const OpalMediaStream & stream
332  );
333 
343  virtual bool GetMediaTransportAddresses(
344  OpalConnection & otherConnection,
345  const OpalMediaType & mediaType,
346  OpalTransportAddressArray & transports
347  ) const;
348 
349 #if OPAL_H239
350 
361  virtual bool RequestPresentationRole(
362  bool release
363  );
364 
369  virtual bool HasPresentationRole() const;
370 #endif // OPAL_H239
371 
372 
377  void AttachSignalChannel(
378  const PString & token,
379  H323Transport * channel,
380  PBoolean answeringCall
381  );
382 
385  PBoolean WriteSignalPDU(
386  H323SignalPDU & pdu
387  );
388 
392  virtual void HandleSignallingChannel();
393 
397  virtual PBoolean HandleSignalPDU(
398  H323SignalPDU & pdu
399  );
400 
404  virtual void HandleTunnelPDU(
405  H323SignalPDU * txPDU
406  );
407 
415  virtual PBoolean OnReceivedSignalSetup(
416  const H323SignalPDU & pdu
417  );
418 
425  virtual PBoolean OnReceivedSignalSetupAck(
426  const H323SignalPDU & pdu
427  );
428 
435  virtual PBoolean OnReceivedSignalInformation(
436  const H323SignalPDU & pdu
437  );
438 
447  virtual PBoolean OnReceivedCallProceeding(
448  const H323SignalPDU & pdu
449  );
450 
459  virtual PBoolean OnReceivedProgress(
460  const H323SignalPDU & pdu
461  );
462 
469  virtual PBoolean OnReceivedAlerting(
470  const H323SignalPDU & pdu
471  );
472 
481  virtual PBoolean OnReceivedSignalConnect(
482  const H323SignalPDU & pdu
483  );
484 
493  virtual PBoolean OnReceivedFacility(
494  const H323SignalPDU & pdu
495  );
496 
503  virtual PBoolean OnReceivedSignalNotify(
504  const H323SignalPDU & pdu
505  );
506 
513  virtual PBoolean OnReceivedSignalStatus(
514  const H323SignalPDU & pdu
515  );
516 
523  virtual PBoolean OnReceivedStatusEnquiry(
524  const H323SignalPDU & pdu
525  );
526 
531  virtual void OnReceivedReleaseComplete(
532  const H323SignalPDU & pdu
533  );
534 
541  virtual PBoolean OnUnknownSignalPDU(
542  const H323SignalPDU & pdu
543  );
544 
551  virtual void OnSendARQ(
552  H225_AdmissionRequest & arq
553  );
554 
560  virtual void OnReceivedACF(
561  const H225_AdmissionConfirm & acf
562  );
563 
569  virtual void OnReceivedARJ(
570  const H225_AdmissionReject & arj
571  );
572 
579  virtual void OnSendIRR(
580  H225_InfoRequestResponse & irr
581  ) const;
582 
589  virtual void OnSendDRQ(
590  H225_DisengageRequest & drq
591  ) const;
592 
604  virtual PBoolean OnIncomingCall(
605  const H323SignalPDU & setupPDU,
607  );
608 
618  virtual PBoolean ForwardCall(
619  const PString & forwardParty
620  );
621 
628  virtual bool TransferConnection(
629  const PString & remoteParty
630  );
631 
646  virtual bool HoldRemote(
647  bool placeOnHold
648  );
649 
654  virtual bool IsOnHold(
655  bool fromRemote
656  ) const;
657 
658 #if OPAL_H450
659 
664  bool TransferCall(
665  const PString & remoteParty,
666  const PString & callIdentity = PString::Empty()
668  );
669 
675  const PString & primaryCallToken
676  );
677 
684  virtual void HandleConsultationTransfer(
685  const PString & callIdentity,
687  H323Connection & incoming
688  );
689 
692  PBoolean IsTransferringCall() const;
693 
696  PBoolean IsTransferredCall() const;
697 
702  virtual void HandleTransferCall(
703  const PString & token,
704  const PString & identity
705  );
706 
712 
720  virtual void HandleCallTransferFailure(
721  const int returnError
722  );
723 
729  const PString & token
730  );
731 
736  virtual void OnConsultationTransferSuccess(
737  H323Connection & secondaryCall
738  );
739 
744  virtual void IntrudeCall(
745  unsigned capabilityLevel
746  );
747 
752  virtual void HandleIntrudeCall(
753  const PString & token,
754  const PString & identity
755  );
756 
763 
764  PBoolean IsCallIntrusion() { return isCallIntrusion; }
765 
769 
773  virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
774  const PString & callToken,
776  );
777 
778  virtual void SetIntrusionImpending();
779 
780  virtual void SetForcedReleaseAccepted();
781 
782  virtual void SetIntrusionNotAuthorized();
783 
791  const unsigned nbOfAddWaitingCalls = 0
792  );
793 
794 #endif
795 
822  virtual AnswerCallResponse OnAnswerCall(
823  const PString & callerName,
824  const H323SignalPDU & setupPDU,
827  );
828 
829  virtual AnswerCallResponse OnAnswerCall(
830  const PString & callerName
831  );
832 
843  void AnsweringCall(
844  AnswerCallResponse response
845  );
846 
857  virtual CallEndReason SendSignalSetup(
858  const PString & alias,
859  const H323TransportAddress & address
860  );
861 
873  virtual PBoolean OnSendSignalSetup(
875  );
876 
885  virtual PBoolean OnSendCallProceeding(
886  H323SignalPDU & callProceedingPDU
887  );
888 
900  virtual PBoolean OnSendReleaseComplete(
901  H323SignalPDU & releaseCompletePDU
902  );
903 
914  virtual PBoolean OnAlerting(
915  const H323SignalPDU & alertingPDU,
916  const PString & user
917  );
918 
933  virtual PBoolean OnInsufficientDigits();
934 
947  virtual void SendMoreDigits(
948  const PString & digits
949  );
950 
960  virtual PBoolean OnOutgoingCall(
961  const H323SignalPDU & connectPDU
962  );
963 
975  virtual PBoolean SendFastStartAcknowledge(
976  H225_ArrayOf_PASN_OctetString & array
977  );
978 
990  virtual PBoolean HandleFastStartAcknowledge(
991  const H225_ArrayOf_PASN_OctetString & array
992  );
994 
1008  virtual PBoolean CreateOutgoingControlChannel(
1009  const PASN_Sequence & enclosingPDU,
1010  const H225_TransportAddress & h245Address,
1011  unsigned h245AddressField,
1012  const H225_H245Security & h245Security,
1013  unsigned h245SecurityField
1014  );
1015 
1028  virtual PBoolean CreateIncomingControlChannel(
1029  PASN_Sequence & enclosingPDU,
1030  H225_TransportAddress & h245Address,
1031  unsigned h245AddressField,
1032  H225_H245Security & h245Security,
1033  unsigned h245SecurityField
1034  );
1035 
1040  virtual PBoolean WriteControlPDU(
1041  const H323ControlPDU & pdu
1042  );
1043 
1046  virtual PBoolean StartControlNegotiations();
1047 
1050  virtual void HandleControlChannel();
1051 
1058  virtual PBoolean HandleControlData(
1059  PPER_Stream & strm
1060  );
1061 
1068  virtual PBoolean HandleControlPDU(
1069  const H323ControlPDU & pdu
1070  );
1071 
1075  virtual PBoolean HandleReceivedControlPDU(
1076  PBoolean readStatus,
1077  PPER_Stream & strm
1078  );
1079 
1089  virtual PBoolean OnUnknownControlPDU(
1090  const H323ControlPDU & pdu
1091  );
1092 
1096  virtual PBoolean OnH245Request(
1097  const H323ControlPDU & pdu
1098  );
1099 
1103  virtual PBoolean OnH245Response(
1104  const H323ControlPDU & pdu
1105  );
1106 
1110  virtual PBoolean OnH245Command(
1111  const H323ControlPDU & pdu
1112  );
1113 
1117  virtual PBoolean OnH245Indication(
1118  const H323ControlPDU & pdu
1119  );
1120 
1123  virtual PBoolean OnH245_SendTerminalCapabilitySet(
1124  const H245_SendTerminalCapabilitySet & pdu
1125  );
1126 
1131  virtual PBoolean OnH245_FlowControlCommand(
1132  const H245_FlowControlCommand & pdu
1133  );
1134 
1139  virtual PBoolean OnH245_MiscellaneousCommand(
1140  const H245_MiscellaneousCommand & pdu
1141  );
1142 
1147  virtual PBoolean OnH245_MiscellaneousIndication(
1148  const H245_MiscellaneousIndication & pdu
1149  );
1150 
1155  virtual PBoolean OnH245_JitterIndication(
1156  const H245_JitterIndication & pdu
1157  );
1158 
1159 #if OPAL_H239
1160 
1162  virtual bool OnH239Message(
1163  unsigned subMessage,
1164  const H245_ArrayOf_GenericParameter & params
1165  );
1166 
1170  virtual bool OnH239FlowControlRequest(
1171  unsigned logicalChannel,
1172  unsigned bitRate
1173  );
1174 
1178  virtual bool OnH239FlowControlResponse(
1179  unsigned logicalChannel,
1180  bool rejected
1181  );
1182 
1186  virtual bool OnH239PresentationRequest(
1187  unsigned logicalChannel,
1188  unsigned symmetryBreaking,
1189  unsigned terminalLabel
1190  );
1191 
1197  virtual bool SendH239PresentationRequest(
1198  unsigned logicalChannel,
1199  unsigned symmetryBreaking,
1200  unsigned terminalLabel
1201  );
1202 
1206  virtual bool OnH239PresentationResponse(
1207  unsigned logicalChannel,
1208  unsigned terminalLabel,
1209  bool rejected
1210  );
1211 
1215  virtual bool OnH239PresentationRelease(
1216  unsigned logicalChannel,
1217  unsigned terminalLabel
1218  );
1219 
1224  virtual bool SendH239PresentationRelease(
1225  unsigned logicalChannel,
1226  unsigned terminalLabel
1227  );
1228 
1232  virtual bool OnH239PresentationIndication(
1233  unsigned logicalChannel,
1234  unsigned terminalLabel
1235  );
1236 #endif // OPAL_H239
1237 
1246  };
1247 
1259  virtual PBoolean OnControlProtocolError(
1260  ControlProtocolErrors errorSource,
1261  const void * errorData = NULL
1262  );
1263 
1271  virtual void OnSendCapabilitySet(
1272  H245_TerminalCapabilitySet & pdu
1273  );
1274 
1286  virtual PBoolean OnReceivedCapabilitySet(
1287  const H323Capabilities & remoteCaps,
1288  const H245_MultiplexCapability * muxCap,
1289  H245_TerminalCapabilitySetReject & reject
1290  );
1291 
1294  virtual bool SendCapabilitySet(
1295  PBoolean empty
1296  );
1297 
1300  virtual bool IsSendingCapabilitySet();
1301 
1310  virtual void OnSetLocalCapabilities();
1311 
1316  H245_OpenLogicalChannel & /*open*/,
1317  PBoolean /*forward*/
1318  ) { }
1319 
1322  PBoolean IsH245Master() const;
1323 
1326  void StartRoundTripDelay();
1327 
1330  PTimeInterval GetRoundTripDelay() const;
1332 
1372  virtual void OnSelectLogicalChannels();
1373 
1376  virtual void SelectDefaultLogicalChannel(
1377  const OpalMediaType & mediaType,
1378  unsigned sessionID
1379  );
1380 
1384  virtual void SelectFastStartChannels(
1385  unsigned sessionID,
1386  PBoolean transmitter,
1387  PBoolean receiver
1388  );
1389 
1393  virtual void OpenFastStartChannel(
1394  unsigned sessionID,
1395  H323Channel::Directions direction
1396  );
1397 
1412  virtual PBoolean OpenLogicalChannel(
1413  const H323Capability & capability,
1414  unsigned sessionID,
1416  );
1417 
1418  virtual void SendFlowControlCommand(
1419  unsigned channelNumber,
1420  unsigned newBitRate
1421  );
1422 
1432  virtual PBoolean OnOpenLogicalChannel(
1433  const H245_OpenLogicalChannel & openPDU,
1434  H245_OpenLogicalChannelAck & ackPDU,
1435  unsigned & errorCode,
1436  H323Channel & channel
1437  );
1438 
1446  virtual PBoolean OnConflictingLogicalChannel(
1447  H323Channel & channel
1448  );
1449 
1455  const H245_OpenLogicalChannel & open,
1456  PBoolean startingFast,
1457  unsigned & errorCode
1458  );
1459 
1495  const H323Capability & capability,
1497  unsigned sessionID,
1498  const H245_H2250LogicalChannelParameters * param
1500  );
1501 
1506  const H323Capability & capability,
1507  H323Channel::Directions direction,
1508  H323RTPSession & rtp
1509  );
1510 
1521  virtual PBoolean OnCreateLogicalChannel(
1522  const H323Capability & capability,
1524  unsigned & errorCode
1525  );
1526 
1531  virtual PBoolean OnStartLogicalChannel(
1532  H323Channel & channel
1533  );
1534 
1537  virtual void CloseLogicalChannel(
1538  unsigned number,
1539  PBoolean fromRemote
1540  );
1541 
1544  virtual void CloseLogicalChannelNumber(
1545  const H323ChannelNumber & number
1546  );
1547 
1550  virtual void CloseAllLogicalChannels(
1551  PBoolean fromRemote
1552  );
1553 
1559  virtual void OnClosedLogicalChannel(
1560  const H323Channel & channel
1561  );
1562 
1571  virtual PBoolean OnClosingLogicalChannel(
1572  H323Channel & channel
1573  );
1574 
1583  virtual void OnLogicalChannelFlowControl(
1584  H323Channel * channel,
1585  long bitRateRestriction
1586  );
1587 
1596  virtual void OnLogicalChannelJitter(
1597  H323Channel * channel,
1598  DWORD jitter,
1599  int skippedFrameCount,
1600  int additionalBuffer
1601  );
1602 
1607  unsigned number,
1608  PBoolean fromRemote
1609  ) const;
1610 
1617  unsigned sessionId,
1618  PBoolean fromRemote
1619  ) const;
1621 
1630  ) const;
1632 
1640  virtual SendUserInputModes GetRealSendUserInputMode() const;
1641 
1655  virtual PBoolean SendUserInputString(
1656  const PString & value
1657  );
1658 
1683  virtual PBoolean SendUserInputTone(
1684  char tone,
1685  unsigned duration = 0
1686  );
1687 
1694  virtual PBoolean SendUserInputIndicationQ931(
1695  const PString & value
1696  );
1697 
1704  virtual PBoolean SendUserInputIndicationString(
1705  const PString & value
1706  );
1707 
1712  virtual PBoolean SendUserInputIndicationTone(
1713  char tone,
1714  unsigned duration = 0,
1715  unsigned logicalChannel = 0,
1716  unsigned rtpTimestamp = 0
1717  );
1718 
1727  virtual PBoolean SendUserInputIndication(
1728  const H245_UserInputIndication & pdu
1729  );
1730 
1735  virtual void OnUserInputIndication(
1736  const H245_UserInputIndication & pdu
1737  );
1739 
1745  virtual PString GetSessionCodecNames(
1746  unsigned sessionID
1747  ) const;
1748 
1753  virtual void DetermineRTPNAT(
1754  const OpalTransport & transport,
1755  const OpalTransportAddress & signalAddr
1756  );
1757 
1775  virtual PBoolean RequestModeChange(
1776  const PString & newModes
1777  );
1778 
1786  virtual PBoolean RequestModeChange(
1787  const H245_ArrayOf_ModeDescription & newModes
1788  );
1789 
1792  virtual PBoolean OnRequestModeChange(
1793  const H245_RequestMode & pdu,
1794  H245_RequestModeAck & ack,
1795  H245_RequestModeReject & reject,
1796  PINDEX & selectedMode
1797  );
1798 
1805  virtual void OnModeChanged(
1806  const H245_ModeDescription & newMode
1807  );
1808 
1813  virtual void OnAcceptModeChange(
1814  const H245_RequestModeAck & pdu
1815  );
1816 
1821  virtual void OnRefusedModeChange(
1822  const H245_RequestModeReject * pdu
1823  );
1825 
1833  virtual PBoolean RequestModeChangeT38(
1834  const char * capabilityNames = "T.38\nT38FaxUDP"
1835  );
1836 
1846  virtual PBoolean GetAdmissionRequestAuthentication(
1847  const H225_AdmissionRequest & arq,
1848  H235Authenticators & authenticators
1849  );
1851 
1856  H323EndPoint & GetEndPoint() const { return endpoint; }
1857 
1860  PBoolean HadAnsweredCall() const { return !IsOriginating(); }
1861 
1864  PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
1865 
1870  unsigned GetDistinctiveRing() const { return distinctiveRing; }
1871 
1878  void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
1879 
1883  const PString & GetCallToken() const { return GetToken(); }
1884 
1887  unsigned GetCallReference() const { return callReference; }
1888 
1891  inline const OpalGloballyUniqueID & GetCallIdentifier() const
1892  { return callIdentifier; }
1893 
1896  virtual PString GetIdentifier() const;
1897 
1901 
1904  void SetLocalPartyName(const PString & name);
1905 
1908  const PStringList & GetLocalAliasNames() const { return localAliasNames; }
1909 
1912  virtual void SetRemotePartyInfo(
1913  const H323SignalPDU & pdu
1914  );
1915 
1918  void SetRemoteApplication(
1919  const H225_EndpointType & pdu
1920  );
1921 
1928  };
1929 
1933 
1937 
1941 
1945 
1949 
1953 
1956  unsigned GetSignallingVersion() const { return h225version; }
1957 
1960  const H323Transport & GetControlChannel() const;
1961 
1964  OpalTransport & GetTransport() const;
1965 
1968  unsigned GetControlVersion() const { return h245version; }
1969 
1972  unsigned GetUUIEsRequested() const { return uuiesRequested; }
1973 
1976  void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
1977 
1980  const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
1981 
1984  void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
1985 
1988  const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
1989 
1993  const PString & info
1994  ) { destExtraCallInfo = info; }
1995 
1998  void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
1999 
2005  int GetRemoteCallWaiting() const { return remoteCallWaiting; }
2006 
2012  unsigned seconds
2013  );
2015 
2016 
2017 #if OPAL_H239
2018 
2020  bool GetLocalH239Control() const { return m_h239Control; }
2021 
2025  bool on
2026  ) { m_h239Control = on; }
2027 
2030  bool GetRemoteH239Control() const;
2031 
2035 #endif
2036 
2037 #if OPAL_H235_6
2038 
2039  const H235DiffieHellman & GetDiffieHellman() const { return m_dh; }
2040  H235DiffieHellman & GetDiffieHellman() { return m_dh; }
2041 #endif
2042 
2043 #if OPAL_H450
2044 
2049 #endif
2050 
2051 #if OPAL_H460
2052 
2055 
2056  virtual bool OnSendFeatureSet(H460_MessageType pduType, H225_FeatureSet &) const;
2057  virtual void OnReceiveFeatureSet(H460_MessageType pduType, const H225_FeatureSet &) const;
2058 #endif
2059 
2064  virtual void OnReceiveOLCGenericInformation(
2065  unsigned sessionID,
2066  const H245_ArrayOf_GenericInformation & info,
2067  bool isAck
2068  ) const;
2069 
2073  virtual bool OnSendingOLCGenericInformation(
2074  unsigned sessionID,
2075  H245_ArrayOf_GenericInformation & info,
2076  bool isAck
2077  ) const;
2078 
2084  virtual bool OnMediaCommand(
2085  OpalMediaStream & stream,
2086  const OpalMediaCommand & command
2087  );
2088 
2091  P_DECLARE_ENUM(CompatibilityIssues,
2092  e_NoMultipleTunnelledH245,
2093  e_BadMasterSlaveConflict,
2094  e_NoUserInputCapability,
2095  e_H224MustBeSession3,
2096  e_NeedTCSAfterNonEmptyTCS,
2097  e_NeedMSDAfterNonEmptyTCS,
2098  e_ForceMaintainConnection
2099  );
2100  P_DECLARE_ENUM_NAMES(CompatibilityIssues,
2101  "No-Multiple-Tunnelled-H245",
2102  "Bad-Master-Slave-Conflict",
2103  "No-User-Input-Capability",
2104  "H.224-Must-Be-Session-3",
2105  "Need-TCS-after-Non-Empty-TCS",
2106  "Need-MSD-after-Non-Empty-TCS",
2107  "Force-Maintain-TCP-Connection"
2108  );
2109 
2111  bool HasCompatibilityIssue(
2112  CompatibilityIssues issue
2113  ) const;
2114 
2115  PBoolean StartHandleControlChannel();
2116  virtual PBoolean OnStartHandleControlChannel();
2117  void EndHandleControlChannel();
2118 
2119  protected:
2125  virtual void InternalEstablishedConnectionCheck();
2126  bool InternalEndSessionCheck(PPER_Stream & strm);
2127  bool SendReleaseComplete();
2128  void SetRemoteVersions(const H225_ProtocolIdentifier & id);
2129  void SetOutgoingBearerCapabilities(H323SignalPDU & pdu) const;
2130  void SetIncomingBearerCapabilities(const H323SignalPDU & pdu);
2131  void MonitorCallStatus();
2132  PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
2133  PDECLARE_AcceptHandlerNotifier(H323Connection, NewIncomingControlChannel);
2134 
2136 
2138  int remoteCallWaiting; // Number of call's waiting at the remote endpoint
2141  unsigned callReference;
2145 
2147  PStringList localAliasNames;
2148  H323Capabilities localCapabilities; // Capabilities local system supports
2150  H323Capabilities remoteCapabilities; // Capabilities remote system supports
2153  unsigned uuiesRequested;
2155  PBYTEArray gkAccessTokenData;
2157 
2168 
2169  P_DECLARE_TRACED_ENUM(ConnectionStates,
2170  NoConnectionActive,
2171  AwaitingGatekeeperAdmission,
2172  AwaitingTransportConnect,
2173  AwaitingSignalConnect,
2174  AwaitingLocalAnswer,
2175  HasExecutedSignalConnect,
2176  EstablishedConnection,
2177  ShuttingDownConnection
2178  );
2179  ConnectionStates connectionState;
2180 
2181  unsigned h225version;
2182  unsigned h245version;
2187 
2193  PSyncPoint digitsWaitFlag;
2200 
2201  template <class PDU> void SetMaintainConnectionFlag(const PDU & pdu)
2202  {
2203  if (pdu.HasOptionalField(PDU::e_maintainConnection) && pdu.m_maintainConnection)
2204  m_maintainConnection = true;
2205  }
2206 
2207  PSafeDictionary<POrdinalKey, OpalMediaStream> m_conflictingChannels;
2208 
2209  P_DECLARE_TRACED_ENUM(RemoteHoldStates,
2210  eOffHoldFromRemote,
2211  eOnHoldFromRemote,
2212  eRetrieveFromRemote
2213  );
2214  RemoteHoldStates m_holdFromRemote;
2215 
2217 
2218 #if OPAL_H450
2219 
2222 #endif
2223 
2224  P_DECLARE_TRACED_ENUM(FastStartStates,
2225  FastStartDisabled,
2226  FastStartInitiate,
2227  FastStartResponse,
2228  FastStartAcknowledged
2229  );
2230  FastStartStates m_fastStartState;
2231  H323LogicalChannelList m_fastStartChannels;
2232 
2233 
2234  // The following pointers are to protocol procedures, they are pointers to
2235  // hide their complexity from the H323Connection classes users.
2241 
2242 #if OPAL_H239
2248 #endif
2249 
2250 #if OPAL_H450
2257 #endif
2258 
2259 #if OPAL_H460
2261 #endif
2262 
2263 #if OPAL_VIDEO
2265 #endif
2266 
2267 #if OPAL_H235_6
2268  H235DiffieHellman m_dh;
2269 
2270  template <class PDU> void SetDiffieHellman(const PDU & pdu)
2271  {
2272  if (pdu.HasOptionalField(PDU::e_tokens))
2273  m_dh.FromTokens(pdu.m_tokens);
2274  }
2275 #endif
2276 
2280  PDECLARE_NOTIFIER(PTimer, H323Connection, UserInputIndicationTimeout);
2281 
2282  private:
2283  P_REMOVE_VIRTUAL_VOID(CleanUpOnCallEnd());
2284  P_REMOVE_VIRTUAL_VOID(OnCleared());
2285  P_REMOVE_VIRTUAL_VOID(OnRTPStatistics(const OpalRTPSession &) const);
2286  P_REMOVE_VIRTUAL(PBoolean, OnOpenLogicalChannel(const H245_OpenLogicalChannel&,H245_OpenLogicalChannelAck&,unsigned&), false);
2287  P_REMOVE_VIRTUAL(PBoolean, OnOpenLogicalChannel(const H245_OpenLogicalChannel &, H245_OpenLogicalChannelAck &, unsigned &, const unsigned &), false);
2288  P_REMOVE_VIRTUAL_VOID(NatDetection(const PIPSocket::Address &, const PIPSocket::Address &));
2289  P_REMOVE_VIRTUAL(PBoolean, OnNatDetected(), false);
2290 };
2291 
2292 
2293 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
2294 
2295 
2296 #endif // OPAL_H323
2297 
2298 #endif // OPAL_H323_H323CON_H
2299 
2300