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: 23728 $
00030  * $Author: rjongbloed $
00031  * $Date: 2009-10-29 18:42:22 -0500 (Thu, 29 Oct 2009) $
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 
00118 
00125 class H323Connection : public OpalRTPConnection
00126 {
00127   PCLASSINFO(H323Connection, OpalRTPConnection);
00128 
00129   public:
00134     H323Connection(
00135       OpalCall & call,                         
00136       H323EndPoint & endpoint,                 
00137       const PString & token,                   
00138       const PString & alias,                   
00139       const H323TransportAddress & address,    
00140       unsigned options = 0,                    
00141       OpalConnection::StringOptions * stringOptions = NULL 
00142     );
00143 
00146     ~H323Connection();
00148 
00159     virtual bool IsNetworkConnection() const { return true; }
00160 
00163     virtual PString GetPrefixName() const;
00164 
00171     virtual PBoolean SetUpConnection();
00172 
00182     virtual PBoolean SetAlerting(
00183       const PString & calleeName,   
00184       PBoolean withMedia                
00185     );
00186 
00191     virtual PBoolean SetConnected();
00192 
00197     virtual PBoolean SetProgressed();
00198     
00206     virtual void OnEstablished();
00207 
00225     virtual void OnReleased();
00226 
00231     virtual PString GetDestinationAddress();
00232 
00246     virtual PString GetAlertingType() const;
00247 
00261     virtual bool SetAlertingType(const PString & info);
00262 
00270     virtual OpalMediaFormatList GetMediaFormats() const;
00271 
00274     virtual unsigned GetNextSessionID(
00275       const OpalMediaType & mediaType,   
00276       bool isSource                      
00277     );
00278 
00279 #if OPAL_FAX
00280 
00282     virtual bool SwitchFaxMediaStreams(
00283       bool enableFax  
00284     );
00285 #endif
00286 
00289     virtual OpalMediaStreamPtr OpenMediaStream(
00290       const OpalMediaFormat & mediaFormat, 
00291       unsigned sessionID,                  
00292       bool isSource                        
00293     );
00294     
00299     virtual bool CloseMediaStream(
00300       OpalMediaStream & stream  
00301     );
00302 
00307     virtual PBoolean GetMediaInformation(
00308       unsigned sessionID,     
00309       MediaInformation & info 
00310     ) const;
00312 
00318     virtual void OnCleared();
00319 
00325     PBoolean IsEstablished() const { return connectionState == EstablishedConnection; }
00326 
00335     virtual void CleanUpOnCallEnd();
00336 
00337     virtual void ApplyStringOptions(OpalConnection::StringOptions & stringOptions);
00339 
00340 
00345     void AttachSignalChannel(
00346       const PString & token,    
00347       H323Transport * channel,  
00348       PBoolean answeringCall        
00349     );
00350 
00353     PBoolean WriteSignalPDU(
00354       H323SignalPDU & pdu       
00355     );
00356 
00360     virtual void HandleSignallingChannel();
00361 
00365     virtual PBoolean HandleSignalPDU(
00366       H323SignalPDU & pdu       
00367     );
00368 
00372     virtual void HandleTunnelPDU(
00373       H323SignalPDU * txPDU       
00374     );
00375 
00383     virtual PBoolean OnReceivedSignalSetup(
00384       const H323SignalPDU & pdu   
00385     );
00386 
00393     virtual PBoolean OnReceivedSignalSetupAck(
00394       const H323SignalPDU & pdu   
00395     );
00396 
00403     virtual PBoolean OnReceivedSignalInformation(
00404       const H323SignalPDU & pdu   
00405     );
00406 
00415     virtual PBoolean OnReceivedCallProceeding(
00416       const H323SignalPDU & pdu   
00417     );
00418 
00427     virtual PBoolean OnReceivedProgress(
00428       const H323SignalPDU & pdu   
00429     );
00430 
00437     virtual PBoolean OnReceivedAlerting(
00438       const H323SignalPDU & pdu   
00439     );
00440 
00449     virtual PBoolean OnReceivedSignalConnect(
00450       const H323SignalPDU & pdu   
00451     );
00452 
00461     virtual PBoolean OnReceivedFacility(
00462       const H323SignalPDU & pdu   
00463     );
00464 
00471     virtual PBoolean OnReceivedSignalNotify(
00472       const H323SignalPDU & pdu   
00473     );
00474 
00481     virtual PBoolean OnReceivedSignalStatus(
00482       const H323SignalPDU & pdu   
00483     );
00484 
00491     virtual PBoolean OnReceivedStatusEnquiry(
00492       const H323SignalPDU & pdu   
00493     );
00494 
00499     virtual void OnReceivedReleaseComplete(
00500       const H323SignalPDU & pdu   
00501     );
00502 
00509     virtual PBoolean OnUnknownSignalPDU(
00510       const H323SignalPDU & pdu  
00511     );
00512 
00519     virtual void OnSendARQ(
00520       H225_AdmissionRequest & arq
00521     );
00522 
00528     virtual void OnReceivedACF(
00529       const H225_AdmissionConfirm & acf
00530     );
00531 
00537     virtual void OnReceivedARJ(
00538       const H225_AdmissionReject & arj
00539     );
00540 
00547     virtual void OnSendIRR(
00548       H225_InfoRequestResponse & irr
00549     ) const;
00550 
00557     virtual void OnSendDRQ(
00558       H225_DisengageRequest & drq
00559     ) const;
00560 
00572     virtual PBoolean OnIncomingCall(
00573       const H323SignalPDU & setupPDU,   
00574       H323SignalPDU & alertingPDU       
00575     );
00576 
00586     virtual PBoolean ForwardCall(
00587       const PString & forwardParty   
00588     );
00589 
00596     virtual bool TransferConnection(
00597       const PString & remoteParty   
00598     );
00599 
00603     virtual bool HoldConnection();
00604 
00609     virtual bool RetrieveConnection();
00610 
00617     virtual bool IsConnectionOnHold(
00618       bool fromRemote  
00619     );
00620 
00621 #if OPAL_H450
00622 
00627     bool TransferCall(
00628       const PString & remoteParty,   
00629       const PString & callIdentity = PString::Empty()
00631     );
00632 
00637     void ConsultationTransfer(
00638       const PString & primaryCallToken  
00639     );
00640 
00647     virtual void HandleConsultationTransfer(
00648       const PString & callIdentity, 
00650       H323Connection & incoming     
00651     );
00652 
00655     PBoolean IsTransferringCall() const;
00656 
00659     PBoolean IsTransferredCall() const;
00660 
00665     virtual void HandleTransferCall(
00666       const PString & token,
00667       const PString & identity
00668     );
00669 
00674     int GetCallTransferInvokeId();
00675 
00683     virtual void HandleCallTransferFailure(
00684       const int returnError    
00685     );
00686 
00691     void SetAssociatedCallToken(
00692       const PString & token  
00693     );
00694 
00699     virtual void OnConsultationTransferSuccess(
00700       H323Connection & secondaryCall  
00701     );
00702 
00707     bool HoldCall(
00708       PBoolean localHold   
00709     );
00710 
00716     bool RetrieveCall();
00717 
00724     void SetHoldMedia(
00725       PChannel * audioChannel
00726     );
00727 
00730     PBoolean IsMediaOnHold() const;
00731 
00734     PBoolean IsLocalHold() const;
00735 
00738     PBoolean IsRemoteHold() const;
00739 
00742     PBoolean IsCallOnHold() const;
00743 
00748     virtual void IntrudeCall(
00749       unsigned capabilityLevel
00750     );
00751 
00756     virtual void HandleIntrudeCall(
00757       const PString & token,
00758       const PString & identity
00759     );
00760 
00766     void SetCallIntrusion() { isCallIntrusion = PTrue; }
00767 
00768     PBoolean IsCallIntrusion() { return isCallIntrusion; }
00769 
00772     unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
00773 
00777     virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
00778       const PString & callToken,
00779       unsigned callIntrusionProtectionLevel
00780     );
00781 
00782     virtual void SetIntrusionImpending();
00783 
00784     virtual void SetForcedReleaseAccepted();
00785 
00786     virtual void SetIntrusionNotAuthorized();
00787 
00794     void SendCallWaitingIndication(
00795       const unsigned nbOfAddWaitingCalls = 0   
00796     );
00797 
00798 #endif
00799 
00826     virtual AnswerCallResponse OnAnswerCall(
00827       const PString & callerName,       
00828       const H323SignalPDU & setupPDU,   
00829       H323SignalPDU & connectPDU,       
00830       H323SignalPDU & progressPDU       
00831     );
00832     
00833     virtual AnswerCallResponse OnAnswerCall(
00834       const PString & callerName        
00835     );
00836 
00847     void AnsweringCall(
00848       AnswerCallResponse response 
00849     );
00850 
00861     virtual CallEndReason SendSignalSetup(
00862       const PString & alias,                
00863       const H323TransportAddress & address  
00864     );
00865 
00877     virtual PBoolean OnSendSignalSetup(
00878       H323SignalPDU & setupPDU   
00879     );
00880 
00889     virtual PBoolean OnSendCallProceeding(
00890       H323SignalPDU & callProceedingPDU   
00891     );
00892 
00904     virtual PBoolean OnSendReleaseComplete(
00905       H323SignalPDU & releaseCompletePDU 
00906     );
00907 
00918     virtual PBoolean OnAlerting(
00919       const H323SignalPDU & alertingPDU,  
00920       const PString & user                
00921     );
00922 
00937     virtual PBoolean OnInsufficientDigits();
00938 
00951     virtual void SendMoreDigits(
00952       const PString & digits    
00953     );
00954 
00964     virtual PBoolean OnOutgoingCall(
00965       const H323SignalPDU & connectPDU   
00966     );
00967 
00979     virtual PBoolean SendFastStartAcknowledge(
00980       H225_ArrayOf_PASN_OctetString & array   
00981     );
00982 
00994     virtual PBoolean HandleFastStartAcknowledge(
00995       const H225_ArrayOf_PASN_OctetString & array   
00996     );
00998 
01012     virtual PBoolean CreateOutgoingControlChannel(
01013       const H225_TransportAddress & h245Address   
01014     );
01015 
01028     virtual PBoolean CreateIncomingControlChannel(
01029       H225_TransportAddress & h245Address  
01030     );
01031 
01036     virtual PBoolean WriteControlPDU(
01037       const H323ControlPDU & pdu
01038     );
01039 
01042     virtual PBoolean StartControlNegotiations();
01043 
01046     virtual void HandleControlChannel();
01047 
01054     virtual PBoolean HandleControlData(
01055       PPER_Stream & strm
01056     );
01057 
01064     virtual PBoolean HandleControlPDU(
01065       const H323ControlPDU & pdu
01066     );
01067 
01077     virtual PBoolean OnUnknownControlPDU(
01078       const H323ControlPDU & pdu  
01079     );
01080 
01084     virtual PBoolean OnH245Request(
01085       const H323ControlPDU & pdu  
01086     );
01087 
01091     virtual PBoolean OnH245Response(
01092       const H323ControlPDU & pdu  
01093     );
01094 
01098     virtual PBoolean OnH245Command(
01099       const H323ControlPDU & pdu  
01100     );
01101 
01105     virtual PBoolean OnH245Indication(
01106       const H323ControlPDU & pdu  
01107     );
01108 
01111     virtual PBoolean OnH245_SendTerminalCapabilitySet(
01112       const H245_SendTerminalCapabilitySet & pdu  
01113     );
01114 
01119     virtual PBoolean OnH245_FlowControlCommand(
01120       const H245_FlowControlCommand & pdu  
01121     );
01122 
01127     virtual PBoolean OnH245_MiscellaneousCommand(
01128       const H245_MiscellaneousCommand & pdu  
01129     );
01130 
01135     virtual PBoolean OnH245_MiscellaneousIndication(
01136       const H245_MiscellaneousIndication & pdu  
01137     );
01138 
01143     virtual PBoolean OnH245_JitterIndication(
01144       const H245_JitterIndication & pdu  
01145     );
01146 
01147 #if OPAL_H239
01148 
01150     virtual bool OnH239Message(
01151       unsigned subMessage,
01152       const H245_ArrayOf_GenericParameter & params
01153     );
01154 
01158     virtual bool OnH239FlowControlRequest(
01159       unsigned logicalChannel,
01160       unsigned bitRate
01161     );
01162 
01166     virtual bool OnH239FlowControlResponse(
01167       unsigned logicalChannel,
01168       bool rejected
01169     );
01170 
01174     virtual bool OnH239PresentationRequest(
01175       unsigned logicalChannel,
01176       unsigned symmetryBreaking,
01177       unsigned terminalLabel
01178     );
01179 
01183     virtual bool OnH239PresentationResponse(
01184       unsigned logicalChannel,
01185       unsigned terminalLabel,
01186       bool rejected
01187     );
01188 
01192     virtual bool OnH239PresentationRelease(
01193       unsigned logicalChannel,
01194       unsigned terminalLabel
01195     );
01196 
01200     virtual bool OnH239PresentationIndication(
01201       unsigned logicalChannel,
01202       unsigned terminalLabel
01203     );
01204 #endif
01205 
01208     enum ControlProtocolErrors {
01209       e_MasterSlaveDetermination,
01210       e_CapabilityExchange,
01211       e_LogicalChannel,
01212       e_ModeRequest,
01213       e_RoundTripDelay
01214     };
01215 
01227     virtual PBoolean OnControlProtocolError(
01228       ControlProtocolErrors errorSource,  
01229       const void * errorData = NULL       
01230     );
01231 
01239     virtual void OnSendCapabilitySet(
01240       H245_TerminalCapabilitySet & pdu  
01241     );
01242 
01254     virtual PBoolean OnReceivedCapabilitySet(
01255       const H323Capabilities & remoteCaps,      
01256       const H245_MultiplexCapability * muxCap,  
01257       H245_TerminalCapabilitySetReject & reject 
01258     );
01259 
01262     virtual bool SendCapabilitySet(
01263       PBoolean empty  
01264     );
01265 
01268     virtual bool IsSendingCapabilitySet();
01269 
01278     virtual void OnSetLocalCapabilities();
01279 
01282     PBoolean IsH245Master() const;
01283 
01286     void StartRoundTripDelay();
01287 
01290     PTimeInterval GetRoundTripDelay() const;
01292 
01332     virtual void OnSelectLogicalChannels();
01333 
01336     virtual void SelectDefaultLogicalChannel(
01337       const OpalMediaType & mediaType,  
01338       unsigned sessionID                
01339     );
01340 
01344     virtual void SelectFastStartChannels(
01345       unsigned sessionID,   
01346       PBoolean transmitter,     
01347       PBoolean receiver         
01348     );
01349 
01353     virtual void StartFastStartChannel(
01354       unsigned sessionID,               
01355       H323Channel::Directions direction 
01356     );
01357 
01372     virtual PBoolean OpenLogicalChannel(
01373       const H323Capability & capability,  
01374       unsigned sessionID,                 
01375       H323Channel::Directions dir         
01376     );
01377     
01378     virtual void SendFlowControlCommand(
01379       unsigned channelNumber,
01380       unsigned newBitRate
01381     );
01382     
01392     virtual PBoolean OnOpenLogicalChannel(
01393       const H245_OpenLogicalChannel & openPDU,  
01394       H245_OpenLogicalChannelAck & ackPDU,      
01395       unsigned & errorCode                      
01396     );
01397 
01405     virtual PBoolean OnConflictingLogicalChannel(
01406       H323Channel & channel    
01407     );
01408 
01413     virtual H323Channel * CreateLogicalChannel(
01414       const H245_OpenLogicalChannel & open, 
01415       PBoolean startingFast,                    
01416       unsigned & errorCode                  
01417     );
01418 
01453     virtual H323Channel * CreateRealTimeLogicalChannel(
01454       const H323Capability & capability, 
01455       H323Channel::Directions dir,       
01456       unsigned sessionID,                
01457       const H245_H2250LogicalChannelParameters * param,
01459       RTP_QOS * rtpqos = NULL            
01460     );
01461     
01465     virtual H323_RTPChannel * CreateRTPChannel(
01466       const H323Capability & capability,
01467       H323Channel::Directions direction,
01468       RTP_Session & rtp
01469     );
01470 
01481     virtual PBoolean OnCreateLogicalChannel(
01482       const H323Capability & capability,  
01483       H323Channel::Directions dir,        
01484       unsigned & errorCode                
01485     );
01486 
01491     virtual PBoolean OnStartLogicalChannel(
01492       H323Channel & channel    
01493     );
01494 
01497     virtual void CloseLogicalChannel(
01498       unsigned number,    
01499       PBoolean fromRemote     
01500     );
01501 
01504     virtual void CloseLogicalChannelNumber(
01505       const H323ChannelNumber & number    
01506     );
01507 
01510     virtual void CloseAllLogicalChannels(
01511       PBoolean fromRemote     
01512     );
01513 
01519     virtual void OnClosedLogicalChannel(
01520       const H323Channel & channel   
01521     );
01522 
01531     virtual PBoolean OnClosingLogicalChannel(
01532       H323Channel & channel   
01533     );
01534 
01543     virtual void OnLogicalChannelFlowControl(
01544       H323Channel * channel,   
01545       long bitRateRestriction  
01546     );
01547 
01556     virtual void OnLogicalChannelJitter(
01557       H323Channel * channel,   
01558       DWORD jitter,            
01559       int skippedFrameCount,   
01560       int additionalBuffer     
01561     );
01562 
01566     H323Channel * GetLogicalChannel(
01567       unsigned number,    
01568       PBoolean fromRemote     
01569     ) const;
01570 
01576     H323Channel * FindChannel(
01577       unsigned sessionId,   
01578       PBoolean fromRemote       
01579     ) const;
01581 
01588     virtual PBoolean SetBandwidthAvailable(
01589       unsigned newBandwidth,    
01590       PBoolean force = PFalse        
01591     );
01592 
01597     virtual unsigned GetBandwidthUsed() const;
01599 
01607     virtual SendUserInputModes GetRealSendUserInputMode() const;
01608 
01622     virtual PBoolean SendUserInputString(
01623       const PString & value                   
01624     );
01625 
01650     virtual PBoolean SendUserInputTone(
01651       char tone,             
01652       unsigned duration = 0  
01653     );
01654 
01661     virtual PBoolean SendUserInputIndicationQ931(
01662       const PString & value                   
01663     );
01664 
01671     virtual PBoolean SendUserInputIndicationString(
01672       const PString & value                   
01673     );
01674 
01679     virtual PBoolean SendUserInputIndicationTone(
01680       char tone,                   
01681       unsigned duration = 0,       
01682       unsigned logicalChannel = 0, 
01683       unsigned rtpTimestamp = 0    
01684     );
01685 
01694     virtual PBoolean SendUserInputIndication(
01695       const H245_UserInputIndication & pdu    
01696     );
01697 
01702     virtual void OnUserInputIndication(
01703       const H245_UserInputIndication & pdu  
01704     );
01706 
01712     virtual H323_RTP_Session * GetSessionCallbacks(
01713       unsigned sessionID
01714     ) const;
01715 
01725     virtual RTP_Session * UseSession(
01726       const OpalTransport & transport,
01727                    unsigned sessionID,
01728       const OpalMediaType & mediatype,  
01729                   RTP_QOS * rtpqos = NULL
01730     );
01731 
01735     virtual void ReleaseSession(
01736       unsigned sessionID
01737     );
01738 
01746     virtual void OnRTPStatistics(
01747       const RTP_Session & session   
01748     ) const;
01749 
01753     virtual PString GetSessionCodecNames(
01754       unsigned sessionID
01755     ) const;
01756 
01758 
01776     virtual PBoolean RequestModeChange(
01777       const PString & newModes  
01778     );
01779 
01787     virtual PBoolean RequestModeChange(
01788       const H245_ArrayOf_ModeDescription & newModes  
01789     );
01790 
01793     virtual PBoolean OnRequestModeChange(
01794       const H245_RequestMode & pdu,     
01795       H245_RequestModeAck & ack,        
01796       H245_RequestModeReject & reject,  
01797       PINDEX & selectedMode           
01798     );
01799 
01806     virtual void OnModeChanged(
01807       const H245_ModeDescription & newMode
01808     );
01809 
01814     virtual void OnAcceptModeChange(
01815       const H245_RequestModeAck & pdu  
01816     );
01817 
01822     virtual void OnRefusedModeChange(
01823       const H245_RequestModeReject * pdu  
01824     );
01826 
01834     virtual PBoolean RequestModeChangeT38(
01835       const char * capabilityNames = "T.38\nT38FaxUDP"
01836     );
01837 
01847     virtual PBoolean GetAdmissionRequestAuthentication(
01848       const H225_AdmissionRequest & arq,  
01849       H235Authenticators & authenticators 
01850     );
01852 
01857     H323EndPoint & GetEndPoint() const { return endpoint; }
01858 
01861     PBoolean HadAnsweredCall() const { return !originating; }
01862 
01865     PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
01866 
01871     unsigned GetDistinctiveRing() const { return distinctiveRing; }
01872 
01879     void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
01880 
01884     const PString & GetCallToken() const { return GetToken(); }
01885 
01888     unsigned GetCallReference() const { return callReference; }
01889 
01892     inline const OpalGloballyUniqueID & GetCallIdentifier() const 
01893     { return callIdentifier; }
01894 
01897     virtual PString GetIdentifier() const;
01898 
01901     const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
01902 
01905     void SetLocalPartyName(const PString & name);
01906 
01909     const PStringList & GetLocalAliasNames() const { return localAliasNames; }
01910 
01913     virtual void SetRemotePartyInfo(
01914       const H323SignalPDU & pdu 
01915     );
01916 
01919     void SetRemoteApplication(
01920       const H225_EndpointType & pdu 
01921     );
01922     
01927     PString GetRemotePartyURL() const;
01928     
01931     const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
01932 
01935     const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
01936 
01939     unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
01940 
01943     const H323Transport * GetSignallingChannel() const { return signallingChannel; }
01944 
01947     unsigned GetSignallingVersion() const { return h225version; }
01948 
01951     const H323Transport & GetControlChannel() const;
01952 
01955     OpalTransport & GetTransport() const;
01956 
01959     unsigned GetControlVersion() const { return h245version; }
01960 
01963     unsigned GetUUIEsRequested() const { return uuiesRequested; }
01964 
01967     void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
01968 
01971     const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
01972 
01975     void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
01976 
01979     const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
01980 
01983     void SetDestExtraCallInfo(
01984       const PString & info
01985     ) { destExtraCallInfo = info; }
01986 
01989     void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
01990 
01996     int GetRemoteCallWaiting() const { return remoteCallWaiting; }
01997 
02002     void SetEnforcedDurationLimit(
02003       unsigned seconds  
02004     );
02006     
02007 #if OPAL_H239
02008 
02010     bool GetLocalH239Control() const { return m_h239Control; }
02011 
02014     void SetLocalH239Control(
02015       bool on   
02016     ) { m_h239Control = on; }
02017 
02020     bool GetRemoteH239Control() const;
02021 
02024     OpalMediaFormatList GetRemoteH239Formats() const;
02025 #endif
02026 
02027     virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
02028     
02029     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
02030 
02031 #if OPAL_H460
02032 
02034     virtual H460_FeatureSet * GetFeatureSet();
02035 #endif
02036 
02037     
02038 #if OPAL_H450
02039 
02043     H4507Handler&  getH4507handler(){return *h4507handler;}
02044 #endif
02045 
02046     virtual void OnMediaCommand(OpalMediaCommand & note, INT extra);
02047     
02048   protected:
02054     virtual void InternalEstablishedConnectionCheck();
02055     PBoolean InternalEndSessionCheck(PPER_Stream & strm);
02056     void SetRemoteVersions(const H225_ProtocolIdentifier & id);
02057     void MonitorCallStatus();
02058     PDECLARE_NOTIFIER(PThread, H323Connection, StartOutgoing);
02059     PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
02060     PDECLARE_NOTIFIER(PThread, H323Connection, NewIncomingControlChannel);
02061 
02062     H323EndPoint & endpoint;
02063 
02064     H323TransportAddress m_remoteConnectAddress;
02065     int                  remoteCallWaiting; // Number of call's waiting at the remote endpoint
02066     PBoolean                 gatekeeperRouted;
02067     unsigned             distinctiveRing;
02068     unsigned             callReference;
02069     OpalGloballyUniqueID callIdentifier;
02070     OpalGloballyUniqueID conferenceIdentifier;
02071 
02072     PString            localDestinationAddress;
02073     PStringList        localAliasNames;
02074     H323Capabilities   localCapabilities; // Capabilities local system supports
02075     PString            destExtraCallInfo;
02076     H323Capabilities   remoteCapabilities; // Capabilities remote system supports
02077     unsigned           remoteMaxAudioDelayJitter;
02078     PTimer             roundTripDelayTimer;
02079     WORD               maxAudioDelayJitter;
02080     unsigned           uuiesRequested;
02081     PString            gkAccessTokenOID;
02082     PBYTEArray         gkAccessTokenData;
02083     PBoolean               addAccessTokenToSetup;
02084 
02085     H323Transport * signallingChannel;
02086     H323Transport * controlChannel;
02087     OpalListener  * controlListener;
02088     PBoolean            h245Tunneling;
02089     H323SignalPDU * h245TunnelRxPDU;
02090     H323SignalPDU * h245TunnelTxPDU;
02091     H323SignalPDU * setupPDU;
02092     H323SignalPDU * alertingPDU;
02093     H323SignalPDU * connectPDU;
02094     H323SignalPDU * progressPDU;
02095 
02096     enum ConnectionStates {
02097       NoConnectionActive,
02098       AwaitingGatekeeperAdmission,
02099       AwaitingTransportConnect,
02100       AwaitingSignalConnect,
02101       AwaitingLocalAnswer,
02102       HasExecutedSignalConnect,
02103       EstablishedConnection,
02104       ShuttingDownConnection,
02105       NumConnectionStates
02106     } connectionState;
02107 
02108     unsigned   h225version;
02109     unsigned   h245version;
02110     PBoolean       h245versionSet;
02111     PBoolean doH245inSETUP;
02112     PBoolean lastPDUWasH245inSETUP;
02113 
02114     PBoolean mustSendDRQ;
02115     PBoolean mediaWaitForConnect;
02116     PBoolean transmitterSidePaused;
02117     bool     remoteTransmitPaused;
02118     PBoolean earlyStart;
02119     PString    t38ModeChangeCapabilities;
02120     PSyncPoint digitsWaitFlag;
02121     PBoolean       endSessionNeeded;
02122     PSyncPoint endSessionReceived;
02123     PTimer     enforcedDurationLimit;
02124 
02125     // Used as part of a local call hold operation involving MOH
02126     PChannel * holdMediaChannel;
02127     PBoolean       isConsultationTransfer;
02128 
02130     PBoolean     isCallIntrusion;
02131     unsigned callIntrusionProtectionLevel;
02132 
02133     enum FastStartStates {
02134       FastStartDisabled,
02135       FastStartInitiate,
02136       FastStartResponse,
02137       FastStartAcknowledged,
02138       NumFastStartStates
02139     };
02140     FastStartStates        fastStartState;
02141     H323LogicalChannelList fastStartChannels;
02142     OpalMediaStreamPtr     fastStartMediaStream;
02143     
02144 #if PTRACING
02145     static const char * GetConnectionStatesName(ConnectionStates s);
02146     friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << GetConnectionStatesName(s); }
02147     static const char * GetFastStartStateName(FastStartStates s);
02148     friend ostream & operator<<(ostream & o, FastStartStates s) { return o << GetFastStartStateName(s); }
02149 #endif
02150 
02151 
02152     // The following pointers are to protocol procedures, they are pointers to
02153     // hide their complexity from the H323Connection classes users.
02154     H245NegMasterSlaveDetermination  * masterSlaveDeterminationProcedure;
02155     H245NegTerminalCapabilitySet     * capabilityExchangeProcedure;
02156     H245NegLogicalChannels           * logicalChannels;
02157     H245NegRequestMode               * requestModeProcedure;
02158     H245NegRoundTripDelay            * roundTripDelayProcedure;
02159 
02160 #if OPAL_H239
02161     bool m_h239Control;
02162 #endif
02163 
02164 #if OPAL_H450
02165     H450xDispatcher * h450dispatcher;
02166     H4502Handler    * h4502handler;
02167     H4504Handler    * h4504handler;
02168     H4506Handler    * h4506handler;
02169     H4507Handler    * h4507handler;
02170     H45011Handler   * h45011handler;
02171 #endif
02172 
02173 #if OPAL_H460
02174     H460_FeatureSet * features;
02175 #endif
02176 
02177   private:
02178     PChannel * SwapHoldMediaChannels(PChannel * newChannel);
02179 };
02180 
02181 
02182 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
02183 
02184 
02185 #endif // OPAL_H323
02186 
02187 #endif // OPAL_H323_H323CON_H
02188 
02189 

Generated on Wed Dec 15 07:55:08 2010 for OPAL by  doxygen 1.4.7