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: 23187 $
00030  * $Author: rjongbloed $
00031  * $Date: 2009-07-31 00:24:18 +0000 (Fri, 31 Jul 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 
00614     virtual PBoolean IsConnectionOnHold();
00615 
00616 #if OPAL_H450
00617 
00622     bool TransferCall(
00623       const PString & remoteParty,   
00624       const PString & callIdentity = PString::Empty()
00626     );
00627 
00632     void ConsultationTransfer(
00633       const PString & primaryCallToken  
00634     );
00635 
00642     virtual void HandleConsultationTransfer(
00643       const PString & callIdentity, 
00645       H323Connection & incoming     
00646     );
00647 
00650     PBoolean IsTransferringCall() const;
00651 
00654     PBoolean IsTransferredCall() const;
00655 
00660     virtual void HandleTransferCall(
00661       const PString & token,
00662       const PString & identity
00663     );
00664 
00669     int GetCallTransferInvokeId();
00670 
00678     virtual void HandleCallTransferFailure(
00679       const int returnError    
00680     );
00681 
00686     void SetAssociatedCallToken(
00687       const PString & token  
00688     );
00689 
00694     virtual void OnConsultationTransferSuccess(
00695       H323Connection & secondaryCall  
00696     );
00697 
00702     bool HoldCall(
00703       PBoolean localHold   
00704     );
00705 
00711     bool RetrieveCall();
00712 
00719     void SetHoldMedia(
00720       PChannel * audioChannel
00721     );
00722 
00725     PBoolean IsMediaOnHold() const;
00726 
00729     PBoolean IsLocalHold() const;
00730 
00733     PBoolean IsRemoteHold() const;
00734 
00737     PBoolean IsCallOnHold() const;
00738 
00743     virtual void IntrudeCall(
00744       unsigned capabilityLevel
00745     );
00746 
00751     virtual void HandleIntrudeCall(
00752       const PString & token,
00753       const PString & identity
00754     );
00755 
00761     void SetCallIntrusion() { isCallIntrusion = PTrue; }
00762 
00763     PBoolean IsCallIntrusion() { return isCallIntrusion; }
00764 
00767     unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
00768 
00772     virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
00773       const PString & callToken,
00774       unsigned callIntrusionProtectionLevel
00775     );
00776 
00777     virtual void SetIntrusionImpending();
00778 
00779     virtual void SetForcedReleaseAccepted();
00780 
00781     virtual void SetIntrusionNotAuthorized();
00782 
00789     void SendCallWaitingIndication(
00790       const unsigned nbOfAddWaitingCalls = 0   
00791     );
00792 
00793 #endif
00794 
00821     virtual AnswerCallResponse OnAnswerCall(
00822       const PString & callerName,       
00823       const H323SignalPDU & setupPDU,   
00824       H323SignalPDU & connectPDU,       
00825       H323SignalPDU & progressPDU       
00826     );
00827     
00828     virtual AnswerCallResponse OnAnswerCall(
00829       const PString & callerName        
00830     );
00831 
00842     void AnsweringCall(
00843       AnswerCallResponse response 
00844     );
00845 
00856     virtual CallEndReason SendSignalSetup(
00857       const PString & alias,                
00858       const H323TransportAddress & address  
00859     );
00860 
00872     virtual PBoolean OnSendSignalSetup(
00873       H323SignalPDU & setupPDU   
00874     );
00875 
00884     virtual PBoolean OnSendCallProceeding(
00885       H323SignalPDU & callProceedingPDU   
00886     );
00887 
00899     virtual PBoolean OnSendReleaseComplete(
00900       H323SignalPDU & releaseCompletePDU 
00901     );
00902 
00913     virtual PBoolean OnAlerting(
00914       const H323SignalPDU & alertingPDU,  
00915       const PString & user                
00916     );
00917 
00932     virtual PBoolean OnInsufficientDigits();
00933 
00946     virtual void SendMoreDigits(
00947       const PString & digits    
00948     );
00949 
00959     virtual PBoolean OnOutgoingCall(
00960       const H323SignalPDU & connectPDU   
00961     );
00962 
00974     virtual PBoolean SendFastStartAcknowledge(
00975       H225_ArrayOf_PASN_OctetString & array   
00976     );
00977 
00989     virtual PBoolean HandleFastStartAcknowledge(
00990       const H225_ArrayOf_PASN_OctetString & array   
00991     );
00993 
01007     virtual PBoolean CreateOutgoingControlChannel(
01008       const H225_TransportAddress & h245Address   
01009     );
01010 
01023     virtual PBoolean CreateIncomingControlChannel(
01024       H225_TransportAddress & h245Address  
01025     );
01026 
01031     virtual PBoolean WriteControlPDU(
01032       const H323ControlPDU & pdu
01033     );
01034 
01037     virtual PBoolean StartControlNegotiations();
01038 
01041     virtual void HandleControlChannel();
01042 
01049     virtual PBoolean HandleControlData(
01050       PPER_Stream & strm
01051     );
01052 
01059     virtual PBoolean HandleControlPDU(
01060       const H323ControlPDU & pdu
01061     );
01062 
01072     virtual PBoolean OnUnknownControlPDU(
01073       const H323ControlPDU & pdu  
01074     );
01075 
01079     virtual PBoolean OnH245Request(
01080       const H323ControlPDU & pdu  
01081     );
01082 
01086     virtual PBoolean OnH245Response(
01087       const H323ControlPDU & pdu  
01088     );
01089 
01093     virtual PBoolean OnH245Command(
01094       const H323ControlPDU & pdu  
01095     );
01096 
01100     virtual PBoolean OnH245Indication(
01101       const H323ControlPDU & pdu  
01102     );
01103 
01106     virtual PBoolean OnH245_SendTerminalCapabilitySet(
01107       const H245_SendTerminalCapabilitySet & pdu  
01108     );
01109 
01114     virtual PBoolean OnH245_FlowControlCommand(
01115       const H245_FlowControlCommand & pdu  
01116     );
01117 
01122     virtual PBoolean OnH245_MiscellaneousCommand(
01123       const H245_MiscellaneousCommand & pdu  
01124     );
01125 
01130     virtual PBoolean OnH245_MiscellaneousIndication(
01131       const H245_MiscellaneousIndication & pdu  
01132     );
01133 
01138     virtual PBoolean OnH245_JitterIndication(
01139       const H245_JitterIndication & pdu  
01140     );
01141 
01142 #if OPAL_H239
01143 
01145     virtual bool OnH239Message(
01146       unsigned subMessage,
01147       const H245_ArrayOf_GenericParameter & params
01148     );
01149 
01153     virtual bool OnH239FlowControlRequest(
01154       unsigned logicalChannel,
01155       unsigned bitRate
01156     );
01157 
01161     virtual bool OnH239FlowControlResponse(
01162       unsigned logicalChannel,
01163       bool rejected
01164     );
01165 
01169     virtual bool OnH239PresentationRequest(
01170       unsigned logicalChannel,
01171       unsigned symmetryBreaking,
01172       unsigned terminalLabel
01173     );
01174 
01178     virtual bool OnH239PresentationResponse(
01179       unsigned logicalChannel,
01180       unsigned terminalLabel,
01181       bool rejected
01182     );
01183 
01187     virtual bool OnH239PresentationRelease(
01188       unsigned logicalChannel,
01189       unsigned terminalLabel
01190     );
01191 
01195     virtual bool OnH239PresentationIndication(
01196       unsigned logicalChannel,
01197       unsigned terminalLabel
01198     );
01199 #endif
01200 
01203     enum ControlProtocolErrors {
01204       e_MasterSlaveDetermination,
01205       e_CapabilityExchange,
01206       e_LogicalChannel,
01207       e_ModeRequest,
01208       e_RoundTripDelay
01209     };
01210 
01222     virtual PBoolean OnControlProtocolError(
01223       ControlProtocolErrors errorSource,  
01224       const void * errorData = NULL       
01225     );
01226 
01234     virtual void OnSendCapabilitySet(
01235       H245_TerminalCapabilitySet & pdu  
01236     );
01237 
01249     virtual PBoolean OnReceivedCapabilitySet(
01250       const H323Capabilities & remoteCaps,      
01251       const H245_MultiplexCapability * muxCap,  
01252       H245_TerminalCapabilitySetReject & reject 
01253     );
01254 
01257     virtual bool SendCapabilitySet(
01258       PBoolean empty  
01259     );
01260 
01263     virtual bool IsSendingCapabilitySet();
01264 
01273     virtual void OnSetLocalCapabilities();
01274 
01277     PBoolean IsH245Master() const;
01278 
01281     void StartRoundTripDelay();
01282 
01285     PTimeInterval GetRoundTripDelay() const;
01287 
01327     virtual void OnSelectLogicalChannels();
01328 
01331     virtual void SelectDefaultLogicalChannel(
01332       const OpalMediaType & mediaType,  
01333       unsigned sessionID                
01334     );
01335 
01339     virtual void SelectFastStartChannels(
01340       unsigned sessionID,   
01341       PBoolean transmitter,     
01342       PBoolean receiver         
01343     );
01344 
01348     virtual void StartFastStartChannel(
01349       unsigned sessionID,               
01350       H323Channel::Directions direction 
01351     );
01352 
01367     virtual PBoolean OpenLogicalChannel(
01368       const H323Capability & capability,  
01369       unsigned sessionID,                 
01370       H323Channel::Directions dir         
01371     );
01372     
01373     virtual void SendFlowControlCommand(
01374       unsigned channelNumber,
01375       unsigned newBitRate
01376     );
01377     
01387     virtual PBoolean OnOpenLogicalChannel(
01388       const H245_OpenLogicalChannel & openPDU,  
01389       H245_OpenLogicalChannelAck & ackPDU,      
01390       unsigned & errorCode                      
01391     );
01392 
01400     virtual PBoolean OnConflictingLogicalChannel(
01401       H323Channel & channel    
01402     );
01403 
01408     virtual H323Channel * CreateLogicalChannel(
01409       const H245_OpenLogicalChannel & open, 
01410       PBoolean startingFast,                    
01411       unsigned & errorCode                  
01412     );
01413 
01448     virtual H323Channel * CreateRealTimeLogicalChannel(
01449       const H323Capability & capability, 
01450       H323Channel::Directions dir,       
01451       unsigned sessionID,                
01452       const H245_H2250LogicalChannelParameters * param,
01454       RTP_QOS * rtpqos = NULL            
01455     );
01456     
01460     virtual H323_RTPChannel * CreateRTPChannel(
01461       const H323Capability & capability,
01462       H323Channel::Directions direction,
01463       RTP_Session & rtp
01464     );
01465 
01476     virtual PBoolean OnCreateLogicalChannel(
01477       const H323Capability & capability,  
01478       H323Channel::Directions dir,        
01479       unsigned & errorCode                
01480     );
01481 
01486     virtual PBoolean OnStartLogicalChannel(
01487       H323Channel & channel    
01488     );
01489 
01492     virtual void CloseLogicalChannel(
01493       unsigned number,    
01494       PBoolean fromRemote     
01495     );
01496 
01499     virtual void CloseLogicalChannelNumber(
01500       const H323ChannelNumber & number    
01501     );
01502 
01505     virtual void CloseAllLogicalChannels(
01506       PBoolean fromRemote     
01507     );
01508 
01514     virtual void OnClosedLogicalChannel(
01515       const H323Channel & channel   
01516     );
01517 
01526     virtual PBoolean OnClosingLogicalChannel(
01527       H323Channel & channel   
01528     );
01529 
01538     virtual void OnLogicalChannelFlowControl(
01539       H323Channel * channel,   
01540       long bitRateRestriction  
01541     );
01542 
01551     virtual void OnLogicalChannelJitter(
01552       H323Channel * channel,   
01553       DWORD jitter,            
01554       int skippedFrameCount,   
01555       int additionalBuffer     
01556     );
01557 
01561     H323Channel * GetLogicalChannel(
01562       unsigned number,    
01563       PBoolean fromRemote     
01564     ) const;
01565 
01571     H323Channel * FindChannel(
01572       unsigned sessionId,   
01573       PBoolean fromRemote       
01574     ) const;
01576 
01583     virtual PBoolean SetBandwidthAvailable(
01584       unsigned newBandwidth,    
01585       PBoolean force = PFalse        
01586     );
01587 
01592     virtual unsigned GetBandwidthUsed() const;
01594 
01602     virtual SendUserInputModes GetRealSendUserInputMode() const;
01603 
01617     virtual PBoolean SendUserInputString(
01618       const PString & value                   
01619     );
01620 
01645     virtual PBoolean SendUserInputTone(
01646       char tone,             
01647       unsigned duration = 0  
01648     );
01649 
01656     virtual PBoolean SendUserInputIndicationQ931(
01657       const PString & value                   
01658     );
01659 
01666     virtual PBoolean SendUserInputIndicationString(
01667       const PString & value                   
01668     );
01669 
01674     virtual PBoolean SendUserInputIndicationTone(
01675       char tone,                   
01676       unsigned duration = 0,       
01677       unsigned logicalChannel = 0, 
01678       unsigned rtpTimestamp = 0    
01679     );
01680 
01689     virtual PBoolean SendUserInputIndication(
01690       const H245_UserInputIndication & pdu    
01691     );
01692 
01697     virtual void OnUserInputIndication(
01698       const H245_UserInputIndication & pdu  
01699     );
01701 
01707     virtual H323_RTP_Session * GetSessionCallbacks(
01708       unsigned sessionID
01709     ) const;
01710 
01720     virtual RTP_Session * UseSession(
01721       const OpalTransport & transport,
01722                    unsigned sessionID,
01723       const OpalMediaType & mediatype,  
01724                   RTP_QOS * rtpqos = NULL
01725     );
01726 
01730     virtual void ReleaseSession(
01731       unsigned sessionID
01732     );
01733 
01741     virtual void OnRTPStatistics(
01742       const RTP_Session & session   
01743     ) const;
01744 
01748     virtual PString GetSessionCodecNames(
01749       unsigned sessionID
01750     ) const;
01751 
01753 
01771     virtual PBoolean RequestModeChange(
01772       const PString & newModes  
01773     );
01774 
01782     virtual PBoolean RequestModeChange(
01783       const H245_ArrayOf_ModeDescription & newModes  
01784     );
01785 
01788     virtual PBoolean OnRequestModeChange(
01789       const H245_RequestMode & pdu,     
01790       H245_RequestModeAck & ack,        
01791       H245_RequestModeReject & reject,  
01792       PINDEX & selectedMode           
01793     );
01794 
01801     virtual void OnModeChanged(
01802       const H245_ModeDescription & newMode
01803     );
01804 
01809     virtual void OnAcceptModeChange(
01810       const H245_RequestModeAck & pdu  
01811     );
01812 
01817     virtual void OnRefusedModeChange(
01818       const H245_RequestModeReject * pdu  
01819     );
01821 
01829     virtual PBoolean RequestModeChangeT38(
01830       const char * capabilityNames = "T.38\nT38FaxUDP"
01831     );
01832 
01842     virtual PBoolean GetAdmissionRequestAuthentication(
01843       const H225_AdmissionRequest & arq,  
01844       H235Authenticators & authenticators 
01845     );
01847 
01852     H323EndPoint & GetEndPoint() const { return endpoint; }
01853 
01856     PBoolean HadAnsweredCall() const { return !originating; }
01857 
01860     PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
01861 
01866     unsigned GetDistinctiveRing() const { return distinctiveRing; }
01867 
01874     void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
01875 
01879     const PString & GetCallToken() const { return GetToken(); }
01880 
01883     unsigned GetCallReference() const { return callReference; }
01884 
01887     inline const OpalGloballyUniqueID & GetCallIdentifier() const 
01888     { return callIdentifier; }
01889 
01892     virtual PString GetIdentifier() const;
01893 
01896     const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
01897 
01900     void SetLocalPartyName(const PString & name);
01901 
01904     const PStringList & GetLocalAliasNames() const { return localAliasNames; }
01905 
01908     virtual void SetRemotePartyInfo(
01909       const H323SignalPDU & pdu 
01910     );
01911 
01914     void SetRemoteApplication(
01915       const H225_EndpointType & pdu 
01916     );
01917     
01922     PString GetRemotePartyURL() const;
01923     
01926     const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
01927 
01930     const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
01931 
01934     unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
01935 
01938     const H323Transport * GetSignallingChannel() const { return signallingChannel; }
01939 
01942     unsigned GetSignallingVersion() const { return h225version; }
01943 
01946     const H323Transport & GetControlChannel() const;
01947 
01950     OpalTransport & GetTransport() const;
01951 
01954     unsigned GetControlVersion() const { return h245version; }
01955 
01958     unsigned GetUUIEsRequested() const { return uuiesRequested; }
01959 
01962     void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
01963 
01966     const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
01967 
01970     void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
01971 
01974     const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
01975 
01978     void SetDestExtraCallInfo(
01979       const PString & info
01980     ) { destExtraCallInfo = info; }
01981 
01984     void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
01985 
01991     int GetRemoteCallWaiting() const { return remoteCallWaiting; }
01992 
01997     void SetEnforcedDurationLimit(
01998       unsigned seconds  
01999     );
02001     
02002 #if OPAL_H239
02003 
02005     bool GetLocalH239Control() const { return m_h239Control; }
02006 
02009     void SetLocalH239Control(
02010       bool on   
02011     ) { m_h239Control = on; }
02012 
02015     bool GetRemoteH239Control() const;
02016 
02019     OpalMediaFormatList GetRemoteH239Formats() const;
02020 #endif
02021 
02022     virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
02023     
02024     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
02025 
02026 #if OPAL_H460
02027 
02029     virtual H460_FeatureSet * GetFeatureSet();
02030 #endif
02031 
02032     
02033 #if OPAL_H450
02034 
02038     H4507Handler&  getH4507handler(){return *h4507handler;}
02039 #endif
02040 
02041     virtual void OnMediaCommand(OpalMediaCommand & note, INT extra);
02042     
02043   protected:
02049     virtual void InternalEstablishedConnectionCheck();
02050     PBoolean InternalEndSessionCheck(PPER_Stream & strm);
02051     void SetRemoteVersions(const H225_ProtocolIdentifier & id);
02052     void MonitorCallStatus();
02053     PDECLARE_NOTIFIER(PThread, H323Connection, StartOutgoing);
02054     PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
02055     PDECLARE_NOTIFIER(PThread, H323Connection, NewIncomingControlChannel);
02056 
02057     H323EndPoint & endpoint;
02058 
02059     int                  remoteCallWaiting; // Number of call's waiting at the remote endpoint
02060     PBoolean                 gatekeeperRouted;
02061     unsigned             distinctiveRing;
02062     unsigned             callReference;
02063     OpalGloballyUniqueID callIdentifier;
02064     OpalGloballyUniqueID conferenceIdentifier;
02065 
02066     PString            localDestinationAddress;
02067     PStringList        localAliasNames;
02068     H323Capabilities   localCapabilities; // Capabilities local system supports
02069     PString            destExtraCallInfo;
02070     H323Capabilities   remoteCapabilities; // Capabilities remote system supports
02071     unsigned           remoteMaxAudioDelayJitter;
02072     PTimer             roundTripDelayTimer;
02073     WORD               maxAudioDelayJitter;
02074     unsigned           uuiesRequested;
02075     PString            gkAccessTokenOID;
02076     PBYTEArray         gkAccessTokenData;
02077     PBoolean               addAccessTokenToSetup;
02078     PBoolean               alertDone;
02079 
02080     H323Transport * signallingChannel;
02081     H323Transport * controlChannel;
02082     OpalListener  * controlListener;
02083     PBoolean            h245Tunneling;
02084     H323SignalPDU * h245TunnelRxPDU;
02085     H323SignalPDU * h245TunnelTxPDU;
02086     H323SignalPDU * setupPDU;
02087     H323SignalPDU * alertingPDU;
02088     H323SignalPDU * connectPDU;
02089     H323SignalPDU * progressPDU;
02090 
02091     enum ConnectionStates {
02092       NoConnectionActive,
02093       AwaitingGatekeeperAdmission,
02094       AwaitingTransportConnect,
02095       AwaitingSignalConnect,
02096       AwaitingLocalAnswer,
02097       HasExecutedSignalConnect,
02098       EstablishedConnection,
02099       ShuttingDownConnection,
02100       NumConnectionStates
02101     } connectionState;
02102 
02103     unsigned   h225version;
02104     unsigned   h245version;
02105     PBoolean       h245versionSet;
02106     PBoolean doH245inSETUP;
02107     PBoolean lastPDUWasH245inSETUP;
02108 
02109     PBoolean mustSendDRQ;
02110     PBoolean mediaWaitForConnect;
02111     PBoolean transmitterSidePaused;
02112     bool     remoteTransmitPaused;
02113     PBoolean earlyStart;
02114     PString    t38ModeChangeCapabilities;
02115     PSyncPoint digitsWaitFlag;
02116     PBoolean       endSessionNeeded;
02117     PSyncPoint endSessionReceived;
02118     PTimer     enforcedDurationLimit;
02119 
02120     // Used as part of a local call hold operation involving MOH
02121     PChannel * holdMediaChannel;
02122     PBoolean       isConsultationTransfer;
02123 
02125     PBoolean     isCallIntrusion;
02126     unsigned callIntrusionProtectionLevel;
02127 
02128     enum FastStartStates {
02129       FastStartDisabled,
02130       FastStartInitiate,
02131       FastStartResponse,
02132       FastStartAcknowledged,
02133       NumFastStartStates
02134     };
02135     FastStartStates        fastStartState;
02136     H323LogicalChannelList fastStartChannels;
02137     OpalMediaStreamPtr     fastStartMediaStream;
02138     
02139 #if PTRACING
02140     static const char * GetConnectionStatesName(ConnectionStates s);
02141     friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << GetConnectionStatesName(s); }
02142     static const char * GetFastStartStateName(FastStartStates s);
02143     friend ostream & operator<<(ostream & o, FastStartStates s) { return o << GetFastStartStateName(s); }
02144 #endif
02145 
02146 
02147     // The following pointers are to protocol procedures, they are pointers to
02148     // hide their complexity from the H323Connection classes users.
02149     H245NegMasterSlaveDetermination  * masterSlaveDeterminationProcedure;
02150     H245NegTerminalCapabilitySet     * capabilityExchangeProcedure;
02151     H245NegLogicalChannels           * logicalChannels;
02152     H245NegRequestMode               * requestModeProcedure;
02153     H245NegRoundTripDelay            * roundTripDelayProcedure;
02154 
02155 #if OPAL_H239
02156     bool m_h239Control;
02157 #endif
02158 
02159 #if OPAL_H450
02160     H450xDispatcher * h450dispatcher;
02161     H4502Handler    * h4502handler;
02162     H4504Handler    * h4504handler;
02163     H4506Handler    * h4506handler;
02164     H4507Handler    * h4507handler;
02165     H45011Handler   * h45011handler;
02166 #endif
02167 
02168 #if OPAL_H460
02169     H460_FeatureSet * features;
02170 #endif
02171 
02172   private:
02173     PChannel * SwapHoldMediaChannels(PChannel * newChannel);
02174 };
02175 
02176 
02177 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
02178 
02179 
02180 #endif // OPAL_H323
02181 
02182 #endif // OPAL_H323_H323CON_H
02183 
02184 

Generated on Mon Aug 3 20:50:13 2009 for OPAL by  doxygen 1.5.1