OPAL  Version 3.12.5
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: 29960 $
30  * $Author: rjongbloed $
31  * $Date: 2013-06-13 23:26:53 -0500 (Thu, 13 Jun 2013) $
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 <rtp/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 class H245_ArrayOf_GenericInformation;
90 
91 class H323SignalPDU;
92 class H323ControlPDU;
93 class H323EndPoint;
97 
98 class H235Authenticators;
99 
103 class H245NegRequestMode;
105 
106 class H450xDispatcher;
107 class H4502Handler;
108 class H4504Handler;
109 class H4506Handler;
110 class H4507Handler;
111 class H45011Handler;
112 
113 class OpalCall;
114 
115 #if OPAL_H460
116 class H460_FeatureSet;
117 #endif
118 
119 
122 #define OPAL_OPT_Q931_BEARER_CAPS "Q931-Bearer-Caps"
123 
124 
126 
134 {
135  PCLASSINFO(H323Connection, OpalRTPConnection);
136 
137  public:
143  OpalCall & call,
145  const PString & token,
146  const PString & alias,
147  const H323TransportAddress & address,
148  unsigned options = 0,
149  OpalConnection::StringOptions * stringOptions = NULL
150  );
151 
154  ~H323Connection();
156 
167  virtual bool IsNetworkConnection() const { return true; }
168 
171  virtual PString GetPrefixName() const;
172 
174  virtual void OnApplyStringOptions();
175 
182  virtual PBoolean SetUpConnection();
183 
193  virtual PBoolean SetAlerting(
194  const PString & calleeName,
195  PBoolean withMedia
196  );
197 
202  virtual PBoolean SetConnected();
203 
208  virtual PBoolean SetProgressed();
209 
217  virtual void OnEstablished();
218 
236  virtual void OnReleased();
237 
241 
246  virtual PString GetDestinationAddress();
247 
261  virtual PString GetAlertingType() const;
262 
276  virtual bool SetAlertingType(const PString & info);
277 
280  unsigned GetProgressIndicator() const { return m_progressIndicator; }
281 
284  void SetProgressIndicator(unsigned indicator) { m_progressIndicator = indicator; }
285 
293  virtual OpalMediaFormatList GetMediaFormats() const;
294 
297  virtual unsigned GetNextSessionID(
298  const OpalMediaType & mediaType,
299  bool isSource
300  );
301 
302 #if OPAL_T38_CAPABILITY
303 
305  virtual bool SwitchFaxMediaStreams(
306  bool toT38
307  );
308 #endif
309 
313  const OpalMediaFormat & mediaFormat,
314  unsigned sessionID,
315  bool isSource
316  );
317 
322  virtual void OnClosedMediaStream(
323  const OpalMediaStream & stream
324  );
325 
335  virtual bool GetMediaTransportAddresses(
336  const OpalMediaType & mediaType,
337  OpalTransportAddressArray & transports
338  ) const;
339 
340 #if OPAL_H239
341 
352  virtual bool RequestPresentationRole(
353  bool release
354  );
355 
360  virtual bool HasPresentationRole() const;
361 #endif // OPAL_H239
362 
363 
368  void AttachSignalChannel(
369  const PString & token,
370  H323Transport * channel,
371  PBoolean answeringCall
372  );
373 
376  PBoolean WriteSignalPDU(
377  H323SignalPDU & pdu
378  );
379 
383  virtual void HandleSignallingChannel();
384 
388  virtual PBoolean HandleSignalPDU(
389  H323SignalPDU & pdu
390  );
391 
395  virtual void HandleTunnelPDU(
396  H323SignalPDU * txPDU
397  );
398 
406  virtual PBoolean OnReceivedSignalSetup(
407  const H323SignalPDU & pdu
408  );
409 
416  virtual PBoolean OnReceivedSignalSetupAck(
417  const H323SignalPDU & pdu
418  );
419 
426  virtual PBoolean OnReceivedSignalInformation(
427  const H323SignalPDU & pdu
428  );
429 
438  virtual PBoolean OnReceivedCallProceeding(
439  const H323SignalPDU & pdu
440  );
441 
450  virtual PBoolean OnReceivedProgress(
451  const H323SignalPDU & pdu
452  );
453 
460  virtual PBoolean OnReceivedAlerting(
461  const H323SignalPDU & pdu
462  );
463 
472  virtual PBoolean OnReceivedSignalConnect(
473  const H323SignalPDU & pdu
474  );
475 
484  virtual PBoolean OnReceivedFacility(
485  const H323SignalPDU & pdu
486  );
487 
494  virtual PBoolean OnReceivedSignalNotify(
495  const H323SignalPDU & pdu
496  );
497 
504  virtual PBoolean OnReceivedSignalStatus(
505  const H323SignalPDU & pdu
506  );
507 
514  virtual PBoolean OnReceivedStatusEnquiry(
515  const H323SignalPDU & pdu
516  );
517 
522  virtual void OnReceivedReleaseComplete(
523  const H323SignalPDU & pdu
524  );
525 
532  virtual PBoolean OnUnknownSignalPDU(
533  const H323SignalPDU & pdu
534  );
535 
542  virtual void OnSendARQ(
543  H225_AdmissionRequest & arq
544  );
545 
551  virtual void OnReceivedACF(
552  const H225_AdmissionConfirm & acf
553  );
554 
560  virtual void OnReceivedARJ(
561  const H225_AdmissionReject & arj
562  );
563 
570  virtual void OnSendIRR(
571  H225_InfoRequestResponse & irr
572  ) const;
573 
580  virtual void OnSendDRQ(
581  H225_DisengageRequest & drq
582  ) const;
583 
595  virtual PBoolean OnIncomingCall(
596  const H323SignalPDU & setupPDU,
598  );
599 
609  virtual PBoolean ForwardCall(
610  const PString & forwardParty
611  );
612 
619  virtual bool TransferConnection(
620  const PString & remoteParty
621  );
622 
630  virtual bool Hold(
631  bool fromRemote,
632  bool placeOnHold
633  );
634 
639  virtual bool IsOnHold(
640  bool fromRemote
641  );
642 
643 #if OPAL_H450
644 
649  bool TransferCall(
650  const PString & remoteParty,
651  const PString & callIdentity = PString::Empty()
653  );
654 
660  const PString & primaryCallToken
661  );
662 
669  virtual void HandleConsultationTransfer(
670  const PString & callIdentity,
672  H323Connection & incoming
673  );
674 
677  PBoolean IsTransferringCall() const;
678 
681  PBoolean IsTransferredCall() const;
682 
687  virtual void HandleTransferCall(
688  const PString & token,
689  const PString & identity
690  );
691 
697 
705  virtual void HandleCallTransferFailure(
706  const int returnError
707  );
708 
714  const PString & token
715  );
716 
721  virtual void OnConsultationTransferSuccess(
722  H323Connection & secondaryCall
723  );
724 
729  virtual void IntrudeCall(
730  unsigned capabilityLevel
731  );
732 
737  virtual void HandleIntrudeCall(
738  const PString & token,
739  const PString & identity
740  );
741 
748 
749  PBoolean IsCallIntrusion() { return isCallIntrusion; }
750 
754 
758  virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
759  const PString & callToken,
761  );
762 
763  virtual void SetIntrusionImpending();
764 
765  virtual void SetForcedReleaseAccepted();
766 
767  virtual void SetIntrusionNotAuthorized();
768 
776  const unsigned nbOfAddWaitingCalls = 0
777  );
778 
779 #endif
780 
807  virtual AnswerCallResponse OnAnswerCall(
808  const PString & callerName,
809  const H323SignalPDU & setupPDU,
812  );
813 
814  virtual AnswerCallResponse OnAnswerCall(
815  const PString & callerName
816  );
817 
828  void AnsweringCall(
829  AnswerCallResponse response
830  );
831 
842  virtual CallEndReason SendSignalSetup(
843  const PString & alias,
844  const H323TransportAddress & address
845  );
846 
858  virtual PBoolean OnSendSignalSetup(
860  );
861 
870  virtual PBoolean OnSendCallProceeding(
871  H323SignalPDU & callProceedingPDU
872  );
873 
885  virtual PBoolean OnSendReleaseComplete(
886  H323SignalPDU & releaseCompletePDU
887  );
888 
899  virtual PBoolean OnAlerting(
900  const H323SignalPDU & alertingPDU,
901  const PString & user
902  );
903 
918  virtual PBoolean OnInsufficientDigits();
919 
932  virtual void SendMoreDigits(
933  const PString & digits
934  );
935 
945  virtual PBoolean OnOutgoingCall(
946  const H323SignalPDU & connectPDU
947  );
948 
960  virtual PBoolean SendFastStartAcknowledge(
961  H225_ArrayOf_PASN_OctetString & array
962  );
963 
975  virtual PBoolean HandleFastStartAcknowledge(
976  const H225_ArrayOf_PASN_OctetString & array
977  );
979 
993  virtual PBoolean CreateOutgoingControlChannel(
994  const H225_TransportAddress & h245Address
995  );
996 
1009  virtual PBoolean CreateIncomingControlChannel(
1010  H225_TransportAddress & h245Address
1011  );
1012 
1017  virtual PBoolean WriteControlPDU(
1018  const H323ControlPDU & pdu
1019  );
1020 
1023  virtual PBoolean StartControlNegotiations();
1024 
1027  virtual void HandleControlChannel();
1028 
1035  virtual PBoolean HandleControlData(
1036  PPER_Stream & strm
1037  );
1038 
1045  virtual PBoolean HandleControlPDU(
1046  const H323ControlPDU & pdu
1047  );
1048 
1052  virtual PBoolean HandleReceivedControlPDU(
1053  PBoolean readStatus,
1054  PPER_Stream & strm
1055  );
1056 
1066  virtual PBoolean OnUnknownControlPDU(
1067  const H323ControlPDU & pdu
1068  );
1069 
1073  virtual PBoolean OnH245Request(
1074  const H323ControlPDU & pdu
1075  );
1076 
1080  virtual PBoolean OnH245Response(
1081  const H323ControlPDU & pdu
1082  );
1083 
1087  virtual PBoolean OnH245Command(
1088  const H323ControlPDU & pdu
1089  );
1090 
1094  virtual PBoolean OnH245Indication(
1095  const H323ControlPDU & pdu
1096  );
1097 
1100  virtual PBoolean OnH245_SendTerminalCapabilitySet(
1101  const H245_SendTerminalCapabilitySet & pdu
1102  );
1103 
1108  virtual PBoolean OnH245_FlowControlCommand(
1109  const H245_FlowControlCommand & pdu
1110  );
1111 
1116  virtual PBoolean OnH245_MiscellaneousCommand(
1117  const H245_MiscellaneousCommand & pdu
1118  );
1119 
1124  virtual PBoolean OnH245_MiscellaneousIndication(
1125  const H245_MiscellaneousIndication & pdu
1126  );
1127 
1132  virtual PBoolean OnH245_JitterIndication(
1133  const H245_JitterIndication & pdu
1134  );
1135 
1136 #if OPAL_H239
1137 
1139  virtual bool OnH239Message(
1140  unsigned subMessage,
1141  const H245_ArrayOf_GenericParameter & params
1142  );
1143 
1147  virtual bool OnH239FlowControlRequest(
1148  unsigned logicalChannel,
1149  unsigned bitRate
1150  );
1151 
1155  virtual bool OnH239FlowControlResponse(
1156  unsigned logicalChannel,
1157  bool rejected
1158  );
1159 
1163  virtual bool OnH239PresentationRequest(
1164  unsigned logicalChannel,
1165  unsigned symmetryBreaking,
1166  unsigned terminalLabel
1167  );
1168 
1174  virtual bool SendH239PresentationRequest(
1175  unsigned logicalChannel,
1176  unsigned symmetryBreaking,
1177  unsigned terminalLabel
1178  );
1179 
1183  virtual bool OnH239PresentationResponse(
1184  unsigned logicalChannel,
1185  unsigned terminalLabel,
1186  bool rejected
1187  );
1188 
1192  virtual bool OnH239PresentationRelease(
1193  unsigned logicalChannel,
1194  unsigned terminalLabel
1195  );
1196 
1201  virtual bool SendH239PresentationRelease(
1202  unsigned logicalChannel,
1203  unsigned terminalLabel
1204  );
1205 
1209  virtual bool OnH239PresentationIndication(
1210  unsigned logicalChannel,
1211  unsigned terminalLabel
1212  );
1213 #endif // OPAL_H239
1214 
1223  };
1224 
1236  virtual PBoolean OnControlProtocolError(
1237  ControlProtocolErrors errorSource,
1238  const void * errorData = NULL
1239  );
1240 
1248  virtual void OnSendCapabilitySet(
1249  H245_TerminalCapabilitySet & pdu
1250  );
1251 
1263  virtual PBoolean OnReceivedCapabilitySet(
1264  const H323Capabilities & remoteCaps,
1265  const H245_MultiplexCapability * muxCap,
1266  H245_TerminalCapabilitySetReject & reject
1267  );
1268 
1271  virtual bool SendCapabilitySet(
1272  PBoolean empty
1273  );
1274 
1277  virtual bool IsSendingCapabilitySet();
1278 
1287  virtual void OnSetLocalCapabilities();
1288 
1293  H245_OpenLogicalChannel & /*open*/,
1294  PBoolean /*forward*/
1295  ) { }
1296 
1299  PBoolean IsH245Master() const;
1300 
1303  void StartRoundTripDelay();
1304 
1307  PTimeInterval GetRoundTripDelay() const;
1309 
1349  virtual void OnSelectLogicalChannels();
1350 
1353  virtual void SelectDefaultLogicalChannel(
1354  const OpalMediaType & mediaType,
1355  unsigned sessionID
1356  );
1357 
1361  virtual void SelectFastStartChannels(
1362  unsigned sessionID,
1363  PBoolean transmitter,
1364  PBoolean receiver
1365  );
1366 
1370  virtual void OpenFastStartChannel(
1371  unsigned sessionID,
1372  H323Channel::Directions direction
1373  );
1374 
1389  virtual PBoolean OpenLogicalChannel(
1390  const H323Capability & capability,
1391  unsigned sessionID,
1393  );
1394 
1395  virtual void SendFlowControlCommand(
1396  unsigned channelNumber,
1397  unsigned newBitRate
1398  );
1399 
1409  virtual PBoolean OnOpenLogicalChannel(
1410  const H245_OpenLogicalChannel & openPDU,
1411  H245_OpenLogicalChannelAck & ackPDU,
1412  unsigned & errorCode,
1413  H323Channel & channel
1414  );
1415 
1423  virtual PBoolean OnConflictingLogicalChannel(
1424  H323Channel & channel
1425  );
1426 
1432  const H245_OpenLogicalChannel & open,
1433  PBoolean startingFast,
1434  unsigned & errorCode
1435  );
1436 
1472  const H323Capability & capability,
1474  unsigned sessionID,
1475  const H245_H2250LogicalChannelParameters * param
1477  );
1478 
1483  const H323Capability & capability,
1484  H323Channel::Directions direction,
1485  H323RTPSession & rtp
1486  );
1487 
1498  virtual PBoolean OnCreateLogicalChannel(
1499  const H323Capability & capability,
1501  unsigned & errorCode
1502  );
1503 
1508  virtual PBoolean OnStartLogicalChannel(
1509  H323Channel & channel
1510  );
1511 
1514  virtual void CloseLogicalChannel(
1515  unsigned number,
1516  PBoolean fromRemote
1517  );
1518 
1521  virtual void CloseLogicalChannelNumber(
1522  const H323ChannelNumber & number
1523  );
1524 
1527  virtual void CloseAllLogicalChannels(
1528  PBoolean fromRemote
1529  );
1530 
1536  virtual void OnClosedLogicalChannel(
1537  const H323Channel & channel
1538  );
1539 
1548  virtual PBoolean OnClosingLogicalChannel(
1549  H323Channel & channel
1550  );
1551 
1560  virtual void OnLogicalChannelFlowControl(
1561  H323Channel * channel,
1562  long bitRateRestriction
1563  );
1564 
1573  virtual void OnLogicalChannelJitter(
1574  H323Channel * channel,
1575  DWORD jitter,
1576  int skippedFrameCount,
1577  int additionalBuffer
1578  );
1579 
1584  unsigned number,
1585  PBoolean fromRemote
1586  ) const;
1587 
1594  unsigned sessionId,
1595  PBoolean fromRemote
1596  ) const;
1598 
1607  ) const;
1609 
1617  virtual SendUserInputModes GetRealSendUserInputMode() const;
1618 
1632  virtual PBoolean SendUserInputString(
1633  const PString & value
1634  );
1635 
1660  virtual PBoolean SendUserInputTone(
1661  char tone,
1662  unsigned duration = 0
1663  );
1664 
1671  virtual PBoolean SendUserInputIndicationQ931(
1672  const PString & value
1673  );
1674 
1681  virtual PBoolean SendUserInputIndicationString(
1682  const PString & value
1683  );
1684 
1689  virtual PBoolean SendUserInputIndicationTone(
1690  char tone,
1691  unsigned duration = 0,
1692  unsigned logicalChannel = 0,
1693  unsigned rtpTimestamp = 0
1694  );
1695 
1704  virtual PBoolean SendUserInputIndication(
1705  const H245_UserInputIndication & pdu
1706  );
1707 
1712  virtual void OnUserInputIndication(
1713  const H245_UserInputIndication & pdu
1714  );
1716 
1722  virtual PString GetSessionCodecNames(
1723  unsigned sessionID
1724  ) const;
1725 
1730  virtual void DetermineRTPNAT(
1731  const PIPSocket::Address & localAddr,
1732  const PIPSocket::Address & peerAddr,
1733  const PIPSocket::Address & signalAddr
1734  );
1735 
1753  virtual PBoolean RequestModeChange(
1754  const PString & newModes
1755  );
1756 
1764  virtual PBoolean RequestModeChange(
1765  const H245_ArrayOf_ModeDescription & newModes
1766  );
1767 
1770  virtual PBoolean OnRequestModeChange(
1771  const H245_RequestMode & pdu,
1772  H245_RequestModeAck & ack,
1773  H245_RequestModeReject & reject,
1774  PINDEX & selectedMode
1775  );
1776 
1783  virtual void OnModeChanged(
1784  const H245_ModeDescription & newMode
1785  );
1786 
1791  virtual void OnAcceptModeChange(
1792  const H245_RequestModeAck & pdu
1793  );
1794 
1799  virtual void OnRefusedModeChange(
1800  const H245_RequestModeReject * pdu
1801  );
1803 
1811  virtual PBoolean RequestModeChangeT38(
1812  const char * capabilityNames = "T.38\nT38FaxUDP"
1813  );
1814 
1824  virtual PBoolean GetAdmissionRequestAuthentication(
1825  const H225_AdmissionRequest & arq,
1826  H235Authenticators & authenticators
1827  );
1829 
1834  H323EndPoint & GetEndPoint() const { return endpoint; }
1835 
1838  PBoolean HadAnsweredCall() const { return !IsOriginating(); }
1839 
1842  PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
1843 
1848  unsigned GetDistinctiveRing() const { return distinctiveRing; }
1849 
1856  void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
1857 
1861  const PString & GetCallToken() const { return GetToken(); }
1862 
1865  unsigned GetCallReference() const { return callReference; }
1866 
1869  inline const OpalGloballyUniqueID & GetCallIdentifier() const
1870  { return callIdentifier; }
1871 
1874  virtual PString GetIdentifier() const;
1875 
1879 
1882  void SetLocalPartyName(const PString & name);
1883 
1886  const PStringList & GetLocalAliasNames() const { return localAliasNames; }
1887 
1890  virtual void SetRemotePartyInfo(
1891  const H323SignalPDU & pdu
1892  );
1893 
1896  void SetRemoteApplication(
1897  const H225_EndpointType & pdu
1898  );
1899 
1906  };
1907 
1911 
1915 
1919 
1923 
1927 
1931 
1934  unsigned GetSignallingVersion() const { return h225version; }
1935 
1938  const H323Transport & GetControlChannel() const;
1939 
1942  OpalTransport & GetTransport() const;
1943 
1946  unsigned GetControlVersion() const { return h245version; }
1947 
1950  unsigned GetUUIEsRequested() const { return uuiesRequested; }
1951 
1954  void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
1955 
1958  const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
1959 
1962  void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
1963 
1966  const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
1967 
1971  const PString & info
1972  ) { destExtraCallInfo = info; }
1973 
1976  void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
1977 
1983  int GetRemoteCallWaiting() const { return remoteCallWaiting; }
1984 
1990  unsigned seconds
1991  );
1993 
1994 
1995 #if OPAL_H239
1996 
1998  bool GetLocalH239Control() const { return m_h239Control; }
1999 
2003  bool on
2004  ) { m_h239Control = on; }
2005 
2008  bool GetRemoteH239Control() const;
2009 
2013 #endif
2014 
2015  virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
2016 
2017  virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
2018 
2019 #if OPAL_H450
2020 
2025 #endif
2026 
2027 #if OPAL_H460
2028 
2030  virtual H460_FeatureSet * GetFeatureSet();
2031 
2034  void H46019SetCallReceiver();
2035 
2038  void H46019Enabled();
2039 
2044  virtual PBoolean OnReceiveOLCGenericInformation(
2045  unsigned sessionID,
2046  const H245_ArrayOf_GenericInformation & alternate
2047  ) const;
2048 
2052  virtual PBoolean OnSendingOLCGenericInformation(
2053  const unsigned & sessionID,
2054  H245_ArrayOf_GenericInformation & gen,
2055  PBoolean isAck
2056  ) const;
2057 #endif
2058 
2059 #if OPAL_H460_NAT
2060  virtual PUDPSocket * GetNatSocket(unsigned session, PBoolean rtp);
2061 
2064  virtual void SetRTPNAT(unsigned sessionid, PUDPSocket * _rtp, PUDPSocket * _rtcp);
2065 
2066 
2071  class SessionInformation : public PObject
2072  {
2073  public:
2074  SessionInformation(const OpalGloballyUniqueID & id, const PString & token, unsigned session);
2075 
2076  const PString & GetCallToken();
2077 
2078  unsigned GetSessionID() const;
2079 
2080  const OpalGloballyUniqueID & GetCallIdentifer();
2081 
2082  const PString & GetCUI();
2083 
2084  protected:
2085  OpalGloballyUniqueID m_callID;
2086  PString m_callToken;
2087  unsigned m_sessionID;
2088  PString m_CUI;
2089  };
2090 
2091  SessionInformation * BuildSessionInformation(unsigned sessionID) const;
2092 
2093  struct NAT_Sockets
2094  {
2095  PUDPSocket * rtp;
2096  PUDPSocket * rtcp;
2097  };
2098 #endif // OPAL_H460_NAT
2099 
2100 
2106  virtual bool OnMediaCommand(
2107  OpalMediaStream & stream,
2108  const OpalMediaCommand & command
2109  );
2110 
2118  };
2119 
2121  bool HasCompatibilityIssue(
2122  CompatibilityIssues issue
2123  ) const;
2124 
2125  PBoolean StartHandleControlChannel();
2126  virtual PBoolean OnStartHandleControlChannel();
2127  void EndHandleControlChannel();
2128 
2129  protected:
2135  virtual void InternalEstablishedConnectionCheck();
2136  PBoolean InternalEndSessionCheck(PPER_Stream & strm);
2137  void SetRemoteVersions(const H225_ProtocolIdentifier & id);
2138  void SetBearerCapabilities(H323SignalPDU & pdu) const;
2139  void MonitorCallStatus();
2140  PDECLARE_NOTIFIER(PThread, H323Connection, StartOutgoing);
2141  PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
2142  PDECLARE_AcceptHandlerNotifier(H323Connection, NewIncomingControlChannel);
2143 
2145 
2147  int remoteCallWaiting; // Number of call's waiting at the remote endpoint
2150  unsigned callReference;
2154 
2156  PStringList localAliasNames;
2157  H323Capabilities localCapabilities; // Capabilities local system supports
2159  H323Capabilities remoteCapabilities; // Capabilities remote system supports
2162  unsigned uuiesRequested;
2164  PBYTEArray gkAccessTokenData;
2166 
2177 
2178  P_DECLARE_TRACED_ENUM(ConnectionStates,
2179  NoConnectionActive,
2180  AwaitingGatekeeperAdmission,
2181  AwaitingTransportConnect,
2182  AwaitingSignalConnect,
2183  AwaitingLocalAnswer,
2184  HasExecutedSignalConnect,
2185  EstablishedConnection,
2186  ShuttingDownConnection
2187  );
2188  ConnectionStates connectionState;
2189 
2190  unsigned h225version;
2191  unsigned h245version;
2196 
2203  PSyncPoint digitsWaitFlag;
2209 
2211 
2212 #if OPAL_H450
2213 
2216 #endif
2217 
2218  P_DECLARE_TRACED_ENUM(FastStartStates,
2219  FastStartDisabled,
2220  FastStartInitiate,
2221  FastStartResponse,
2222  FastStartAcknowledged
2223  );
2224  FastStartStates m_fastStartState;
2225  H323LogicalChannelList m_fastStartChannels;
2226 
2227 
2228  // The following pointers are to protocol procedures, they are pointers to
2229  // hide their complexity from the H323Connection classes users.
2235 
2236 #if OPAL_H239
2242 #endif
2243 
2244 #if OPAL_H450
2251 #endif
2252 
2253 #if OPAL_H460
2256 
2260 
2264 
2267 #endif
2268 
2269 #if OPAL_VIDEO
2271 #endif
2272 
2273 #if OPAL_H460_NAT
2274  PMutex NATSocketMutex;
2275  std::map<unsigned, NAT_Sockets> m_NATSockets;
2276 #endif // OPAL_H460_NAT
2277 
2278  private:
2279  P_REMOVE_VIRTUAL_VOID(CleanUpOnCallEnd());
2280  P_REMOVE_VIRTUAL_VOID(OnCleared());
2281  P_REMOVE_VIRTUAL_VOID(OnRTPStatistics(const OpalRTPSession &) const);
2282  P_REMOVE_VIRTUAL(PBoolean, OnOpenLogicalChannel(const H245_OpenLogicalChannel&,H245_OpenLogicalChannelAck&,unsigned&), false);
2283  P_REMOVE_VIRTUAL(PBoolean, OnOpenLogicalChannel(const H245_OpenLogicalChannel &, H245_OpenLogicalChannelAck &, unsigned &, const unsigned &), false);
2284  P_REMOVE_VIRTUAL_VOID(NatDetection(const PIPSocket::Address &, const PIPSocket::Address &));
2285  P_REMOVE_VIRTUAL(PBoolean, OnNatDetected(), false);
2286 };
2287 
2288 
2289 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
2290 
2291 
2292 #endif // OPAL_H323
2293 
2294 #endif // OPAL_H323_H323CON_H
2295 
2296