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: 24674 $
00030  * $Author: rjongbloed $
00031  * $Date: 2010-08-22 20:11:40 -0500 (Sun, 22 Aug 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 
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 
01185     virtual bool SendH239PresentationRequest(
01186       unsigned logicalChannel,
01187       unsigned symmetryBreaking,
01188       unsigned terminalLabel
01189     );
01190 
01194     virtual bool OnH239PresentationResponse(
01195       unsigned logicalChannel,
01196       unsigned terminalLabel,
01197       bool rejected
01198     );
01199 
01203     virtual bool OnH239PresentationRelease(
01204       unsigned logicalChannel,
01205       unsigned terminalLabel
01206     );
01207 
01212     virtual bool SendH239PresentationRelease(
01213       unsigned logicalChannel,
01214       unsigned terminalLabel
01215     );
01216 
01220     virtual bool OnH239PresentationIndication(
01221       unsigned logicalChannel,
01222       unsigned terminalLabel
01223     );
01224 #endif
01225 
01228     enum ControlProtocolErrors {
01229       e_MasterSlaveDetermination,
01230       e_CapabilityExchange,
01231       e_LogicalChannel,
01232       e_ModeRequest,
01233       e_RoundTripDelay
01234     };
01235 
01247     virtual PBoolean OnControlProtocolError(
01248       ControlProtocolErrors errorSource,  
01249       const void * errorData = NULL       
01250     );
01251 
01259     virtual void OnSendCapabilitySet(
01260       H245_TerminalCapabilitySet & pdu  
01261     );
01262 
01274     virtual PBoolean OnReceivedCapabilitySet(
01275       const H323Capabilities & remoteCaps,      
01276       const H245_MultiplexCapability * muxCap,  
01277       H245_TerminalCapabilitySetReject & reject 
01278     );
01279 
01282     virtual bool SendCapabilitySet(
01283       PBoolean empty  
01284     );
01285 
01288     virtual bool IsSendingCapabilitySet();
01289 
01298     virtual void OnSetLocalCapabilities();
01299 
01302     PBoolean IsH245Master() const;
01303 
01306     void StartRoundTripDelay();
01307 
01310     PTimeInterval GetRoundTripDelay() const;
01312 
01352     virtual void OnSelectLogicalChannels();
01353 
01356     virtual void SelectDefaultLogicalChannel(
01357       const OpalMediaType & mediaType,  
01358       unsigned sessionID                
01359     );
01360 
01364     virtual void SelectFastStartChannels(
01365       unsigned sessionID,   
01366       PBoolean transmitter,     
01367       PBoolean receiver         
01368     );
01369 
01373     virtual void StartFastStartChannel(
01374       unsigned sessionID,               
01375       H323Channel::Directions direction 
01376     );
01377 
01392     virtual PBoolean OpenLogicalChannel(
01393       const H323Capability & capability,  
01394       unsigned sessionID,                 
01395       H323Channel::Directions dir         
01396     );
01397     
01398     virtual void SendFlowControlCommand(
01399       unsigned channelNumber,
01400       unsigned newBitRate
01401     );
01402     
01412     virtual PBoolean OnOpenLogicalChannel(
01413       const H245_OpenLogicalChannel & openPDU,  
01414       H245_OpenLogicalChannelAck & ackPDU,      
01415       unsigned & errorCode                      
01416     );
01417 
01425     virtual PBoolean OnConflictingLogicalChannel(
01426       H323Channel & channel    
01427     );
01428 
01433     virtual H323Channel * CreateLogicalChannel(
01434       const H245_OpenLogicalChannel & open, 
01435       PBoolean startingFast,                    
01436       unsigned & errorCode                  
01437     );
01438 
01473     virtual H323Channel * CreateRealTimeLogicalChannel(
01474       const H323Capability & capability, 
01475       H323Channel::Directions dir,       
01476       unsigned sessionID,                
01477       const H245_H2250LogicalChannelParameters * param,
01479       RTP_QOS * rtpqos = NULL            
01480     );
01481     
01485     virtual H323_RTPChannel * CreateRTPChannel(
01486       const H323Capability & capability,
01487       H323Channel::Directions direction,
01488       RTP_Session & rtp
01489     );
01490 
01501     virtual PBoolean OnCreateLogicalChannel(
01502       const H323Capability & capability,  
01503       H323Channel::Directions dir,        
01504       unsigned & errorCode                
01505     );
01506 
01511     virtual PBoolean OnStartLogicalChannel(
01512       H323Channel & channel    
01513     );
01514 
01517     virtual void CloseLogicalChannel(
01518       unsigned number,    
01519       PBoolean fromRemote     
01520     );
01521 
01524     virtual void CloseLogicalChannelNumber(
01525       const H323ChannelNumber & number    
01526     );
01527 
01530     virtual void CloseAllLogicalChannels(
01531       PBoolean fromRemote     
01532     );
01533 
01539     virtual void OnClosedLogicalChannel(
01540       const H323Channel & channel   
01541     );
01542 
01551     virtual PBoolean OnClosingLogicalChannel(
01552       H323Channel & channel   
01553     );
01554 
01563     virtual void OnLogicalChannelFlowControl(
01564       H323Channel * channel,   
01565       long bitRateRestriction  
01566     );
01567 
01576     virtual void OnLogicalChannelJitter(
01577       H323Channel * channel,   
01578       DWORD jitter,            
01579       int skippedFrameCount,   
01580       int additionalBuffer     
01581     );
01582 
01586     H323Channel * GetLogicalChannel(
01587       unsigned number,    
01588       PBoolean fromRemote     
01589     ) const;
01590 
01596     H323Channel * FindChannel(
01597       unsigned sessionId,   
01598       PBoolean fromRemote       
01599     ) const;
01601 
01608     virtual PBoolean SetBandwidthAvailable(
01609       unsigned newBandwidth,    
01610       PBoolean force = PFalse        
01611     );
01612 
01617     virtual unsigned GetBandwidthUsed() const;
01619 
01627     virtual SendUserInputModes GetRealSendUserInputMode() const;
01628 
01642     virtual PBoolean SendUserInputString(
01643       const PString & value                   
01644     );
01645 
01670     virtual PBoolean SendUserInputTone(
01671       char tone,             
01672       unsigned duration = 0  
01673     );
01674 
01681     virtual PBoolean SendUserInputIndicationQ931(
01682       const PString & value                   
01683     );
01684 
01691     virtual PBoolean SendUserInputIndicationString(
01692       const PString & value                   
01693     );
01694 
01699     virtual PBoolean SendUserInputIndicationTone(
01700       char tone,                   
01701       unsigned duration = 0,       
01702       unsigned logicalChannel = 0, 
01703       unsigned rtpTimestamp = 0    
01704     );
01705 
01714     virtual PBoolean SendUserInputIndication(
01715       const H245_UserInputIndication & pdu    
01716     );
01717 
01722     virtual void OnUserInputIndication(
01723       const H245_UserInputIndication & pdu  
01724     );
01726 
01732     virtual H323_RTP_Session * GetSessionCallbacks(
01733       unsigned sessionID
01734     ) const;
01735 
01745     virtual RTP_Session * UseSession(
01746       const OpalTransport & transport,
01747                    unsigned sessionID,
01748       const OpalMediaType & mediatype,  
01749                   RTP_QOS * rtpqos = NULL
01750     );
01751 
01755     virtual void ReleaseSession(
01756       unsigned sessionID
01757     );
01758 
01766     virtual void OnRTPStatistics(
01767       const RTP_Session & session   
01768     ) const;
01769 
01773     virtual PString GetSessionCodecNames(
01774       unsigned sessionID
01775     ) const;
01776 
01778 
01796     virtual PBoolean RequestModeChange(
01797       const PString & newModes  
01798     );
01799 
01807     virtual PBoolean RequestModeChange(
01808       const H245_ArrayOf_ModeDescription & newModes  
01809     );
01810 
01813     virtual PBoolean OnRequestModeChange(
01814       const H245_RequestMode & pdu,     
01815       H245_RequestModeAck & ack,        
01816       H245_RequestModeReject & reject,  
01817       PINDEX & selectedMode           
01818     );
01819 
01826     virtual void OnModeChanged(
01827       const H245_ModeDescription & newMode
01828     );
01829 
01834     virtual void OnAcceptModeChange(
01835       const H245_RequestModeAck & pdu  
01836     );
01837 
01842     virtual void OnRefusedModeChange(
01843       const H245_RequestModeReject * pdu  
01844     );
01846 
01854     virtual PBoolean RequestModeChangeT38(
01855       const char * capabilityNames = "T.38\nT38FaxUDP"
01856     );
01857 
01867     virtual PBoolean GetAdmissionRequestAuthentication(
01868       const H225_AdmissionRequest & arq,  
01869       H235Authenticators & authenticators 
01870     );
01872 
01877     H323EndPoint & GetEndPoint() const { return endpoint; }
01878 
01881     PBoolean HadAnsweredCall() const { return !originating; }
01882 
01885     PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
01886 
01891     unsigned GetDistinctiveRing() const { return distinctiveRing; }
01892 
01899     void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
01900 
01904     const PString & GetCallToken() const { return GetToken(); }
01905 
01908     unsigned GetCallReference() const { return callReference; }
01909 
01912     inline const OpalGloballyUniqueID & GetCallIdentifier() const 
01913     { return callIdentifier; }
01914 
01917     virtual PString GetIdentifier() const;
01918 
01921     const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
01922 
01925     void SetLocalPartyName(const PString & name);
01926 
01929     const PStringList & GetLocalAliasNames() const { return localAliasNames; }
01930 
01933     virtual void SetRemotePartyInfo(
01934       const H323SignalPDU & pdu 
01935     );
01936 
01939     void SetRemoteApplication(
01940       const H225_EndpointType & pdu 
01941     );
01942     
01947     PString GetRemotePartyURL() const;
01948     
01951     const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
01952 
01955     const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
01956 
01959     unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
01960 
01963     const H323Transport * GetSignallingChannel() const { return signallingChannel; }
01964 
01967     unsigned GetSignallingVersion() const { return h225version; }
01968 
01971     const H323Transport & GetControlChannel() const;
01972 
01975     OpalTransport & GetTransport() const;
01976 
01979     unsigned GetControlVersion() const { return h245version; }
01980 
01983     unsigned GetUUIEsRequested() const { return uuiesRequested; }
01984 
01987     void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
01988 
01991     const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
01992 
01995     void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
01996 
01999     const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
02000 
02003     void SetDestExtraCallInfo(
02004       const PString & info
02005     ) { destExtraCallInfo = info; }
02006 
02009     void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
02010 
02016     int GetRemoteCallWaiting() const { return remoteCallWaiting; }
02017 
02022     void SetEnforcedDurationLimit(
02023       unsigned seconds  
02024     );
02026     
02027 #if OPAL_H239
02028 
02030     bool GetLocalH239Control() const { return m_h239Control; }
02031 
02034     void SetLocalH239Control(
02035       bool on   
02036     ) { m_h239Control = on; }
02037 
02040     bool GetRemoteH239Control() const;
02041 
02044     OpalMediaFormatList GetRemoteH239Formats() const;
02045 #endif
02046 
02047     virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
02048     
02049     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
02050 
02051 #if OPAL_H460
02052 
02054     virtual H460_FeatureSet * GetFeatureSet();
02055 #endif
02056 
02057     
02058 #if OPAL_H450
02059 
02063     H4507Handler&  getH4507handler(){return *h4507handler;}
02064 #endif
02065 
02066     virtual void OnMediaCommand(OpalMediaCommand & note, INT extra);
02067     
02068   protected:
02074     virtual void InternalEstablishedConnectionCheck();
02075     PBoolean InternalEndSessionCheck(PPER_Stream & strm);
02076     void SetRemoteVersions(const H225_ProtocolIdentifier & id);
02077     void MonitorCallStatus();
02078     PDECLARE_NOTIFIER(PThread, H323Connection, StartOutgoing);
02079     PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
02080     PDECLARE_NOTIFIER(PThread, H323Connection, NewIncomingControlChannel);
02081 
02082     H323EndPoint & endpoint;
02083 
02084     H323TransportAddress m_remoteConnectAddress;
02085     int                  remoteCallWaiting; // Number of call's waiting at the remote endpoint
02086     PBoolean                 gatekeeperRouted;
02087     unsigned             distinctiveRing;
02088     unsigned             callReference;
02089     OpalGloballyUniqueID callIdentifier;
02090     OpalGloballyUniqueID conferenceIdentifier;
02091 
02092     PString            localDestinationAddress;
02093     PStringList        localAliasNames;
02094     H323Capabilities   localCapabilities; // Capabilities local system supports
02095     PString            destExtraCallInfo;
02096     H323Capabilities   remoteCapabilities; // Capabilities remote system supports
02097     unsigned           remoteMaxAudioDelayJitter;
02098     PTimer             roundTripDelayTimer;
02099     WORD               maxAudioDelayJitter;
02100     unsigned           uuiesRequested;
02101     PString            gkAccessTokenOID;
02102     PBYTEArray         gkAccessTokenData;
02103     PBoolean               addAccessTokenToSetup;
02104 
02105     H323Transport * signallingChannel;
02106     H323Transport * controlChannel;
02107     OpalListener  * controlListener;
02108     PBoolean            h245Tunneling;
02109     H323SignalPDU * h245TunnelRxPDU;
02110     H323SignalPDU * h245TunnelTxPDU;
02111     H323SignalPDU * setupPDU;
02112     H323SignalPDU * alertingPDU;
02113     H323SignalPDU * connectPDU;
02114     H323SignalPDU * progressPDU;
02115 
02116     enum ConnectionStates {
02117       NoConnectionActive,
02118       AwaitingGatekeeperAdmission,
02119       AwaitingTransportConnect,
02120       AwaitingSignalConnect,
02121       AwaitingLocalAnswer,
02122       HasExecutedSignalConnect,
02123       EstablishedConnection,
02124       ShuttingDownConnection,
02125       NumConnectionStates
02126     } connectionState;
02127 
02128     unsigned   h225version;
02129     unsigned   h245version;
02130     PBoolean       h245versionSet;
02131     PBoolean doH245inSETUP;
02132     PBoolean lastPDUWasH245inSETUP;
02133 
02134     PBoolean mustSendDRQ;
02135     PBoolean mediaWaitForConnect;
02136     PBoolean transmitterSidePaused;
02137     bool     remoteTransmitPaused;
02138     PBoolean earlyStart;
02139     PString    t38ModeChangeCapabilities;
02140     PSyncPoint digitsWaitFlag;
02141     PBoolean       endSessionNeeded;
02142     PSyncPoint endSessionReceived;
02143     PTimer     enforcedDurationLimit;
02144 
02145     // Used as part of a local call hold operation involving MOH
02146     PChannel * holdMediaChannel;
02147     PBoolean       isConsultationTransfer;
02148 
02150     PBoolean     isCallIntrusion;
02151     unsigned callIntrusionProtectionLevel;
02152 
02153     enum FastStartStates {
02154       FastStartDisabled,
02155       FastStartInitiate,
02156       FastStartResponse,
02157       FastStartAcknowledged,
02158       NumFastStartStates
02159     };
02160     FastStartStates        fastStartState;
02161     H323LogicalChannelList fastStartChannels;
02162     OpalMediaStreamPtr     fastStartMediaStream;
02163     
02164 #if PTRACING
02165     static const char * GetConnectionStatesName(ConnectionStates s);
02166     friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << GetConnectionStatesName(s); }
02167     static const char * GetFastStartStateName(FastStartStates s);
02168     friend ostream & operator<<(ostream & o, FastStartStates s) { return o << GetFastStartStateName(s); }
02169 #endif
02170 
02171 
02172     // The following pointers are to protocol procedures, they are pointers to
02173     // hide their complexity from the H323Connection classes users.
02174     H245NegMasterSlaveDetermination  * masterSlaveDeterminationProcedure;
02175     H245NegTerminalCapabilitySet     * capabilityExchangeProcedure;
02176     H245NegLogicalChannels           * logicalChannels;
02177     H245NegRequestMode               * requestModeProcedure;
02178     H245NegRoundTripDelay            * roundTripDelayProcedure;
02179 
02180 #if OPAL_H239
02181     bool m_h239Control;
02182 #endif
02183 
02184 #if OPAL_H450
02185     H450xDispatcher * h450dispatcher;
02186     H4502Handler    * h4502handler;
02187     H4504Handler    * h4504handler;
02188     H4506Handler    * h4506handler;
02189     H4507Handler    * h4507handler;
02190     H45011Handler   * h45011handler;
02191 #endif
02192 
02193 #if OPAL_H460
02194     H460_FeatureSet * features;
02195 #endif
02196 
02197   private:
02198     PChannel * SwapHoldMediaChannels(PChannel * newChannel);
02199 };
02200 
02201 
02202 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
02203 
02204 
02205 #endif // OPAL_H323
02206 
02207 #endif // OPAL_H323_H323CON_H
02208 
02209 

Generated on Mon Feb 21 20:19:20 2011 for OPAL by  doxygen 1.4.7