OPAL  Version 3.12.9
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: 30586 $
30  * $Author: rjongbloed $
31  * $Date: 2013-09-30 16:52:34 +1000 (Mon, 30 Sep 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 class PASN_Sequence;
60 
61 class H225_EndpointType;
62 class H225_TransportAddress;
63 class H225_ArrayOf_PASN_OctetString;
64 class H225_ProtocolIdentifier;
65 class H225_AdmissionRequest;
66 class H225_AdmissionConfirm;
67 class H225_AdmissionReject;
68 class H225_InfoRequestResponse;
69 class H225_DisengageRequest;
70 class H225_FeatureSet;
71 class H225_H245Security;
72 
73 class H245_TerminalCapabilitySet;
74 class H245_TerminalCapabilitySetReject;
75 class H245_OpenLogicalChannel;
76 class H245_OpenLogicalChannelAck;
77 class H245_TransportAddress;
78 class H245_UserInputIndication;
79 class H245_RequestMode;
80 class H245_RequestModeAck;
81 class H245_RequestModeReject;
82 class H245_ModeDescription;
83 class H245_ArrayOf_ModeDescription;
84 class H245_SendTerminalCapabilitySet;
85 class H245_MultiplexCapability;
86 class H245_FlowControlCommand;
87 class H245_MiscellaneousCommand;
88 class H245_MiscellaneousIndication;
89 class H245_JitterIndication;
90 class H245_ArrayOf_GenericParameter;
91 class H245_ArrayOf_GenericInformation;
92 
93 class H323SignalPDU;
94 class H323ControlPDU;
95 class H323EndPoint;
99 
100 class H235Authenticators;
101 
105 class H245NegRequestMode;
107 
108 class H450xDispatcher;
109 class H4502Handler;
110 class H4504Handler;
111 class H4506Handler;
112 class H4507Handler;
113 class H45011Handler;
114 
115 class OpalCall;
116 
117 #if OPAL_H460
118 class H460_FeatureSet;
119 #endif
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 
299  virtual unsigned GetNextSessionID(
300  const OpalMediaType & mediaType,
301  bool isSource
302  );
303 
304 #if OPAL_T38_CAPABILITY
305 
307  virtual bool SwitchFaxMediaStreams(
308  bool toT38
309  );
310 #endif
311 
315  const OpalMediaFormat & mediaFormat,
316  unsigned sessionID,
317  bool isSource
318  );
319 
324  virtual void OnClosedMediaStream(
325  const OpalMediaStream & stream
326  );
327 
337  virtual bool GetMediaTransportAddresses(
338  const OpalMediaType & mediaType,
339  OpalTransportAddressArray & transports
340  ) const;
341 
342 #if OPAL_H239
343 
354  virtual bool RequestPresentationRole(
355  bool release
356  );
357 
362  virtual bool HasPresentationRole() const;
363 #endif // OPAL_H239
364 
365 
370  void AttachSignalChannel(
371  const PString & token,
372  H323Transport * channel,
373  PBoolean answeringCall
374  );
375 
378  PBoolean WriteSignalPDU(
379  H323SignalPDU & pdu
380  );
381 
385  virtual void HandleSignallingChannel();
386 
390  virtual PBoolean HandleSignalPDU(
391  H323SignalPDU & pdu
392  );
393 
397  virtual void HandleTunnelPDU(
398  H323SignalPDU * txPDU
399  );
400 
408  virtual PBoolean OnReceivedSignalSetup(
409  const H323SignalPDU & pdu
410  );
411 
418  virtual PBoolean OnReceivedSignalSetupAck(
419  const H323SignalPDU & pdu
420  );
421 
428  virtual PBoolean OnReceivedSignalInformation(
429  const H323SignalPDU & pdu
430  );
431 
440  virtual PBoolean OnReceivedCallProceeding(
441  const H323SignalPDU & pdu
442  );
443 
452  virtual PBoolean OnReceivedProgress(
453  const H323SignalPDU & pdu
454  );
455 
462  virtual PBoolean OnReceivedAlerting(
463  const H323SignalPDU & pdu
464  );
465 
474  virtual PBoolean OnReceivedSignalConnect(
475  const H323SignalPDU & pdu
476  );
477 
486  virtual PBoolean OnReceivedFacility(
487  const H323SignalPDU & pdu
488  );
489 
496  virtual PBoolean OnReceivedSignalNotify(
497  const H323SignalPDU & pdu
498  );
499 
506  virtual PBoolean OnReceivedSignalStatus(
507  const H323SignalPDU & pdu
508  );
509 
516  virtual PBoolean OnReceivedStatusEnquiry(
517  const H323SignalPDU & pdu
518  );
519 
524  virtual void OnReceivedReleaseComplete(
525  const H323SignalPDU & pdu
526  );
527 
534  virtual PBoolean OnUnknownSignalPDU(
535  const H323SignalPDU & pdu
536  );
537 
544  virtual void OnSendARQ(
545  H225_AdmissionRequest & arq
546  );
547 
553  virtual void OnReceivedACF(
554  const H225_AdmissionConfirm & acf
555  );
556 
562  virtual void OnReceivedARJ(
563  const H225_AdmissionReject & arj
564  );
565 
572  virtual void OnSendIRR(
573  H225_InfoRequestResponse & irr
574  ) const;
575 
582  virtual void OnSendDRQ(
583  H225_DisengageRequest & drq
584  ) const;
585 
597  virtual PBoolean OnIncomingCall(
598  const H323SignalPDU & setupPDU,
600  );
601 
611  virtual PBoolean ForwardCall(
612  const PString & forwardParty
613  );
614 
621  virtual bool TransferConnection(
622  const PString & remoteParty
623  );
624 
632  virtual bool Hold(
633  bool fromRemote,
634  bool placeOnHold
635  );
636 
641  virtual bool IsOnHold(
642  bool fromRemote
643  );
644 
645 #if OPAL_H450
646 
651  bool TransferCall(
652  const PString & remoteParty,
653  const PString & callIdentity = PString::Empty()
655  );
656 
662  const PString & primaryCallToken
663  );
664 
671  virtual void HandleConsultationTransfer(
672  const PString & callIdentity,
674  H323Connection & incoming
675  );
676 
679  PBoolean IsTransferringCall() const;
680 
683  PBoolean IsTransferredCall() const;
684 
689  virtual void HandleTransferCall(
690  const PString & token,
691  const PString & identity
692  );
693 
699 
707  virtual void HandleCallTransferFailure(
708  const int returnError
709  );
710 
716  const PString & token
717  );
718 
723  virtual void OnConsultationTransferSuccess(
724  H323Connection & secondaryCall
725  );
726 
731  virtual void IntrudeCall(
732  unsigned capabilityLevel
733  );
734 
739  virtual void HandleIntrudeCall(
740  const PString & token,
741  const PString & identity
742  );
743 
750 
751  PBoolean IsCallIntrusion() { return isCallIntrusion; }
752 
756 
760  virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
761  const PString & callToken,
763  );
764 
765  virtual void SetIntrusionImpending();
766 
767  virtual void SetForcedReleaseAccepted();
768 
769  virtual void SetIntrusionNotAuthorized();
770 
778  const unsigned nbOfAddWaitingCalls = 0
779  );
780 
781 #endif
782 
809  virtual AnswerCallResponse OnAnswerCall(
810  const PString & callerName,
811  const H323SignalPDU & setupPDU,
814  );
815 
816  virtual AnswerCallResponse OnAnswerCall(
817  const PString & callerName
818  );
819 
830  void AnsweringCall(
831  AnswerCallResponse response
832  );
833 
844  virtual CallEndReason SendSignalSetup(
845  const PString & alias,
846  const H323TransportAddress & address
847  );
848 
860  virtual PBoolean OnSendSignalSetup(
862  );
863 
872  virtual PBoolean OnSendCallProceeding(
873  H323SignalPDU & callProceedingPDU
874  );
875 
887  virtual PBoolean OnSendReleaseComplete(
888  H323SignalPDU & releaseCompletePDU
889  );
890 
901  virtual PBoolean OnAlerting(
902  const H323SignalPDU & alertingPDU,
903  const PString & user
904  );
905 
920  virtual PBoolean OnInsufficientDigits();
921 
934  virtual void SendMoreDigits(
935  const PString & digits
936  );
937 
947  virtual PBoolean OnOutgoingCall(
948  const H323SignalPDU & connectPDU
949  );
950 
962  virtual PBoolean SendFastStartAcknowledge(
963  H225_ArrayOf_PASN_OctetString & array
964  );
965 
977  virtual PBoolean HandleFastStartAcknowledge(
978  const H225_ArrayOf_PASN_OctetString & array
979  );
981 
995  virtual PBoolean CreateOutgoingControlChannel(
996  const PASN_Sequence & enclosingPDU,
997  const H225_TransportAddress & h245Address,
998  unsigned h245AddressField,
999  const H225_H245Security & h245Security,
1000  unsigned h245SecurityField
1001  );
1002 
1015  virtual PBoolean CreateIncomingControlChannel(
1016  PASN_Sequence & enclosingPDU,
1017  H225_TransportAddress & h245Address,
1018  unsigned h245AddressField,
1019  H225_H245Security & h245Security,
1020  unsigned h245SecurityField
1021  );
1022 
1027  virtual PBoolean WriteControlPDU(
1028  const H323ControlPDU & pdu
1029  );
1030 
1033  virtual PBoolean StartControlNegotiations();
1034 
1037  virtual void HandleControlChannel();
1038 
1045  virtual PBoolean HandleControlData(
1046  PPER_Stream & strm
1047  );
1048 
1055  virtual PBoolean HandleControlPDU(
1056  const H323ControlPDU & pdu
1057  );
1058 
1062  virtual PBoolean HandleReceivedControlPDU(
1063  PBoolean readStatus,
1064  PPER_Stream & strm
1065  );
1066 
1076  virtual PBoolean OnUnknownControlPDU(
1077  const H323ControlPDU & pdu
1078  );
1079 
1083  virtual PBoolean OnH245Request(
1084  const H323ControlPDU & pdu
1085  );
1086 
1090  virtual PBoolean OnH245Response(
1091  const H323ControlPDU & pdu
1092  );
1093 
1097  virtual PBoolean OnH245Command(
1098  const H323ControlPDU & pdu
1099  );
1100 
1104  virtual PBoolean OnH245Indication(
1105  const H323ControlPDU & pdu
1106  );
1107 
1110  virtual PBoolean OnH245_SendTerminalCapabilitySet(
1111  const H245_SendTerminalCapabilitySet & pdu
1112  );
1113 
1118  virtual PBoolean OnH245_FlowControlCommand(
1119  const H245_FlowControlCommand & pdu
1120  );
1121 
1126  virtual PBoolean OnH245_MiscellaneousCommand(
1127  const H245_MiscellaneousCommand & pdu
1128  );
1129 
1134  virtual PBoolean OnH245_MiscellaneousIndication(
1135  const H245_MiscellaneousIndication & pdu
1136  );
1137 
1142  virtual PBoolean OnH245_JitterIndication(
1143  const H245_JitterIndication & pdu
1144  );
1145 
1146 #if OPAL_H239
1147 
1149  virtual bool OnH239Message(
1150  unsigned subMessage,
1151  const H245_ArrayOf_GenericParameter & params
1152  );
1153 
1157  virtual bool OnH239FlowControlRequest(
1158  unsigned logicalChannel,
1159  unsigned bitRate
1160  );
1161 
1165  virtual bool OnH239FlowControlResponse(
1166  unsigned logicalChannel,
1167  bool rejected
1168  );
1169 
1173  virtual bool OnH239PresentationRequest(
1174  unsigned logicalChannel,
1175  unsigned symmetryBreaking,
1176  unsigned terminalLabel
1177  );
1178 
1184  virtual bool SendH239PresentationRequest(
1185  unsigned logicalChannel,
1186  unsigned symmetryBreaking,
1187  unsigned terminalLabel
1188  );
1189 
1193  virtual bool OnH239PresentationResponse(
1194  unsigned logicalChannel,
1195  unsigned terminalLabel,
1196  bool rejected
1197  );
1198 
1202  virtual bool OnH239PresentationRelease(
1203  unsigned logicalChannel,
1204  unsigned terminalLabel
1205  );
1206 
1211  virtual bool SendH239PresentationRelease(
1212  unsigned logicalChannel,
1213  unsigned terminalLabel
1214  );
1215 
1219  virtual bool OnH239PresentationIndication(
1220  unsigned logicalChannel,
1221  unsigned terminalLabel
1222  );
1223 #endif // OPAL_H239
1224 
1233  };
1234 
1246  virtual PBoolean OnControlProtocolError(
1247  ControlProtocolErrors errorSource,
1248  const void * errorData = NULL
1249  );
1250 
1258  virtual void OnSendCapabilitySet(
1259  H245_TerminalCapabilitySet & pdu
1260  );
1261 
1273  virtual PBoolean OnReceivedCapabilitySet(
1274  const H323Capabilities & remoteCaps,
1275  const H245_MultiplexCapability * muxCap,
1276  H245_TerminalCapabilitySetReject & reject
1277  );
1278 
1281  virtual bool SendCapabilitySet(
1282  PBoolean empty
1283  );
1284 
1287  virtual bool IsSendingCapabilitySet();
1288 
1297  virtual void OnSetLocalCapabilities();
1298 
1303  H245_OpenLogicalChannel & /*open*/,
1304  PBoolean /*forward*/
1305  ) { }
1306 
1309  PBoolean IsH245Master() const;
1310 
1313  void StartRoundTripDelay();
1314 
1317  PTimeInterval GetRoundTripDelay() const;
1319 
1359  virtual void OnSelectLogicalChannels();
1360 
1363  virtual void SelectDefaultLogicalChannel(
1364  const OpalMediaType & mediaType,
1365  unsigned sessionID
1366  );
1367 
1371  virtual void SelectFastStartChannels(
1372  unsigned sessionID,
1373  PBoolean transmitter,
1374  PBoolean receiver
1375  );
1376 
1380  virtual void OpenFastStartChannel(
1381  unsigned sessionID,
1382  H323Channel::Directions direction
1383  );
1384 
1399  virtual PBoolean OpenLogicalChannel(
1400  const H323Capability & capability,
1401  unsigned sessionID,
1403  );
1404 
1405  virtual void SendFlowControlCommand(
1406  unsigned channelNumber,
1407  unsigned newBitRate
1408  );
1409 
1419  virtual PBoolean OnOpenLogicalChannel(
1420  const H245_OpenLogicalChannel & openPDU,
1421  H245_OpenLogicalChannelAck & ackPDU,
1422  unsigned & errorCode,
1423  H323Channel & channel
1424  );
1425 
1433  virtual PBoolean OnConflictingLogicalChannel(
1434  H323Channel & channel
1435  );
1436 
1442  const H245_OpenLogicalChannel & open,
1443  PBoolean startingFast,
1444  unsigned & errorCode
1445  );
1446 
1482  const H323Capability & capability,
1484  unsigned sessionID,
1485  const H245_H2250LogicalChannelParameters * param
1487  );
1488 
1493  const H323Capability & capability,
1494  H323Channel::Directions direction,
1495  H323RTPSession & rtp
1496  );
1497 
1508  virtual PBoolean OnCreateLogicalChannel(
1509  const H323Capability & capability,
1511  unsigned & errorCode
1512  );
1513 
1518  virtual PBoolean OnStartLogicalChannel(
1519  H323Channel & channel
1520  );
1521 
1524  virtual void CloseLogicalChannel(
1525  unsigned number,
1526  PBoolean fromRemote
1527  );
1528 
1531  virtual void CloseLogicalChannelNumber(
1532  const H323ChannelNumber & number
1533  );
1534 
1537  virtual void CloseAllLogicalChannels(
1538  PBoolean fromRemote
1539  );
1540 
1546  virtual void OnClosedLogicalChannel(
1547  const H323Channel & channel
1548  );
1549 
1558  virtual PBoolean OnClosingLogicalChannel(
1559  H323Channel & channel
1560  );
1561 
1570  virtual void OnLogicalChannelFlowControl(
1571  H323Channel * channel,
1572  long bitRateRestriction
1573  );
1574 
1583  virtual void OnLogicalChannelJitter(
1584  H323Channel * channel,
1585  DWORD jitter,
1586  int skippedFrameCount,
1587  int additionalBuffer
1588  );
1589 
1594  unsigned number,
1595  PBoolean fromRemote
1596  ) const;
1597 
1604  unsigned sessionId,
1605  PBoolean fromRemote
1606  ) const;
1608 
1617  ) const;
1619 
1627  virtual SendUserInputModes GetRealSendUserInputMode() const;
1628 
1642  virtual PBoolean SendUserInputString(
1643  const PString & value
1644  );
1645 
1670  virtual PBoolean SendUserInputTone(
1671  char tone,
1672  unsigned duration = 0
1673  );
1674 
1681  virtual PBoolean SendUserInputIndicationQ931(
1682  const PString & value
1683  );
1684 
1691  virtual PBoolean SendUserInputIndicationString(
1692  const PString & value
1693  );
1694 
1699  virtual PBoolean SendUserInputIndicationTone(
1700  char tone,
1701  unsigned duration = 0,
1702  unsigned logicalChannel = 0,
1703  unsigned rtpTimestamp = 0
1704  );
1705 
1714  virtual PBoolean SendUserInputIndication(
1715  const H245_UserInputIndication & pdu
1716  );
1717 
1722  virtual void OnUserInputIndication(
1723  const H245_UserInputIndication & pdu
1724  );
1726 
1732  virtual PString GetSessionCodecNames(
1733  unsigned sessionID
1734  ) const;
1735 
1740  virtual void DetermineRTPNAT(
1741  const PIPSocket::Address & localAddr,
1742  const PIPSocket::Address & peerAddr,
1743  const PIPSocket::Address & signalAddr
1744  );
1745 
1763  virtual PBoolean RequestModeChange(
1764  const PString & newModes
1765  );
1766 
1774  virtual PBoolean RequestModeChange(
1775  const H245_ArrayOf_ModeDescription & newModes
1776  );
1777 
1780  virtual PBoolean OnRequestModeChange(
1781  const H245_RequestMode & pdu,
1782  H245_RequestModeAck & ack,
1783  H245_RequestModeReject & reject,
1784  PINDEX & selectedMode
1785  );
1786 
1793  virtual void OnModeChanged(
1794  const H245_ModeDescription & newMode
1795  );
1796 
1801  virtual void OnAcceptModeChange(
1802  const H245_RequestModeAck & pdu
1803  );
1804 
1809  virtual void OnRefusedModeChange(
1810  const H245_RequestModeReject * pdu
1811  );
1813 
1821  virtual PBoolean RequestModeChangeT38(
1822  const char * capabilityNames = "T.38\nT38FaxUDP"
1823  );
1824 
1834  virtual PBoolean GetAdmissionRequestAuthentication(
1835  const H225_AdmissionRequest & arq,
1836  H235Authenticators & authenticators
1837  );
1839 
1844  H323EndPoint & GetEndPoint() const { return endpoint; }
1845 
1848  PBoolean HadAnsweredCall() const { return !IsOriginating(); }
1849 
1852  PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
1853 
1858  unsigned GetDistinctiveRing() const { return distinctiveRing; }
1859 
1866  void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
1867 
1871  const PString & GetCallToken() const { return GetToken(); }
1872 
1875  unsigned GetCallReference() const { return callReference; }
1876 
1879  inline const OpalGloballyUniqueID & GetCallIdentifier() const
1880  { return callIdentifier; }
1881 
1884  virtual PString GetIdentifier() const;
1885 
1889 
1892  void SetLocalPartyName(const PString & name);
1893 
1896  const PStringList & GetLocalAliasNames() const { return localAliasNames; }
1897 
1900  virtual void SetRemotePartyInfo(
1901  const H323SignalPDU & pdu
1902  );
1903 
1906  void SetRemoteApplication(
1907  const H225_EndpointType & pdu
1908  );
1909 
1916  };
1917 
1921 
1925 
1929 
1933 
1937 
1941 
1944  unsigned GetSignallingVersion() const { return h225version; }
1945 
1948  const H323Transport & GetControlChannel() const;
1949 
1952  OpalTransport & GetTransport() const;
1953 
1956  unsigned GetControlVersion() const { return h245version; }
1957 
1960  unsigned GetUUIEsRequested() const { return uuiesRequested; }
1961 
1964  void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
1965 
1968  const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
1969 
1972  void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
1973 
1976  const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
1977 
1981  const PString & info
1982  ) { destExtraCallInfo = info; }
1983 
1986  void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
1987 
1993  int GetRemoteCallWaiting() const { return remoteCallWaiting; }
1994 
2000  unsigned seconds
2001  );
2003 
2004 
2005 #if OPAL_H239
2006 
2008  bool GetLocalH239Control() const { return m_h239Control; }
2009 
2013  bool on
2014  ) { m_h239Control = on; }
2015 
2018  bool GetRemoteH239Control() const;
2019 
2023 #endif
2024 
2025  virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
2026 
2027  virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
2028 
2029 #if OPAL_H450
2030 
2035 #endif
2036 
2037 #if OPAL_H460
2038 
2040  virtual H460_FeatureSet * GetFeatureSet();
2041 
2044  void H46019SetCallReceiver();
2045 
2048  void H46019Enabled();
2049 
2054  virtual PBoolean OnReceiveOLCGenericInformation(
2055  unsigned sessionID,
2056  const H245_ArrayOf_GenericInformation & alternate
2057  ) const;
2058 
2062  virtual PBoolean OnSendingOLCGenericInformation(
2063  const unsigned & sessionID,
2064  H245_ArrayOf_GenericInformation & gen,
2065  PBoolean isAck
2066  ) const;
2067 #endif
2068 
2069 #if OPAL_H460_NAT
2070  virtual PUDPSocket * GetNatSocket(unsigned session, PBoolean rtp);
2071 
2074  virtual void SetRTPNAT(unsigned sessionid, PUDPSocket * _rtp, PUDPSocket * _rtcp);
2075 
2076 
2081  class SessionInformation : public PObject
2082  {
2083  public:
2084  SessionInformation(const OpalGloballyUniqueID & id, const PString & token, unsigned session);
2085 
2086  const PString & GetCallToken();
2087 
2088  unsigned GetSessionID() const;
2089 
2090  const OpalGloballyUniqueID & GetCallIdentifer();
2091 
2092  const PString & GetCUI();
2093 
2094  protected:
2095  OpalGloballyUniqueID m_callID;
2096  PString m_callToken;
2097  unsigned m_sessionID;
2098  PString m_CUI;
2099  };
2100 
2101  SessionInformation * BuildSessionInformation(unsigned sessionID) const;
2102 
2103  struct NAT_Sockets
2104  {
2105  PUDPSocket * rtp;
2106  PUDPSocket * rtcp;
2107  };
2108 #endif // OPAL_H460_NAT
2109 
2110 
2116  virtual bool OnMediaCommand(
2117  OpalMediaStream & stream,
2118  const OpalMediaCommand & command
2119  );
2120 
2128  };
2129 
2131  bool HasCompatibilityIssue(
2132  CompatibilityIssues issue
2133  ) const;
2134 
2135  PBoolean StartHandleControlChannel();
2136  virtual PBoolean OnStartHandleControlChannel();
2137  void EndHandleControlChannel();
2138 
2139  protected:
2145  virtual void InternalEstablishedConnectionCheck();
2146  PBoolean InternalEndSessionCheck(PPER_Stream & strm);
2147  void SetRemoteVersions(const H225_ProtocolIdentifier & id);
2148  void SetBearerCapabilities(H323SignalPDU & pdu) const;
2149  void MonitorCallStatus();
2150  PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
2151  PDECLARE_AcceptHandlerNotifier(H323Connection, NewIncomingControlChannel);
2152 
2154 
2156  int remoteCallWaiting; // Number of call's waiting at the remote endpoint
2159  unsigned callReference;
2163 
2165  PStringList localAliasNames;
2166  H323Capabilities localCapabilities; // Capabilities local system supports
2168  H323Capabilities remoteCapabilities; // Capabilities remote system supports
2171  unsigned uuiesRequested;
2173  PBYTEArray gkAccessTokenData;
2175 
2186 
2187  P_DECLARE_TRACED_ENUM(ConnectionStates,
2188  NoConnectionActive,
2189  AwaitingGatekeeperAdmission,
2190  AwaitingTransportConnect,
2191  AwaitingSignalConnect,
2192  AwaitingLocalAnswer,
2193  HasExecutedSignalConnect,
2194  EstablishedConnection,
2195  ShuttingDownConnection
2196  );
2197  ConnectionStates connectionState;
2198 
2199  unsigned h225version;
2200  unsigned h245version;
2205 
2212  PSyncPoint digitsWaitFlag;
2218 
2220 
2221 #if OPAL_H450
2222 
2225 #endif
2226 
2227  P_DECLARE_TRACED_ENUM(FastStartStates,
2228  FastStartDisabled,
2229  FastStartInitiate,
2230  FastStartResponse,
2231  FastStartAcknowledged
2232  );
2233  FastStartStates m_fastStartState;
2234  H323LogicalChannelList m_fastStartChannels;
2235 
2236 
2237  // The following pointers are to protocol procedures, they are pointers to
2238  // hide their complexity from the H323Connection classes users.
2244 
2245 #if OPAL_H239
2251 #endif
2252 
2253 #if OPAL_H450
2260 #endif
2261 
2262 #if OPAL_H460
2265 
2269 
2273 
2276 #endif
2277 
2278 #if OPAL_VIDEO
2280 #endif
2281 
2282 #if OPAL_H460_NAT
2283  PMutex NATSocketMutex;
2284  std::map<unsigned, NAT_Sockets> m_NATSockets;
2285 #endif // OPAL_H460_NAT
2286 
2287  private:
2288  P_REMOVE_VIRTUAL_VOID(CleanUpOnCallEnd());
2289  P_REMOVE_VIRTUAL_VOID(OnCleared());
2290  P_REMOVE_VIRTUAL_VOID(OnRTPStatistics(const OpalRTPSession &) const);
2291  P_REMOVE_VIRTUAL(PBoolean, OnOpenLogicalChannel(const H245_OpenLogicalChannel&,H245_OpenLogicalChannelAck&,unsigned&), false);
2292  P_REMOVE_VIRTUAL(PBoolean, OnOpenLogicalChannel(const H245_OpenLogicalChannel &, H245_OpenLogicalChannelAck &, unsigned &, const unsigned &), false);
2293  P_REMOVE_VIRTUAL_VOID(NatDetection(const PIPSocket::Address &, const PIPSocket::Address &));
2294  P_REMOVE_VIRTUAL(PBoolean, OnNatDetected(), false);
2295 };
2296 
2297 
2298 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
2299 
2300 
2301 #endif // OPAL_H323
2302 
2303 #endif // OPAL_H323_H323CON_H
2304 
2305