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: 24879 $
00030  * $Author: rjongbloed $
00031  * $Date: 2010-11-16 21:56:23 -0600 (Tue, 16 Nov 2010) $
00032  */
00033 
00034 #ifndef OPAL_H323_H323CON_H
00035 #define OPAL_H323_H323CON_H
00036 
00037 #ifdef P_USE_PRAGMA
00038 #pragma interface
00039 #endif
00040 
00041 #include <opal/buildopts.h>
00042 
00043 #if OPAL_H323
00044 
00045 #include <opal/rtpconn.h>
00046 #include <opal/guid.h>
00047 #include <opal/buildopts.h>
00048 #include <h323/h323caps.h>
00049 #include <ptclib/dtmf.h>
00050 
00051 
00052 /* The following classes have forward references to avoid including the VERY
00053    large header files for H225 and H245. If an application requires access
00054    to the protocol classes they can include them, but for simple usage their
00055    inclusion can be avoided.
00056  */
00057 class PPER_Stream;
00058 class PASN_OctetString;
00059 
00060 class H225_EndpointType;
00061 class H225_TransportAddress;
00062 class H225_ArrayOf_PASN_OctetString;
00063 class H225_ProtocolIdentifier;
00064 class H225_AdmissionRequest;
00065 class H225_AdmissionConfirm;
00066 class H225_AdmissionReject;
00067 class H225_InfoRequestResponse;
00068 class H225_DisengageRequest;
00069 class H225_FeatureSet;
00070 
00071 class H245_TerminalCapabilitySet;
00072 class H245_TerminalCapabilitySetReject;
00073 class H245_OpenLogicalChannel;
00074 class H245_OpenLogicalChannelAck;
00075 class H245_TransportAddress;
00076 class H245_UserInputIndication;
00077 class H245_RequestMode;
00078 class H245_RequestModeAck;
00079 class H245_RequestModeReject;
00080 class H245_ModeDescription;
00081 class H245_ArrayOf_ModeDescription;
00082 class H245_SendTerminalCapabilitySet;
00083 class H245_MultiplexCapability;
00084 class H245_FlowControlCommand;
00085 class H245_MiscellaneousCommand;
00086 class H245_MiscellaneousIndication;
00087 class H245_JitterIndication;
00088 class H245_ArrayOf_GenericParameter;
00089 
00090 class H323SignalPDU;
00091 class H323ControlPDU;
00092 class H323EndPoint;
00093 class H323TransportAddress;
00094 
00095 class H235Authenticators;
00096 
00097 class H245NegMasterSlaveDetermination;
00098 class H245NegTerminalCapabilitySet;
00099 class H245NegLogicalChannels;
00100 class H245NegRequestMode;
00101 class H245NegRoundTripDelay;
00102 
00103 class H450xDispatcher;
00104 class H4502Handler;
00105 class H4504Handler;
00106 class H4506Handler;
00107 class H4507Handler;
00108 class H45011Handler;
00109 
00110 class OpalCall;
00111 
00112 #if OPAL_H460
00113 class H460_FeatureSet;
00114 #endif
00115 
00116 
00119 #define OPAL_OPT_Q931_BEARER_CAPS "Q931-Bearer-Caps"
00120 
00121 
00123 
00130 class H323Connection : public OpalRTPConnection
00131 {
00132   PCLASSINFO(H323Connection, OpalRTPConnection);
00133 
00134   public:
00139     H323Connection(
00140       OpalCall & call,                         
00141       H323EndPoint & endpoint,                 
00142       const PString & token,                   
00143       const PString & alias,                   
00144       const H323TransportAddress & address,    
00145       unsigned options = 0,                    
00146       OpalConnection::StringOptions * stringOptions = NULL 
00147     );
00148 
00151     ~H323Connection();
00153 
00164     virtual bool IsNetworkConnection() const { return true; }
00165 
00168     virtual PString GetPrefixName() const;
00169 
00171     virtual void OnApplyStringOptions();
00172 
00179     virtual PBoolean SetUpConnection();
00180 
00190     virtual PBoolean SetAlerting(
00191       const PString & calleeName,   
00192       PBoolean withMedia                
00193     );
00194 
00199     virtual PBoolean SetConnected();
00200 
00205     virtual PBoolean SetProgressed();
00206     
00214     virtual void OnEstablished();
00215 
00233     virtual void OnReleased();
00234 
00239     virtual PString GetDestinationAddress();
00240 
00254     virtual PString GetAlertingType() const;
00255 
00269     virtual bool SetAlertingType(const PString & info);
00270 
00278     virtual OpalMediaFormatList GetMediaFormats() const;
00279 
00282     virtual unsigned GetNextSessionID(
00283       const OpalMediaType & mediaType,   
00284       bool isSource                      
00285     );
00286 
00287 #if OPAL_FAX
00288 
00290     virtual bool SwitchFaxMediaStreams(
00291       bool enableFax  
00292     );
00293 #endif
00294 
00297     virtual OpalMediaStreamPtr OpenMediaStream(
00298       const OpalMediaFormat & mediaFormat, 
00299       unsigned sessionID,                  
00300       bool isSource                        
00301     );
00302     
00307     virtual bool CloseMediaStream(
00308       OpalMediaStream & stream  
00309     );
00310 
00315     virtual PBoolean GetMediaInformation(
00316       unsigned sessionID,     
00317       MediaInformation & info 
00318     ) const;
00320 
00325     void AttachSignalChannel(
00326       const PString & token,    
00327       H323Transport * channel,  
00328       PBoolean answeringCall        
00329     );
00330 
00333     PBoolean WriteSignalPDU(
00334       H323SignalPDU & pdu       
00335     );
00336 
00340     virtual void HandleSignallingChannel();
00341 
00345     virtual PBoolean HandleSignalPDU(
00346       H323SignalPDU & pdu       
00347     );
00348 
00352     virtual void HandleTunnelPDU(
00353       H323SignalPDU * txPDU       
00354     );
00355 
00363     virtual PBoolean OnReceivedSignalSetup(
00364       const H323SignalPDU & pdu   
00365     );
00366 
00373     virtual PBoolean OnReceivedSignalSetupAck(
00374       const H323SignalPDU & pdu   
00375     );
00376 
00383     virtual PBoolean OnReceivedSignalInformation(
00384       const H323SignalPDU & pdu   
00385     );
00386 
00395     virtual PBoolean OnReceivedCallProceeding(
00396       const H323SignalPDU & pdu   
00397     );
00398 
00407     virtual PBoolean OnReceivedProgress(
00408       const H323SignalPDU & pdu   
00409     );
00410 
00417     virtual PBoolean OnReceivedAlerting(
00418       const H323SignalPDU & pdu   
00419     );
00420 
00429     virtual PBoolean OnReceivedSignalConnect(
00430       const H323SignalPDU & pdu   
00431     );
00432 
00441     virtual PBoolean OnReceivedFacility(
00442       const H323SignalPDU & pdu   
00443     );
00444 
00451     virtual PBoolean OnReceivedSignalNotify(
00452       const H323SignalPDU & pdu   
00453     );
00454 
00461     virtual PBoolean OnReceivedSignalStatus(
00462       const H323SignalPDU & pdu   
00463     );
00464 
00471     virtual PBoolean OnReceivedStatusEnquiry(
00472       const H323SignalPDU & pdu   
00473     );
00474 
00479     virtual void OnReceivedReleaseComplete(
00480       const H323SignalPDU & pdu   
00481     );
00482 
00489     virtual PBoolean OnUnknownSignalPDU(
00490       const H323SignalPDU & pdu  
00491     );
00492 
00499     virtual void OnSendARQ(
00500       H225_AdmissionRequest & arq
00501     );
00502 
00508     virtual void OnReceivedACF(
00509       const H225_AdmissionConfirm & acf
00510     );
00511 
00517     virtual void OnReceivedARJ(
00518       const H225_AdmissionReject & arj
00519     );
00520 
00527     virtual void OnSendIRR(
00528       H225_InfoRequestResponse & irr
00529     ) const;
00530 
00537     virtual void OnSendDRQ(
00538       H225_DisengageRequest & drq
00539     ) const;
00540 
00552     virtual PBoolean OnIncomingCall(
00553       const H323SignalPDU & setupPDU,   
00554       H323SignalPDU & alertingPDU       
00555     );
00556 
00566     virtual PBoolean ForwardCall(
00567       const PString & forwardParty   
00568     );
00569 
00576     virtual bool TransferConnection(
00577       const PString & remoteParty   
00578     );
00579 
00587     virtual bool Hold(
00588       bool fromRemote,  
00589       bool placeOnHold  
00590     );
00591 
00596     virtual bool IsOnHold(
00597       bool fromRemote  
00598     );
00599 
00600 #if OPAL_H450
00601 
00606     bool TransferCall(
00607       const PString & remoteParty,   
00608       const PString & callIdentity = PString::Empty()
00610     );
00611 
00616     void ConsultationTransfer(
00617       const PString & primaryCallToken  
00618     );
00619 
00626     virtual void HandleConsultationTransfer(
00627       const PString & callIdentity, 
00629       H323Connection & incoming     
00630     );
00631 
00634     PBoolean IsTransferringCall() const;
00635 
00638     PBoolean IsTransferredCall() const;
00639 
00644     virtual void HandleTransferCall(
00645       const PString & token,
00646       const PString & identity
00647     );
00648 
00653     int GetCallTransferInvokeId();
00654 
00662     virtual void HandleCallTransferFailure(
00663       const int returnError    
00664     );
00665 
00670     void SetAssociatedCallToken(
00671       const PString & token  
00672     );
00673 
00678     virtual void OnConsultationTransferSuccess(
00679       H323Connection & secondaryCall  
00680     );
00681 
00686     bool HoldCall(
00687       PBoolean localHold   
00688     );
00689 
00695     bool RetrieveCall();
00696 
00703     void SetHoldMedia(
00704       PChannel * audioChannel
00705     );
00706 
00709     PBoolean IsMediaOnHold() const;
00710 
00713     PBoolean IsLocalHold() const;
00714 
00717     PBoolean IsRemoteHold() const;
00718 
00721     PBoolean IsCallOnHold() const;
00722 
00727     virtual void IntrudeCall(
00728       unsigned capabilityLevel
00729     );
00730 
00735     virtual void HandleIntrudeCall(
00736       const PString & token,
00737       const PString & identity
00738     );
00739 
00745     void SetCallIntrusion() { isCallIntrusion = true; }
00746 
00747     PBoolean IsCallIntrusion() { return isCallIntrusion; }
00748 
00751     unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
00752 
00756     virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
00757       const PString & callToken,
00758       unsigned callIntrusionProtectionLevel
00759     );
00760 
00761     virtual void SetIntrusionImpending();
00762 
00763     virtual void SetForcedReleaseAccepted();
00764 
00765     virtual void SetIntrusionNotAuthorized();
00766 
00773     void SendCallWaitingIndication(
00774       const unsigned nbOfAddWaitingCalls = 0   
00775     );
00776 
00777 #endif
00778 
00805     virtual AnswerCallResponse OnAnswerCall(
00806       const PString & callerName,       
00807       const H323SignalPDU & setupPDU,   
00808       H323SignalPDU & connectPDU,       
00809       H323SignalPDU & progressPDU       
00810     );
00811     
00812     virtual AnswerCallResponse OnAnswerCall(
00813       const PString & callerName        
00814     );
00815 
00826     void AnsweringCall(
00827       AnswerCallResponse response 
00828     );
00829 
00840     virtual CallEndReason SendSignalSetup(
00841       const PString & alias,                
00842       const H323TransportAddress & address  
00843     );
00844 
00856     virtual PBoolean OnSendSignalSetup(
00857       H323SignalPDU & setupPDU   
00858     );
00859 
00868     virtual PBoolean OnSendCallProceeding(
00869       H323SignalPDU & callProceedingPDU   
00870     );
00871 
00883     virtual PBoolean OnSendReleaseComplete(
00884       H323SignalPDU & releaseCompletePDU 
00885     );
00886 
00897     virtual PBoolean OnAlerting(
00898       const H323SignalPDU & alertingPDU,  
00899       const PString & user                
00900     );
00901 
00916     virtual PBoolean OnInsufficientDigits();
00917 
00930     virtual void SendMoreDigits(
00931       const PString & digits    
00932     );
00933 
00943     virtual PBoolean OnOutgoingCall(
00944       const H323SignalPDU & connectPDU   
00945     );
00946 
00958     virtual PBoolean SendFastStartAcknowledge(
00959       H225_ArrayOf_PASN_OctetString & array   
00960     );
00961 
00973     virtual PBoolean HandleFastStartAcknowledge(
00974       const H225_ArrayOf_PASN_OctetString & array   
00975     );
00977 
00991     virtual PBoolean CreateOutgoingControlChannel(
00992       const H225_TransportAddress & h245Address   
00993     );
00994 
01007     virtual PBoolean CreateIncomingControlChannel(
01008       H225_TransportAddress & h245Address  
01009     );
01010 
01015     virtual PBoolean WriteControlPDU(
01016       const H323ControlPDU & pdu
01017     );
01018 
01021     virtual PBoolean StartControlNegotiations();
01022 
01025     virtual void HandleControlChannel();
01026 
01033     virtual PBoolean HandleControlData(
01034       PPER_Stream & strm
01035     );
01036 
01043     virtual PBoolean HandleControlPDU(
01044       const H323ControlPDU & pdu
01045     );
01046 
01056     virtual PBoolean OnUnknownControlPDU(
01057       const H323ControlPDU & pdu  
01058     );
01059 
01063     virtual PBoolean OnH245Request(
01064       const H323ControlPDU & pdu  
01065     );
01066 
01070     virtual PBoolean OnH245Response(
01071       const H323ControlPDU & pdu  
01072     );
01073 
01077     virtual PBoolean OnH245Command(
01078       const H323ControlPDU & pdu  
01079     );
01080 
01084     virtual PBoolean OnH245Indication(
01085       const H323ControlPDU & pdu  
01086     );
01087 
01090     virtual PBoolean OnH245_SendTerminalCapabilitySet(
01091       const H245_SendTerminalCapabilitySet & pdu  
01092     );
01093 
01098     virtual PBoolean OnH245_FlowControlCommand(
01099       const H245_FlowControlCommand & pdu  
01100     );
01101 
01106     virtual PBoolean OnH245_MiscellaneousCommand(
01107       const H245_MiscellaneousCommand & pdu  
01108     );
01109 
01114     virtual PBoolean OnH245_MiscellaneousIndication(
01115       const H245_MiscellaneousIndication & pdu  
01116     );
01117 
01122     virtual PBoolean OnH245_JitterIndication(
01123       const H245_JitterIndication & pdu  
01124     );
01125 
01126 #if OPAL_H239
01127 
01129     virtual bool OnH239Message(
01130       unsigned subMessage,
01131       const H245_ArrayOf_GenericParameter & params
01132     );
01133 
01137     virtual bool OnH239FlowControlRequest(
01138       unsigned logicalChannel,
01139       unsigned bitRate
01140     );
01141 
01145     virtual bool OnH239FlowControlResponse(
01146       unsigned logicalChannel,
01147       bool rejected
01148     );
01149 
01153     virtual bool OnH239PresentationRequest(
01154       unsigned logicalChannel,
01155       unsigned symmetryBreaking,
01156       unsigned terminalLabel
01157     );
01158 
01164     virtual bool SendH239PresentationRequest(
01165       unsigned logicalChannel,
01166       unsigned symmetryBreaking,
01167       unsigned terminalLabel
01168     );
01169 
01173     virtual bool OnH239PresentationResponse(
01174       unsigned logicalChannel,
01175       unsigned terminalLabel,
01176       bool rejected
01177     );
01178 
01182     virtual bool OnH239PresentationRelease(
01183       unsigned logicalChannel,
01184       unsigned terminalLabel
01185     );
01186 
01191     virtual bool SendH239PresentationRelease(
01192       unsigned logicalChannel,
01193       unsigned terminalLabel
01194     );
01195 
01199     virtual bool OnH239PresentationIndication(
01200       unsigned logicalChannel,
01201       unsigned terminalLabel
01202     );
01203 #endif
01204 
01207     enum ControlProtocolErrors {
01208       e_MasterSlaveDetermination,
01209       e_CapabilityExchange,
01210       e_LogicalChannel,
01211       e_ModeRequest,
01212       e_RoundTripDelay
01213     };
01214 
01226     virtual PBoolean OnControlProtocolError(
01227       ControlProtocolErrors errorSource,  
01228       const void * errorData = NULL       
01229     );
01230 
01238     virtual void OnSendCapabilitySet(
01239       H245_TerminalCapabilitySet & pdu  
01240     );
01241 
01253     virtual PBoolean OnReceivedCapabilitySet(
01254       const H323Capabilities & remoteCaps,      
01255       const H245_MultiplexCapability * muxCap,  
01256       H245_TerminalCapabilitySetReject & reject 
01257     );
01258 
01261     virtual bool SendCapabilitySet(
01262       PBoolean empty  
01263     );
01264 
01267     virtual bool IsSendingCapabilitySet();
01268 
01277     virtual void OnSetLocalCapabilities();
01278 
01281     PBoolean IsH245Master() const;
01282 
01285     void StartRoundTripDelay();
01286 
01289     PTimeInterval GetRoundTripDelay() const;
01291 
01331     virtual void OnSelectLogicalChannels();
01332 
01335     virtual void SelectDefaultLogicalChannel(
01336       const OpalMediaType & mediaType,  
01337       unsigned sessionID                
01338     );
01339 
01343     virtual void SelectFastStartChannels(
01344       unsigned sessionID,   
01345       PBoolean transmitter,     
01346       PBoolean receiver         
01347     );
01348 
01352     virtual void StartFastStartChannel(
01353       unsigned sessionID,               
01354       H323Channel::Directions direction 
01355     );
01356 
01371     virtual PBoolean OpenLogicalChannel(
01372       const H323Capability & capability,  
01373       unsigned sessionID,                 
01374       H323Channel::Directions dir         
01375     );
01376     
01377     virtual void SendFlowControlCommand(
01378       unsigned channelNumber,
01379       unsigned newBitRate
01380     );
01381     
01391     virtual PBoolean OnOpenLogicalChannel(
01392       const H245_OpenLogicalChannel & openPDU,  
01393       H245_OpenLogicalChannelAck & ackPDU,      
01394       unsigned & errorCode                      
01395     );
01396 
01404     virtual PBoolean OnConflictingLogicalChannel(
01405       H323Channel & channel    
01406     );
01407 
01412     virtual H323Channel * CreateLogicalChannel(
01413       const H245_OpenLogicalChannel & open, 
01414       PBoolean startingFast,                    
01415       unsigned & errorCode                  
01416     );
01417 
01452     virtual H323Channel * CreateRealTimeLogicalChannel(
01453       const H323Capability & capability, 
01454       H323Channel::Directions dir,       
01455       unsigned sessionID,                
01456       const H245_H2250LogicalChannelParameters * param,
01458       RTP_QOS * rtpqos = NULL            
01459     );
01460     
01464     virtual H323_RTPChannel * CreateRTPChannel(
01465       const H323Capability & capability,
01466       H323Channel::Directions direction,
01467       RTP_Session & rtp
01468     );
01469 
01480     virtual PBoolean OnCreateLogicalChannel(
01481       const H323Capability & capability,  
01482       H323Channel::Directions dir,        
01483       unsigned & errorCode                
01484     );
01485 
01490     virtual PBoolean OnStartLogicalChannel(
01491       H323Channel & channel    
01492     );
01493 
01496     virtual void CloseLogicalChannel(
01497       unsigned number,    
01498       PBoolean fromRemote     
01499     );
01500 
01503     virtual void CloseLogicalChannelNumber(
01504       const H323ChannelNumber & number    
01505     );
01506 
01509     virtual void CloseAllLogicalChannels(
01510       PBoolean fromRemote     
01511     );
01512 
01518     virtual void OnClosedLogicalChannel(
01519       const H323Channel & channel   
01520     );
01521 
01530     virtual PBoolean OnClosingLogicalChannel(
01531       H323Channel & channel   
01532     );
01533 
01542     virtual void OnLogicalChannelFlowControl(
01543       H323Channel * channel,   
01544       long bitRateRestriction  
01545     );
01546 
01555     virtual void OnLogicalChannelJitter(
01556       H323Channel * channel,   
01557       DWORD jitter,            
01558       int skippedFrameCount,   
01559       int additionalBuffer     
01560     );
01561 
01565     H323Channel * GetLogicalChannel(
01566       unsigned number,    
01567       PBoolean fromRemote     
01568     ) const;
01569 
01575     H323Channel * FindChannel(
01576       unsigned sessionId,   
01577       PBoolean fromRemote       
01578     ) const;
01580 
01587     virtual PBoolean SetBandwidthAvailable(
01588       unsigned newBandwidth,    
01589       PBoolean force = false        
01590     );
01591 
01596     virtual unsigned GetBandwidthUsed() const;
01598 
01606     virtual SendUserInputModes GetRealSendUserInputMode() const;
01607 
01621     virtual PBoolean SendUserInputString(
01622       const PString & value                   
01623     );
01624 
01649     virtual PBoolean SendUserInputTone(
01650       char tone,             
01651       unsigned duration = 0  
01652     );
01653 
01660     virtual PBoolean SendUserInputIndicationQ931(
01661       const PString & value                   
01662     );
01663 
01670     virtual PBoolean SendUserInputIndicationString(
01671       const PString & value                   
01672     );
01673 
01678     virtual PBoolean SendUserInputIndicationTone(
01679       char tone,                   
01680       unsigned duration = 0,       
01681       unsigned logicalChannel = 0, 
01682       unsigned rtpTimestamp = 0    
01683     );
01684 
01693     virtual PBoolean SendUserInputIndication(
01694       const H245_UserInputIndication & pdu    
01695     );
01696 
01701     virtual void OnUserInputIndication(
01702       const H245_UserInputIndication & pdu  
01703     );
01705 
01711     virtual H323_RTP_Session * GetSessionCallbacks(
01712       unsigned sessionID
01713     ) const;
01714 
01724     virtual RTP_Session * UseSession(
01725       const OpalTransport & transport,
01726                    unsigned sessionID,
01727       const OpalMediaType & mediatype,  
01728                   RTP_QOS * rtpqos = NULL
01729     );
01730 
01734     virtual void ReleaseSession(
01735       unsigned sessionID
01736     );
01737 
01745     virtual void OnRTPStatistics(
01746       const RTP_Session & session   
01747     ) const;
01748 
01752     virtual PString GetSessionCodecNames(
01753       unsigned sessionID
01754     ) const;
01755 
01757 
01775     virtual PBoolean RequestModeChange(
01776       const PString & newModes  
01777     );
01778 
01786     virtual PBoolean RequestModeChange(
01787       const H245_ArrayOf_ModeDescription & newModes  
01788     );
01789 
01792     virtual PBoolean OnRequestModeChange(
01793       const H245_RequestMode & pdu,     
01794       H245_RequestModeAck & ack,        
01795       H245_RequestModeReject & reject,  
01796       PINDEX & selectedMode           
01797     );
01798 
01805     virtual void OnModeChanged(
01806       const H245_ModeDescription & newMode
01807     );
01808 
01813     virtual void OnAcceptModeChange(
01814       const H245_RequestModeAck & pdu  
01815     );
01816 
01821     virtual void OnRefusedModeChange(
01822       const H245_RequestModeReject * pdu  
01823     );
01825 
01833     virtual PBoolean RequestModeChangeT38(
01834       const char * capabilityNames = "T.38\nT38FaxUDP"
01835     );
01836 
01846     virtual PBoolean GetAdmissionRequestAuthentication(
01847       const H225_AdmissionRequest & arq,  
01848       H235Authenticators & authenticators 
01849     );
01851 
01856     H323EndPoint & GetEndPoint() const { return endpoint; }
01857 
01860     PBoolean HadAnsweredCall() const { return !originating; }
01861 
01864     PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
01865 
01870     unsigned GetDistinctiveRing() const { return distinctiveRing; }
01871 
01878     void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
01879 
01883     const PString & GetCallToken() const { return GetToken(); }
01884 
01887     unsigned GetCallReference() const { return callReference; }
01888 
01891     inline const OpalGloballyUniqueID & GetCallIdentifier() const 
01892     { return callIdentifier; }
01893 
01896     virtual PString GetIdentifier() const;
01897 
01900     const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
01901 
01904     void SetLocalPartyName(const PString & name);
01905 
01908     const PStringList & GetLocalAliasNames() const { return localAliasNames; }
01909 
01912     virtual void SetRemotePartyInfo(
01913       const H323SignalPDU & pdu 
01914     );
01915 
01918     void SetRemoteApplication(
01919       const H225_EndpointType & pdu 
01920     );
01921     
01926     PString GetRemotePartyURL() const;
01927     
01930     const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
01931 
01934     const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
01935 
01938     unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
01939 
01942     const H323Transport * GetSignallingChannel() const { return signallingChannel; }
01943 
01946     unsigned GetSignallingVersion() const { return h225version; }
01947 
01950     const H323Transport & GetControlChannel() const;
01951 
01954     OpalTransport & GetTransport() const;
01955 
01958     unsigned GetControlVersion() const { return h245version; }
01959 
01962     unsigned GetUUIEsRequested() const { return uuiesRequested; }
01963 
01966     void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
01967 
01970     const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
01971 
01974     void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
01975 
01978     const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
01979 
01982     void SetDestExtraCallInfo(
01983       const PString & info
01984     ) { destExtraCallInfo = info; }
01985 
01988     void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
01989 
01995     int GetRemoteCallWaiting() const { return remoteCallWaiting; }
01996 
02001     void SetEnforcedDurationLimit(
02002       unsigned seconds  
02003     );
02005     
02006 #if OPAL_H239
02007 
02009     bool GetLocalH239Control() const { return m_h239Control; }
02010 
02013     void SetLocalH239Control(
02014       bool on   
02015     ) { m_h239Control = on; }
02016 
02019     bool GetRemoteH239Control() const;
02020 
02023     OpalMediaFormatList GetRemoteH239Formats() const;
02024 #endif
02025 
02026     virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
02027     
02028     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
02029 
02030 #if OPAL_H460
02031 
02033     virtual H460_FeatureSet * GetFeatureSet();
02034 #endif
02035 
02036     
02037 #if OPAL_H450
02038 
02042     H4507Handler&  getH4507handler(){return *h4507handler;}
02043 #endif
02044 
02045     virtual void OnMediaCommand(OpalMediaCommand & note, INT extra);
02046     
02047   protected:
02053     virtual void InternalEstablishedConnectionCheck();
02054     PBoolean InternalEndSessionCheck(PPER_Stream & strm);
02055     void SetRemoteVersions(const H225_ProtocolIdentifier & id);
02056     void MonitorCallStatus();
02057     PDECLARE_NOTIFIER(PThread, H323Connection, StartOutgoing);
02058     PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
02059     PDECLARE_NOTIFIER(PThread, H323Connection, NewIncomingControlChannel);
02060 
02061     H323EndPoint & endpoint;
02062 
02063     H323TransportAddress m_remoteConnectAddress;
02064     int                  remoteCallWaiting; // Number of call's waiting at the remote endpoint
02065     PBoolean                 gatekeeperRouted;
02066     unsigned             distinctiveRing;
02067     unsigned             callReference;
02068     OpalGloballyUniqueID callIdentifier;
02069     OpalGloballyUniqueID conferenceIdentifier;
02070 
02071     PString            localDestinationAddress;
02072     PStringList        localAliasNames;
02073     H323Capabilities   localCapabilities; // Capabilities local system supports
02074     PString            destExtraCallInfo;
02075     H323Capabilities   remoteCapabilities; // Capabilities remote system supports
02076     unsigned           remoteMaxAudioDelayJitter;
02077     PTimer             roundTripDelayTimer;
02078     WORD               maxAudioDelayJitter;
02079     unsigned           uuiesRequested;
02080     PString            gkAccessTokenOID;
02081     PBYTEArray         gkAccessTokenData;
02082     PBoolean               addAccessTokenToSetup;
02083 
02084     H323Transport * signallingChannel;
02085     H323Transport * controlChannel;
02086     OpalListener  * controlListener;
02087     PBoolean            h245Tunneling;
02088     H323SignalPDU * h245TunnelRxPDU;
02089     H323SignalPDU * h245TunnelTxPDU;
02090     H323SignalPDU * setupPDU;
02091     H323SignalPDU * alertingPDU;
02092     H323SignalPDU * connectPDU;
02093     H323SignalPDU * progressPDU;
02094 
02095     enum ConnectionStates {
02096       NoConnectionActive,
02097       AwaitingGatekeeperAdmission,
02098       AwaitingTransportConnect,
02099       AwaitingSignalConnect,
02100       AwaitingLocalAnswer,
02101       HasExecutedSignalConnect,
02102       EstablishedConnection,
02103       ShuttingDownConnection,
02104       NumConnectionStates
02105     } connectionState;
02106 
02107     unsigned   h225version;
02108     unsigned   h245version;
02109     PBoolean       h245versionSet;
02110     PBoolean doH245inSETUP;
02111     PBoolean lastPDUWasH245inSETUP;
02112 
02113     PBoolean mustSendDRQ;
02114     PBoolean mediaWaitForConnect;
02115     PBoolean transmitterSidePaused;
02116     bool     remoteTransmitPaused;
02117     PBoolean earlyStart;
02118     PString    t38ModeChangeCapabilities;
02119     PSyncPoint digitsWaitFlag;
02120     PBoolean       endSessionNeeded;
02121     PSyncPoint endSessionReceived;
02122     PTimer     enforcedDurationLimit;
02123 
02124     // Used as part of a local call hold operation involving MOH
02125     PChannel * holdMediaChannel;
02126     PBoolean       isConsultationTransfer;
02127 
02129     PBoolean     isCallIntrusion;
02130     unsigned callIntrusionProtectionLevel;
02131 
02132     enum FastStartStates {
02133       FastStartDisabled,
02134       FastStartInitiate,
02135       FastStartResponse,
02136       FastStartAcknowledged,
02137       NumFastStartStates
02138     };
02139     FastStartStates        fastStartState;
02140     H323LogicalChannelList fastStartChannels;
02141     OpalMediaStreamPtr     fastStartMediaStream;
02142     
02143 #if PTRACING
02144     static const char * GetConnectionStatesName(ConnectionStates s);
02145     friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << GetConnectionStatesName(s); }
02146     static const char * GetFastStartStateName(FastStartStates s);
02147     friend ostream & operator<<(ostream & o, FastStartStates s) { return o << GetFastStartStateName(s); }
02148 #endif
02149 
02150 
02151     // The following pointers are to protocol procedures, they are pointers to
02152     // hide their complexity from the H323Connection classes users.
02153     H245NegMasterSlaveDetermination  * masterSlaveDeterminationProcedure;
02154     H245NegTerminalCapabilitySet     * capabilityExchangeProcedure;
02155     H245NegLogicalChannels           * logicalChannels;
02156     H245NegRequestMode               * requestModeProcedure;
02157     H245NegRoundTripDelay            * roundTripDelayProcedure;
02158 
02159 #if OPAL_H239
02160     bool m_h239Control;
02161 #endif
02162 
02163 #if OPAL_H450
02164     H450xDispatcher * h450dispatcher;
02165     H4502Handler    * h4502handler;
02166     H4504Handler    * h4504handler;
02167     H4506Handler    * h4506handler;
02168     H4507Handler    * h4507handler;
02169     H45011Handler   * h45011handler;
02170 #endif
02171 
02172 #if OPAL_H460
02173     H460_FeatureSet * features;
02174 #endif
02175 
02176   private:
02177     PChannel * SwapHoldMediaChannels(PChannel * newChannel);
02178 
02179     P_REMOVE_VIRTUAL_VOID(CleanUpOnCallEnd());
02180     P_REMOVE_VIRTUAL_VOID(OnCleared());
02181 };
02182 
02183 
02184 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
02185 
02186 
02187 #endif // OPAL_H323
02188 
02189 #endif // OPAL_H323_H323CON_H
02190 
02191 

Generated on Sun Nov 21 20:20:50 2010 for OPAL by  doxygen 1.4.7