# h323con.h

Go to the documentation of this file.

    00001 /*
    00002  * h323con.h
    00003  *
    00004  * H.323 protocol handler
    00005  *
    00006  * Open H323 Library
    00007  *
    00008  * Copyright (c) 1998-2001 Equivalence Pty. Ltd.
    00009  *
    00010  * The contents of this file are subject to the Mozilla Public License
    00011  * Version 1.0 (the "License"); you may not use this file except in
    00012  * compliance with the License. You may obtain a copy of the License at
    00013  * http://www.mozilla.org/MPL/
    00014  *
    00015  * Software distributed under the License is distributed on an "AS IS"
    00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
    00017  * the License for the specific language governing rights and limitations
    00018  * under the License.
    00019  *
    00020  * The Original Code is Open H323 Library.
    00021  *
    00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
    00023  *
    00024  * Portions of this code were written with the assisance of funding from
    00025  * Vovida Networks, Inc. http://www.vovida.com.
    00026  *
    00027  * Contributor(s): ______________________________________.
    00028  *
    00029  * $Revision: 21004 $
    00030  * $Author: rjongbloed $
    00031  * $Date: 2008-09-16 07:08:56 +0000 (Tue, 16 Sep 2008) $
    00032  */
    00033
    00034 #ifndef __OPAL_H323CON_H
    00035 #define __OPAL_H323CON_H
    00036
    00037 #ifdef P_USE_PRAGMA
    00038 #pragma interface
    00039 #endif
    00040
    00041 #include <opal/buildopts.h>
    00042
    00043 #include <opal/rtpconn.h>
    00044 #include <opal/guid.h>
    00045 #include <opal/buildopts.h>
    00046 #include <h323/h323caps.h>
    00047 #include <ptclib/dtmf.h>
    00048
    00049
    00050 /* The following classes have forward references to avoid including the VERY
    00051    large header files for H225 and H245. If an application requires access
    00052    to the protocol classes they can include them, but for simple usage their
    00053    inclusion can be avoided.
    00054  */
    00055 class PPER_Stream;
    00056 class PASN_OctetString;
    00057
    00058 class H225_EndpointType;
    00059 class H225_TransportAddress;
    00060 class H225_ArrayOf_PASN_OctetString;
    00061 class H225_ProtocolIdentifier;
    00062 class H225_AdmissionRequest;
    00063 class H225_AdmissionConfirm;
    00064 class H225_AdmissionReject;
    00065 class H225_InfoRequestResponse;
    00066 class H225_DisengageRequest;
    00067 class H225_FeatureSet;
    00068
    00069 class H245_TerminalCapabilitySet;
    00070 class H245_TerminalCapabilitySetReject;
    00071 class H245_OpenLogicalChannel;
    00072 class H245_OpenLogicalChannelAck;
    00073 class H245_TransportAddress;
    00074 class H245_UserInputIndication;
    00075 class H245_RequestMode;
    00076 class H245_RequestModeAck;
    00077 class H245_RequestModeReject;
    00078 class H245_ModeDescription;
    00079 class H245_ArrayOf_ModeDescription;
    00080 class H245_SendTerminalCapabilitySet;
    00081 class H245_MultiplexCapability;
    00082 class H245_FlowControlCommand;
    00083 class H245_MiscellaneousCommand;
    00084 class H245_MiscellaneousIndication;
    00085 class H245_JitterIndication;
    00086
    00087 class H323SignalPDU;
    00088 class H323ControlPDU;
    00089 class H323EndPoint;
    00090 class H323TransportAddress;
    00091
    00092 class H235Authenticators;
    00093
    00094 class H245NegMasterSlaveDetermination;
    00095 class H245NegTerminalCapabilitySet;
    00096 class H245NegLogicalChannels;
    00097 class H245NegRequestMode;
    00098 class H245NegRoundTripDelay;
    00099
    00100 class H450xDispatcher;
    00101 class H4502Handler;
    00102 class H4504Handler;
    00103 class H4506Handler;
    00104 class H4507Handler;
    00105 class H45011Handler;
    00106
    00107 class OpalCall;
    00108
    00109 #if OPAL_H460
    00110 class H460_FeatureSet;
    00111 #endif
    00112
    00113
    00115
    00122 class H323Connection : public OpalRTPConnection
    00123 {
    00124   PCLASSINFO(H323Connection, OpalRTPConnection);
    00125
    00126   public:
    00131     H323Connection(
    00132       OpalCall & call,
    00133       H323EndPoint & endpoint,
    00134       const PString & token,
    00135       const PString & alias,
    00136       const H323TransportAddress & address,
    00137       unsigned options = 0,
    00138       OpalConnection::StringOptions * stringOptions = NULL
    00139     );
    00140
    00143     ~H323Connection();
    00145
    00156     virtual bool IsNetworkConnection() const { return true; }
    00157
    00160     virtual PString GetPrefixName() const;
    00161
    00168     virtual PBoolean SetUpConnection();
    00169
    00179     virtual PBoolean SetAlerting(
    00180       const PString & calleeName,
    00181       PBoolean withMedia
    00182     );
    00183
    00188     virtual PBoolean SetConnected();
    00189
    00194     virtual PBoolean SetProgressed();
    00195
    00203     virtual void OnEstablished();
    00204
    00222     virtual void OnReleased();
    00223
    00228     virtual PString GetDestinationAddress();
    00229
    00237     virtual OpalMediaFormatList GetMediaFormats() const;
    00238
    00241     virtual OpalMediaStreamPtr OpenMediaStream(
    00242       const OpalMediaFormat & mediaFormat,
    00243       unsigned sessionID,
    00244       bool isSource
    00245     );
    00246
    00251     virtual bool CloseMediaStream(
    00252       OpalMediaStream & stream
    00253     );
    00254
    00259     virtual PBoolean GetMediaInformation(
    00260       unsigned sessionID,
    00261       MediaInformation & info
    00262     ) const;
    00264
    00270     virtual void OnCleared();
    00271
    00277     PBoolean IsEstablished() const { return connectionState == EstablishedConnection; }
    00278
    00287     virtual void CleanUpOnCallEnd();
    00289
    00290
    00295     void AttachSignalChannel(
    00296       const PString & token,
    00297       H323Transport * channel,
    00298       PBoolean answeringCall
    00299     );
    00300
    00303     PBoolean WriteSignalPDU(
    00304       H323SignalPDU & pdu
    00305     );
    00306
    00310     virtual void HandleSignallingChannel();
    00311
    00315     virtual PBoolean HandleSignalPDU(
    00316       H323SignalPDU & pdu
    00317     );
    00318
    00322     virtual void HandleTunnelPDU(
    00323       H323SignalPDU * txPDU
    00324     );
    00325
    00333     virtual PBoolean OnReceivedSignalSetup(
    00334       const H323SignalPDU & pdu
    00335     );
    00336
    00343     virtual PBoolean OnReceivedSignalSetupAck(
    00344       const H323SignalPDU & pdu
    00345     );
    00346
    00353     virtual PBoolean OnReceivedSignalInformation(
    00354       const H323SignalPDU & pdu
    00355     );
    00356
    00365     virtual PBoolean OnReceivedCallProceeding(
    00366       const H323SignalPDU & pdu
    00367     );
    00368
    00377     virtual PBoolean OnReceivedProgress(
    00378       const H323SignalPDU & pdu
    00379     );
    00380
    00387     virtual PBoolean OnReceivedAlerting(
    00388       const H323SignalPDU & pdu
    00389     );
    00390
    00399     virtual PBoolean OnReceivedSignalConnect(
    00400       const H323SignalPDU & pdu
    00401     );
    00402
    00411     virtual PBoolean OnReceivedFacility(
    00412       const H323SignalPDU & pdu
    00413     );
    00414
    00421     virtual PBoolean OnReceivedSignalNotify(
    00422       const H323SignalPDU & pdu
    00423     );
    00424
    00431     virtual PBoolean OnReceivedSignalStatus(
    00432       const H323SignalPDU & pdu
    00433     );
    00434
    00441     virtual PBoolean OnReceivedStatusEnquiry(
    00442       const H323SignalPDU & pdu
    00443     );
    00444
    00449     virtual void OnReceivedReleaseComplete(
    00450       const H323SignalPDU & pdu
    00451     );
    00452
    00459     virtual PBoolean OnUnknownSignalPDU(
    00460       const H323SignalPDU & pdu
    00461     );
    00462
    00469     virtual void OnSendARQ(
    00470       H225_AdmissionRequest & arq
    00471     );
    00472
    00478     virtual void OnReceivedACF(
    00479       const H225_AdmissionConfirm & acf
    00480     );
    00481
    00487     virtual void OnReceivedARJ(
    00488       const H225_AdmissionReject & arj
    00489     );
    00490
    00497     virtual void OnSendIRR(
    00498       H225_InfoRequestResponse & irr
    00499     ) const;
    00500
    00507     virtual void OnSendDRQ(
    00508       H225_DisengageRequest & drq
    00509     ) const;
    00510
    00522     virtual PBoolean OnIncomingCall(
    00523       const H323SignalPDU & setupPDU,
    00524       H323SignalPDU & alertingPDU
    00525     );
    00526
    00536     virtual PBoolean ForwardCall(
    00537       const PString & forwardParty
    00538     );
    00539
    00546     virtual bool TransferConnection(
    00547       const PString & remoteParty
    00548     );
    00549
    00553     virtual bool HoldConnection();
    00554
    00559     virtual bool RetrieveConnection();
    00560
    00564     virtual PBoolean IsConnectionOnHold();
    00565
    00566 #if OPAL_H450
    00567
    00572     bool TransferCall(
    00573       const PString & remoteParty,
    00574       const PString & callIdentity = PString::Empty()
    00576     );
    00577
    00582     void ConsultationTransfer(
    00583       const PString & primaryCallToken
    00584     );
    00585
    00592     virtual void HandleConsultationTransfer(
    00593       const PString & callIdentity,
    00595       H323Connection & incoming
    00596     );
    00597
    00600     PBoolean IsTransferringCall() const;
    00601
    00604     PBoolean IsTransferredCall() const;
    00605
    00610     virtual void HandleTransferCall(
    00611       const PString & token,
    00612       const PString & identity
    00613     );
    00614
    00619     int GetCallTransferInvokeId();
    00620
    00628     virtual void HandleCallTransferFailure(
    00629       const int returnError
    00630     );
    00631
    00636     void SetAssociatedCallToken(
    00637       const PString & token
    00638     );
    00639
    00644     virtual void OnConsultationTransferSuccess(
    00645       H323Connection & secondaryCall
    00646     );
    00647
    00652     bool HoldCall(
    00653       PBoolean localHold
    00654     );
    00655
    00661     bool RetrieveCall();
    00662
    00669     void SetHoldMedia(
    00670       PChannel * audioChannel
    00671     );
    00672
    00675     PBoolean IsMediaOnHold() const;
    00676
    00679     PBoolean IsLocalHold() const;
    00680
    00683     PBoolean IsRemoteHold() const;
    00684
    00687     PBoolean IsCallOnHold() const;
    00688
    00693     virtual void IntrudeCall(
    00694       unsigned capabilityLevel
    00695     );
    00696
    00701     virtual void HandleIntrudeCall(
    00702       const PString & token,
    00703       const PString & identity
    00704     );
    00705
    00711     void SetCallIntrusion() { isCallIntrusion = PTrue; }
    00712
    00713     PBoolean IsCallIntrusion() { return isCallIntrusion; }
    00714
    00717     unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
    00718
    00722     virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
    00723       const PString & callToken,
    00724       unsigned callIntrusionProtectionLevel
    00725     );
    00726
    00727     virtual void SetIntrusionImpending();
    00728
    00729     virtual void SetForcedReleaseAccepted();
    00730
    00731     virtual void SetIntrusionNotAuthorized();
    00732
    00739     void SendCallWaitingIndication(
    00740       const unsigned nbOfAddWaitingCalls = 0
    00741     );
    00742
    00743 #endif
    00744
    00771     virtual AnswerCallResponse OnAnswerCall(
    00772       const PString & callerName,
    00773       const H323SignalPDU & setupPDU,
    00774       H323SignalPDU & connectPDU,
    00775       H323SignalPDU & progressPDU
    00776     );
    00777
    00778     virtual AnswerCallResponse OnAnswerCall(
    00779       const PString & callerName
    00780     );
    00781
    00792     void AnsweringCall(
    00793       AnswerCallResponse response
    00794     );
    00795
    00806     virtual CallEndReason SendSignalSetup(
    00807       const PString & alias,
    00808       const H323TransportAddress & address
    00809     );
    00810
    00822     virtual PBoolean OnSendSignalSetup(
    00823       H323SignalPDU & setupPDU
    00824     );
    00825
    00834     virtual PBoolean OnSendCallProceeding(
    00835       H323SignalPDU & callProceedingPDU
    00836     );
    00837
    00849     virtual PBoolean OnSendReleaseComplete(
    00850       H323SignalPDU & releaseCompletePDU
    00851     );
    00852
    00863     virtual PBoolean OnAlerting(
    00864       const H323SignalPDU & alertingPDU,
    00865       const PString & user
    00866     );
    00867
    00882     virtual PBoolean OnInsufficientDigits();
    00883
    00896     virtual void SendMoreDigits(
    00897       const PString & digits
    00898     );
    00899
    00909     virtual PBoolean OnOutgoingCall(
    00910       const H323SignalPDU & connectPDU
    00911     );
    00912
    00924     virtual PBoolean SendFastStartAcknowledge(
    00925       H225_ArrayOf_PASN_OctetString & array
    00926     );
    00927
    00939     virtual PBoolean HandleFastStartAcknowledge(
    00940       const H225_ArrayOf_PASN_OctetString & array
    00941     );
    00943
    00957     virtual PBoolean CreateOutgoingControlChannel(
    00958       const H225_TransportAddress & h245Address
    00959     );
    00960
    00973     virtual PBoolean CreateIncomingControlChannel(
    00974       H225_TransportAddress & h245Address
    00975     );
    00976
    00981     virtual PBoolean WriteControlPDU(
    00982       const H323ControlPDU & pdu
    00983     );
    00984
    00987     virtual PBoolean StartControlNegotiations();
    00988
    00991     virtual void HandleControlChannel();
    00992
    00999     virtual PBoolean HandleControlData(
    01000       PPER_Stream & strm
    01001     );
    01002
    01009     virtual PBoolean HandleControlPDU(
    01010       const H323ControlPDU & pdu
    01011     );
    01012
    01022     virtual PBoolean OnUnknownControlPDU(
    01023       const H323ControlPDU & pdu
    01024     );
    01025
    01029     virtual PBoolean OnH245Request(
    01030       const H323ControlPDU & pdu
    01031     );
    01032
    01036     virtual PBoolean OnH245Response(
    01037       const H323ControlPDU & pdu
    01038     );
    01039
    01043     virtual PBoolean OnH245Command(
    01044       const H323ControlPDU & pdu
    01045     );
    01046
    01050     virtual PBoolean OnH245Indication(
    01051       const H323ControlPDU & pdu
    01052     );
    01053
    01056     virtual PBoolean OnH245_SendTerminalCapabilitySet(
    01057       const H245_SendTerminalCapabilitySet & pdu
    01058     );
    01059
    01064     virtual PBoolean OnH245_FlowControlCommand(
    01065       const H245_FlowControlCommand & pdu
    01066     );
    01067
    01072     virtual PBoolean OnH245_MiscellaneousCommand(
    01073       const H245_MiscellaneousCommand & pdu
    01074     );
    01075
    01080     virtual PBoolean OnH245_MiscellaneousIndication(
    01081       const H245_MiscellaneousIndication & pdu
    01082     );
    01083
    01088     virtual PBoolean OnH245_JitterIndication(
    01089       const H245_JitterIndication & pdu
    01090     );
    01091
    01094     enum ControlProtocolErrors {
    01095       e_MasterSlaveDetermination,
    01096       e_CapabilityExchange,
    01097       e_LogicalChannel,
    01098       e_ModeRequest,
    01099       e_RoundTripDelay
    01100     };
    01101
    01113     virtual PBoolean OnControlProtocolError(
    01114       ControlProtocolErrors errorSource,
    01115       const void * errorData = NULL
    01116     );
    01117
    01125     virtual void OnSendCapabilitySet(
    01126       H245_TerminalCapabilitySet & pdu
    01127     );
    01128
    01140     virtual PBoolean OnReceivedCapabilitySet(
    01141       const H323Capabilities & remoteCaps,
    01142       const H245_MultiplexCapability * muxCap,
    01143       H245_TerminalCapabilitySetReject & reject
    01144     );
    01145
    01148     virtual bool SendCapabilitySet(
    01149       PBoolean empty
    01150     );
    01151
    01154     virtual bool IsSendingCapabilitySet();
    01155
    01164     virtual void OnSetLocalCapabilities();
    01165
    01168     PBoolean IsH245Master() const;
    01169
    01172     void StartRoundTripDelay();
    01173
    01176     PTimeInterval GetRoundTripDelay() const;
    01178
    01218     virtual void OnSelectLogicalChannels();
    01219
    01222     virtual void SelectDefaultLogicalChannel(
    01223       const OpalMediaType & mediaType,
    01224       unsigned sessionID
    01225     );
    01226
    01230     virtual void SelectFastStartChannels(
    01231       unsigned sessionID,
    01232       PBoolean transmitter,
    01233       PBoolean receiver
    01234     );
    01235
    01239     virtual void StartFastStartChannel(
    01240       unsigned sessionID,
    01241       H323Channel::Directions direction
    01242     );
    01243
    01258     virtual PBoolean OpenLogicalChannel(
    01259       const H323Capability & capability,
    01260       unsigned sessionID,
    01261       H323Channel::Directions dir
    01262     );
    01263
    01264     virtual void SendFlowControlCommand(
    01265       unsigned channelNumber,
    01266       unsigned newBitRate
    01267     );
    01268
    01278     virtual PBoolean OnOpenLogicalChannel(
    01279       const H245_OpenLogicalChannel & openPDU,
    01280       H245_OpenLogicalChannelAck & ackPDU,
    01281       unsigned & errorCode
    01282     );
    01283
    01291     virtual PBoolean OnConflictingLogicalChannel(
    01292       H323Channel & channel
    01293     );
    01294
    01299     virtual H323Channel * CreateLogicalChannel(
    01300       const H245_OpenLogicalChannel & open,
    01301       PBoolean startingFast,
    01302       unsigned & errorCode
    01303     );
    01304
    01339     virtual H323Channel * CreateRealTimeLogicalChannel(
    01340       const H323Capability & capability,
    01341       H323Channel::Directions dir,
    01342       unsigned sessionID,
    01343       const H245_H2250LogicalChannelParameters * param,
    01345       RTP_QOS * rtpqos = NULL
    01346     );
    01347
    01358     virtual PBoolean OnCreateLogicalChannel(
    01359       const H323Capability & capability,
    01360       H323Channel::Directions dir,
    01361       unsigned & errorCode
    01362     );
    01363
    01368     virtual PBoolean OnStartLogicalChannel(
    01369       H323Channel & channel
    01370     );
    01371
    01374     virtual void CloseLogicalChannel(
    01375       unsigned number,
    01376       PBoolean fromRemote
    01377     );
    01378
    01381     virtual void CloseLogicalChannelNumber(
    01382       const H323ChannelNumber & number
    01383     );
    01384
    01387     virtual void CloseAllLogicalChannels(
    01388       PBoolean fromRemote
    01389     );
    01390
    01396     virtual void OnClosedLogicalChannel(
    01397       const H323Channel & channel
    01398     );
    01399
    01408     virtual PBoolean OnClosingLogicalChannel(
    01409       H323Channel & channel
    01410     );
    01411
    01420     virtual void OnLogicalChannelFlowControl(
    01421       H323Channel * channel,
    01422       long bitRateRestriction
    01423     );
    01424
    01433     virtual void OnLogicalChannelJitter(
    01434       H323Channel * channel,
    01435       DWORD jitter,
    01436       int skippedFrameCount,
    01437       int additionalBuffer
    01438     );
    01439
    01443     H323Channel * GetLogicalChannel(
    01444       unsigned number,
    01445       PBoolean fromRemote
    01446     ) const;
    01447
    01453     H323Channel * FindChannel(
    01454       unsigned sessionId,
    01455       PBoolean fromRemote
    01456     ) const;
    01458
    01465     virtual PBoolean SetBandwidthAvailable(
    01466       unsigned newBandwidth,
    01467       PBoolean force = PFalse
    01468     );
    01469
    01474     virtual unsigned GetBandwidthUsed() const;
    01476
    01484     virtual SendUserInputModes GetRealSendUserInputMode() const;
    01485
    01499     virtual PBoolean SendUserInputString(
    01500       const PString & value
    01501     );
    01502
    01527     virtual PBoolean SendUserInputTone(
    01528       char tone,
    01529       unsigned duration = 0
    01530     );
    01531
    01538     virtual PBoolean SendUserInputIndicationQ931(
    01539       const PString & value
    01540     );
    01541
    01548     virtual PBoolean SendUserInputIndicationString(
    01549       const PString & value
    01550     );
    01551
    01556     virtual PBoolean SendUserInputIndicationTone(
    01557       char tone,
    01558       unsigned duration = 0,
    01559       unsigned logicalChannel = 0,
    01560       unsigned rtpTimestamp = 0
    01561     );
    01562
    01571     virtual PBoolean SendUserInputIndication(
    01572       const H245_UserInputIndication & pdu
    01573     );
    01574
    01579     virtual void OnUserInputIndication(
    01580       const H245_UserInputIndication & pdu
    01581     );
    01583
    01589     virtual H323_RTP_Session * GetSessionCallbacks(
    01590       unsigned sessionID
    01591     ) const;
    01592
    01602     virtual RTP_Session * UseSession(
    01603       const OpalTransport & transport,
    01604                    unsigned sessionID,
    01605       const OpalMediaType & mediatype,
    01606                   RTP_QOS * rtpqos = NULL
    01607     );
    01608
    01612     virtual void ReleaseSession(
    01613       unsigned sessionID
    01614     );
    01615
    01623     virtual void OnRTPStatistics(
    01624       const RTP_Session & session
    01625     ) const;
    01626
    01630     virtual PString GetSessionCodecNames(
    01631       unsigned sessionID
    01632     ) const;
    01633
    01635
    01653     virtual PBoolean RequestModeChange(
    01654       const PString & newModes
    01655     );
    01656
    01664     virtual PBoolean RequestModeChange(
    01665       const H245_ArrayOf_ModeDescription & newModes
    01666     );
    01667
    01670     virtual PBoolean OnRequestModeChange(
    01671       const H245_RequestMode & pdu,
    01672       H245_RequestModeAck & ack,
    01673       H245_RequestModeReject & reject,
    01674       PINDEX & selectedMode
    01675     );
    01676
    01683     virtual void OnModeChanged(
    01684       const H245_ModeDescription & newMode
    01685     );
    01686
    01691     virtual void OnAcceptModeChange(
    01692       const H245_RequestModeAck & pdu
    01693     );
    01694
    01699     virtual void OnRefusedModeChange(
    01700       const H245_RequestModeReject * pdu
    01701     );
    01703
    01708     virtual PBoolean RequestModeChangeT38(
    01709       const char * capabilityNames = "T.38\nT38FaxUDP"
    01710     );
    01711
    01721     virtual PBoolean GetAdmissionRequestAuthentication(
    01722       const H225_AdmissionRequest & arq,
    01723       H235Authenticators & authenticators
    01724     );
    01726
    01731     H323EndPoint & GetEndPoint() const { return endpoint; }
    01732
    01735     PBoolean HadAnsweredCall() const { return !originating; }
    01736
    01739     PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
    01740
    01745     unsigned GetDistinctiveRing() const { return distinctiveRing; }
    01746
    01753     void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
    01754
    01758     const PString & GetCallToken() const { return GetToken(); }
    01759
    01762     unsigned GetCallReference() const { return callReference; }
    01763
    01767     inline const OpalGloballyUniqueID & GetCallIdentifier() const
    01768     { return GetIdentifier(); }
    01769
    01772     const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
    01773
    01776     void SetLocalPartyName(const PString & name);
    01777
    01780     const PStringList & GetLocalAliasNames() const { return localAliasNames; }
    01781
    01784     virtual void SetRemotePartyInfo(
    01785       const H323SignalPDU & pdu
    01786     );
    01787
    01790     void SetRemoteApplication(
    01791       const H225_EndpointType & pdu
    01792     );
    01793
    01798     PString GetRemotePartyURL() const;
    01799
    01802     const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
    01803
    01806     const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
    01807
    01810     unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
    01811
    01814     const H323Transport * GetSignallingChannel() const { return signallingChannel; }
    01815
    01818     unsigned GetSignallingVersion() const { return h225version; }
    01819
    01822     const H323Transport & GetControlChannel() const;
    01823
    01826     OpalTransport & GetTransport() const;
    01827
    01830     unsigned GetControlVersion() const { return h245version; }
    01831
    01834     unsigned GetUUIEsRequested() const { return uuiesRequested; }
    01835
    01838     void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
    01839
    01842     const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
    01843
    01846     void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
    01847
    01850     const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
    01851
    01854     void SetDestExtraCallInfo(
    01855       const PString & info
    01856     ) { destExtraCallInfo = info; }
    01857
    01860     void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
    01861
    01867     int GetRemoteCallWaiting() const { return remoteCallWaiting; }
    01868
    01873     void SetEnforcedDurationLimit(
    01874       unsigned seconds
    01875     );
    01877
    01878     virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
    01879
    01880         virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
    01881
    01882 #if OPAL_H460
    01883
    01885     virtual H460_FeatureSet * GetFeatureSet();
    01886 #endif
    01887
    01888
    01889 #if OPAL_H450
    01890
    01894     H4507Handler&  getH4507handler(){return *h4507handler;}
    01895 #endif
    01896
    01914     virtual PBoolean OnOpenIncomingMediaChannels();
    01915
    01916     virtual void OnMediaCommand(OpalMediaCommand & note, INT extra);
    01917
    01918   protected:
    01924     virtual void InternalEstablishedConnectionCheck();
    01925     PBoolean InternalEndSessionCheck(PPER_Stream & strm);
    01926     void SetRemoteVersions(const H225_ProtocolIdentifier & id);
    01927     void MonitorCallStatus();
    01928     PDECLARE_NOTIFIER(PThread, H323Connection, StartOutgoing);
    01929     PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
    01930     PDECLARE_NOTIFIER(PThread, H323Connection, NewIncomingControlChannel);
    01931
    01932     H323EndPoint & endpoint;
    01933
    01934     int                  remoteCallWaiting; // Number of call's waiting at the remote endpoint
    01935     PBoolean                 gatekeeperRouted;
    01936     unsigned             distinctiveRing;
    01937     unsigned             callReference;
    01938     OpalGloballyUniqueID conferenceIdentifier;
    01939
    01940     PString            localDestinationAddress;
    01941     PStringList        localAliasNames;
    01942     H323Capabilities   localCapabilities; // Capabilities local system supports
    01943     PString            destExtraCallInfo;
    01944     H323Capabilities   remoteCapabilities; // Capabilities remote system supports
    01945     unsigned           remoteMaxAudioDelayJitter;
    01946     PTimer             roundTripDelayTimer;
    01947     WORD               maxAudioDelayJitter;
    01948     unsigned           uuiesRequested;
    01949     PString            gkAccessTokenOID;
    01950     PBYTEArray         gkAccessTokenData;
    01951     PBoolean               addAccessTokenToSetup;
    01952     PBoolean               alertDone;
    01953
    01954     H323Transport * signallingChannel;
    01955     H323Transport * controlChannel;
    01956     OpalListener  * controlListener;
    01957     PBoolean            h245Tunneling;
    01958     H323SignalPDU * h245TunnelRxPDU;
    01959     H323SignalPDU * h245TunnelTxPDU;
    01960     H323SignalPDU * setupPDU;
    01961     H323SignalPDU * alertingPDU;
    01962     H323SignalPDU * connectPDU;
    01963     H323SignalPDU * progressPDU;
    01964
    01965     enum ConnectionStates {
    01966       NoConnectionActive,
    01967       AwaitingGatekeeperAdmission,
    01968       AwaitingTransportConnect,
    01969       AwaitingSignalConnect,
    01970       AwaitingLocalAnswer,
    01971       HasExecutedSignalConnect,
    01972       EstablishedConnection,
    01973       ShuttingDownConnection,
    01974       NumConnectionStates
    01975     } connectionState;
    01976
    01977     unsigned   h225version;
    01978     unsigned   h245version;
    01979     PBoolean       h245versionSet;
    01980     PBoolean doH245inSETUP;
    01981     PBoolean lastPDUWasH245inSETUP;
    01982
    01983     PBoolean mustSendDRQ;
    01984     PBoolean mediaWaitForConnect;
    01985     PBoolean transmitterSidePaused;
    01986     bool     remoteTransmitPaused;
    01987     PBoolean earlyStart;
    01988     PString    t38ModeChangeCapabilities;
    01989     PSyncPoint digitsWaitFlag;
    01990     PBoolean       endSessionNeeded;
    01991     PSyncPoint endSessionReceived;
    01992     PTimer     enforcedDurationLimit;
    01993
    01994     // Used as part of a local call hold operation involving MOH
    01995     PChannel * holdMediaChannel;
    01996     PBoolean       isConsultationTransfer;
    01997
    01999     PBoolean     isCallIntrusion;
    02000     unsigned callIntrusionProtectionLevel;
    02001
    02002     enum FastStartStates {
    02003       FastStartDisabled,
    02004       FastStartInitiate,
    02005       FastStartResponse,
    02006       FastStartAcknowledged,
    02007       NumFastStartStates
    02008     };
    02009     FastStartStates        fastStartState;
    02010     H323LogicalChannelList fastStartChannels;
    02011     OpalMediaStreamPtr     fastStartMediaStream;
    02012
    02013 #if PTRACING
    02014     static const char * GetConnectionStatesName(ConnectionStates s);
    02015     friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << GetConnectionStatesName(s); }
    02016     static const char * GetFastStartStateName(FastStartStates s);
    02017     friend ostream & operator<<(ostream & o, FastStartStates s) { return o << GetFastStartStateName(s); }
    02018 #endif
    02019
    02020
    02021     // The following pointers are to protocol procedures, they are pointers to
    02022     // hide their complexity from the H323Connection classes users.
    02023     H245NegMasterSlaveDetermination  * masterSlaveDeterminationProcedure;
    02024     H245NegTerminalCapabilitySet     * capabilityExchangeProcedure;
    02025     H245NegLogicalChannels           * logicalChannels;
    02026     H245NegRequestMode               * requestModeProcedure;
    02027     H245NegRoundTripDelay            * roundTripDelayProcedure;
    02028
    02029 #if OPAL_H450
    02030     H450xDispatcher                  * h450dispatcher;
    02031     H4502Handler                     * h4502handler;
    02032     H4504Handler                     * h4504handler;
    02033     H4506Handler                     * h4506handler;
    02034     H4507Handler                     * h4507handler;
    02035     H45011Handler                    * h45011handler;
    02036 #endif
    02037
    02038 #if OPAL_H460
    02039     H460_FeatureSet * features;
    02040 #endif
    02041
    02042   private:
    02043     PChannel * SwapHoldMediaChannels(PChannel * newChannel);
    02044 };
    02045
    02046
    02047 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
    02048
    02049
    02050 #endif // __OPAL_H323CON_H
    02051
    02052