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: 28579 $
00030  * $Author: rjongbloed $
00031  * $Date: 2012-11-25 23:46:48 -0600 (Sun, 25 Nov 2012) $
00032  */
00033 
00034 #ifndef OPAL_H323_H323CON_H
00035 #define OPAL_H323_H323CON_H
00036 
00037 #ifdef P_USE_PRAGMA
00038 #pragma interface
00039 #endif
00040 
00041 #include <opal/buildopts.h>
00042 
00043 #if OPAL_H323
00044 
00045 #include <opal/rtpconn.h>
00046 #include <opal/guid.h>
00047 #include <opal/buildopts.h>
00048 #include <h323/h323caps.h>
00049 #include <ptclib/dtmf.h>
00050 
00051 
00052 /* The following classes have forward references to avoid including the VERY
00053    large header files for H225 and H245. If an application requires access
00054    to the protocol classes they can include them, but for simple usage their
00055    inclusion can be avoided.
00056  */
00057 class PPER_Stream;
00058 class PASN_OctetString;
00059 
00060 class H225_EndpointType;
00061 class H225_TransportAddress;
00062 class H225_ArrayOf_PASN_OctetString;
00063 class H225_ProtocolIdentifier;
00064 class H225_AdmissionRequest;
00065 class H225_AdmissionConfirm;
00066 class H225_AdmissionReject;
00067 class H225_InfoRequestResponse;
00068 class H225_DisengageRequest;
00069 class H225_FeatureSet;
00070 
00071 class H245_TerminalCapabilitySet;
00072 class H245_TerminalCapabilitySetReject;
00073 class H245_OpenLogicalChannel;
00074 class H245_OpenLogicalChannelAck;
00075 class H245_TransportAddress;
00076 class H245_UserInputIndication;
00077 class H245_RequestMode;
00078 class H245_RequestModeAck;
00079 class H245_RequestModeReject;
00080 class H245_ModeDescription;
00081 class H245_ArrayOf_ModeDescription;
00082 class H245_SendTerminalCapabilitySet;
00083 class H245_MultiplexCapability;
00084 class H245_FlowControlCommand;
00085 class H245_MiscellaneousCommand;
00086 class H245_MiscellaneousIndication;
00087 class H245_JitterIndication;
00088 class H245_ArrayOf_GenericParameter;
00089 
00090 class H323SignalPDU;
00091 class H323ControlPDU;
00092 class H323EndPoint;
00093 class H323TransportAddress;
00094 
00095 class H235Authenticators;
00096 
00097 class H245NegMasterSlaveDetermination;
00098 class H245NegTerminalCapabilitySet;
00099 class H245NegLogicalChannels;
00100 class H245NegRequestMode;
00101 class H245NegRoundTripDelay;
00102 
00103 class H450xDispatcher;
00104 class H4502Handler;
00105 class H4504Handler;
00106 class H4506Handler;
00107 class H4507Handler;
00108 class H45011Handler;
00109 
00110 class OpalCall;
00111 
00112 #if OPAL_H460
00113 class H460_FeatureSet;
00114 #endif
00115 
00116 
00119 #define OPAL_OPT_Q931_BEARER_CAPS "Q931-Bearer-Caps"
00120 
00121 
00123 
00130 class H323Connection : public OpalRTPConnection
00131 {
00132   PCLASSINFO(H323Connection, OpalRTPConnection);
00133 
00134   public:
00139     H323Connection(
00140       OpalCall & call,                         
00141       H323EndPoint & endpoint,                 
00142       const PString & token,                   
00143       const PString & alias,                   
00144       const H323TransportAddress & address,    
00145       unsigned options = 0,                    
00146       OpalConnection::StringOptions * stringOptions = NULL 
00147     );
00148 
00151     ~H323Connection();
00153 
00164     virtual bool IsNetworkConnection() const { return true; }
00165 
00168     virtual PString GetPrefixName() const;
00169 
00171     virtual void OnApplyStringOptions();
00172 
00179     virtual PBoolean SetUpConnection();
00180 
00190     virtual PBoolean SetAlerting(
00191       const PString & calleeName,   
00192       PBoolean withMedia                
00193     );
00194 
00199     virtual PBoolean SetConnected();
00200 
00205     virtual PBoolean SetProgressed();
00206     
00214     virtual void OnEstablished();
00215 
00233     virtual void OnReleased();
00234 
00239     virtual PString GetDestinationAddress();
00240 
00254     virtual PString GetAlertingType() const;
00255 
00269     virtual bool SetAlertingType(const PString & info);
00270 
00273     unsigned GetProgressIndicator() const { return m_progressIndicator; }
00274 
00277     void SetProgressIndicator(unsigned indicator) { m_progressIndicator = indicator; }
00278 
00286     virtual OpalMediaFormatList GetMediaFormats() const;
00287 
00290     virtual unsigned GetNextSessionID(
00291       const OpalMediaType & mediaType,   
00292       bool isSource                      
00293     );
00294 
00295 #if OPAL_FAX
00296 
00298     virtual bool SwitchFaxMediaStreams(
00299       bool toT38  
00300     );
00301 #endif
00302 
00305     virtual OpalMediaStreamPtr OpenMediaStream(
00306       const OpalMediaFormat & mediaFormat, 
00307       unsigned sessionID,                  
00308       bool isSource                        
00309     );
00310     
00315     virtual bool CloseMediaStream(
00316       OpalMediaStream & stream  
00317     );
00318 
00323     virtual PBoolean GetMediaInformation(
00324       unsigned sessionID,     
00325       MediaInformation & info 
00326     ) const;
00328 
00333     void AttachSignalChannel(
00334       const PString & token,    
00335       H323Transport * channel,  
00336       PBoolean answeringCall        
00337     );
00338 
00341     PBoolean WriteSignalPDU(
00342       H323SignalPDU & pdu       
00343     );
00344 
00348     virtual void HandleSignallingChannel();
00349 
00353     virtual PBoolean HandleSignalPDU(
00354       H323SignalPDU & pdu       
00355     );
00356 
00360     virtual void HandleTunnelPDU(
00361       H323SignalPDU * txPDU       
00362     );
00363 
00371     virtual PBoolean OnReceivedSignalSetup(
00372       const H323SignalPDU & pdu   
00373     );
00374 
00381     virtual PBoolean OnReceivedSignalSetupAck(
00382       const H323SignalPDU & pdu   
00383     );
00384 
00391     virtual PBoolean OnReceivedSignalInformation(
00392       const H323SignalPDU & pdu   
00393     );
00394 
00403     virtual PBoolean OnReceivedCallProceeding(
00404       const H323SignalPDU & pdu   
00405     );
00406 
00415     virtual PBoolean OnReceivedProgress(
00416       const H323SignalPDU & pdu   
00417     );
00418 
00425     virtual PBoolean OnReceivedAlerting(
00426       const H323SignalPDU & pdu   
00427     );
00428 
00437     virtual PBoolean OnReceivedSignalConnect(
00438       const H323SignalPDU & pdu   
00439     );
00440 
00449     virtual PBoolean OnReceivedFacility(
00450       const H323SignalPDU & pdu   
00451     );
00452 
00459     virtual PBoolean OnReceivedSignalNotify(
00460       const H323SignalPDU & pdu   
00461     );
00462 
00469     virtual PBoolean OnReceivedSignalStatus(
00470       const H323SignalPDU & pdu   
00471     );
00472 
00479     virtual PBoolean OnReceivedStatusEnquiry(
00480       const H323SignalPDU & pdu   
00481     );
00482 
00487     virtual void OnReceivedReleaseComplete(
00488       const H323SignalPDU & pdu   
00489     );
00490 
00497     virtual PBoolean OnUnknownSignalPDU(
00498       const H323SignalPDU & pdu  
00499     );
00500 
00507     virtual void OnSendARQ(
00508       H225_AdmissionRequest & arq
00509     );
00510 
00516     virtual void OnReceivedACF(
00517       const H225_AdmissionConfirm & acf
00518     );
00519 
00525     virtual void OnReceivedARJ(
00526       const H225_AdmissionReject & arj
00527     );
00528 
00535     virtual void OnSendIRR(
00536       H225_InfoRequestResponse & irr
00537     ) const;
00538 
00545     virtual void OnSendDRQ(
00546       H225_DisengageRequest & drq
00547     ) const;
00548 
00560     virtual PBoolean OnIncomingCall(
00561       const H323SignalPDU & setupPDU,   
00562       H323SignalPDU & alertingPDU       
00563     );
00564 
00574     virtual PBoolean ForwardCall(
00575       const PString & forwardParty   
00576     );
00577 
00584     virtual bool TransferConnection(
00585       const PString & remoteParty   
00586     );
00587 
00595     virtual bool Hold(
00596       bool fromRemote,  
00597       bool placeOnHold  
00598     );
00599 
00604     virtual bool IsOnHold(
00605       bool fromRemote  
00606     );
00607 
00608 #if OPAL_H450
00609 
00614     bool TransferCall(
00615       const PString & remoteParty,   
00616       const PString & callIdentity = PString::Empty()
00618     );
00619 
00624     void ConsultationTransfer(
00625       const PString & primaryCallToken  
00626     );
00627 
00634     virtual void HandleConsultationTransfer(
00635       const PString & callIdentity, 
00637       H323Connection & incoming     
00638     );
00639 
00642     PBoolean IsTransferringCall() const;
00643 
00646     PBoolean IsTransferredCall() const;
00647 
00652     virtual void HandleTransferCall(
00653       const PString & token,
00654       const PString & identity
00655     );
00656 
00661     int GetCallTransferInvokeId();
00662 
00670     virtual void HandleCallTransferFailure(
00671       const int returnError    
00672     );
00673 
00678     void SetAssociatedCallToken(
00679       const PString & token  
00680     );
00681 
00686     virtual void OnConsultationTransferSuccess(
00687       H323Connection & secondaryCall  
00688     );
00689 
00694     virtual void IntrudeCall(
00695       unsigned capabilityLevel
00696     );
00697 
00702     virtual void HandleIntrudeCall(
00703       const PString & token,
00704       const PString & identity
00705     );
00706 
00712     void SetCallIntrusion() { isCallIntrusion = true; }
00713 
00714     PBoolean IsCallIntrusion() { return isCallIntrusion; }
00715 
00718     unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
00719 
00723     virtual PBoolean GetRemoteCallIntrusionProtectionLevel(
00724       const PString & callToken,
00725       unsigned callIntrusionProtectionLevel
00726     );
00727 
00728     virtual void SetIntrusionImpending();
00729 
00730     virtual void SetForcedReleaseAccepted();
00731 
00732     virtual void SetIntrusionNotAuthorized();
00733 
00740     void SendCallWaitingIndication(
00741       const unsigned nbOfAddWaitingCalls = 0   
00742     );
00743 
00744 #endif
00745 
00772     virtual AnswerCallResponse OnAnswerCall(
00773       const PString & callerName,       
00774       const H323SignalPDU & setupPDU,   
00775       H323SignalPDU & connectPDU,       
00776       H323SignalPDU & progressPDU       
00777     );
00778     
00779     virtual AnswerCallResponse OnAnswerCall(
00780       const PString & callerName        
00781     );
00782 
00793     void AnsweringCall(
00794       AnswerCallResponse response 
00795     );
00796 
00807     virtual CallEndReason SendSignalSetup(
00808       const PString & alias,                
00809       const H323TransportAddress & address  
00810     );
00811 
00823     virtual PBoolean OnSendSignalSetup(
00824       H323SignalPDU & setupPDU   
00825     );
00826 
00835     virtual PBoolean OnSendCallProceeding(
00836       H323SignalPDU & callProceedingPDU   
00837     );
00838 
00850     virtual PBoolean OnSendReleaseComplete(
00851       H323SignalPDU & releaseCompletePDU 
00852     );
00853 
00864     virtual PBoolean OnAlerting(
00865       const H323SignalPDU & alertingPDU,  
00866       const PString & user                
00867     );
00868 
00883     virtual PBoolean OnInsufficientDigits();
00884 
00897     virtual void SendMoreDigits(
00898       const PString & digits    
00899     );
00900 
00910     virtual PBoolean OnOutgoingCall(
00911       const H323SignalPDU & connectPDU   
00912     );
00913 
00925     virtual PBoolean SendFastStartAcknowledge(
00926       H225_ArrayOf_PASN_OctetString & array   
00927     );
00928 
00940     virtual PBoolean HandleFastStartAcknowledge(
00941       const H225_ArrayOf_PASN_OctetString & array   
00942     );
00944 
00958     virtual PBoolean CreateOutgoingControlChannel(
00959       const H225_TransportAddress & h245Address   
00960     );
00961 
00974     virtual PBoolean CreateIncomingControlChannel(
00975       H225_TransportAddress & h245Address  
00976     );
00977 
00982     virtual PBoolean WriteControlPDU(
00983       const H323ControlPDU & pdu
00984     );
00985 
00988     virtual PBoolean StartControlNegotiations();
00989 
00992     virtual void HandleControlChannel();
00993 
01000     virtual PBoolean HandleControlData(
01001       PPER_Stream & strm
01002     );
01003 
01010     virtual PBoolean HandleControlPDU(
01011       const H323ControlPDU & pdu
01012     );
01013 
01023     virtual PBoolean OnUnknownControlPDU(
01024       const H323ControlPDU & pdu  
01025     );
01026 
01030     virtual PBoolean OnH245Request(
01031       const H323ControlPDU & pdu  
01032     );
01033 
01037     virtual PBoolean OnH245Response(
01038       const H323ControlPDU & pdu  
01039     );
01040 
01044     virtual PBoolean OnH245Command(
01045       const H323ControlPDU & pdu  
01046     );
01047 
01051     virtual PBoolean OnH245Indication(
01052       const H323ControlPDU & pdu  
01053     );
01054 
01057     virtual PBoolean OnH245_SendTerminalCapabilitySet(
01058       const H245_SendTerminalCapabilitySet & pdu  
01059     );
01060 
01065     virtual PBoolean OnH245_FlowControlCommand(
01066       const H245_FlowControlCommand & pdu  
01067     );
01068 
01073     virtual PBoolean OnH245_MiscellaneousCommand(
01074       const H245_MiscellaneousCommand & pdu  
01075     );
01076 
01081     virtual PBoolean OnH245_MiscellaneousIndication(
01082       const H245_MiscellaneousIndication & pdu  
01083     );
01084 
01089     virtual PBoolean OnH245_JitterIndication(
01090       const H245_JitterIndication & pdu  
01091     );
01092 
01093 #if OPAL_H239
01094 
01096     virtual bool OnH239Message(
01097       unsigned subMessage,
01098       const H245_ArrayOf_GenericParameter & params
01099     );
01100 
01104     virtual bool OnH239FlowControlRequest(
01105       unsigned logicalChannel,
01106       unsigned bitRate
01107     );
01108 
01112     virtual bool OnH239FlowControlResponse(
01113       unsigned logicalChannel,
01114       bool rejected
01115     );
01116 
01120     virtual bool OnH239PresentationRequest(
01121       unsigned logicalChannel,
01122       unsigned symmetryBreaking,
01123       unsigned terminalLabel
01124     );
01125 
01131     virtual bool SendH239PresentationRequest(
01132       unsigned logicalChannel,
01133       unsigned symmetryBreaking,
01134       unsigned terminalLabel
01135     );
01136 
01140     virtual bool OnH239PresentationResponse(
01141       unsigned logicalChannel,
01142       unsigned terminalLabel,
01143       bool rejected
01144     );
01145 
01149     virtual bool OnH239PresentationRelease(
01150       unsigned logicalChannel,
01151       unsigned terminalLabel
01152     );
01153 
01158     virtual bool SendH239PresentationRelease(
01159       unsigned logicalChannel,
01160       unsigned terminalLabel
01161     );
01162 
01166     virtual bool OnH239PresentationIndication(
01167       unsigned logicalChannel,
01168       unsigned terminalLabel
01169     );
01170 #endif
01171 
01174     enum ControlProtocolErrors {
01175       e_MasterSlaveDetermination,
01176       e_CapabilityExchange,
01177       e_LogicalChannel,
01178       e_ModeRequest,
01179       e_RoundTripDelay
01180     };
01181 
01193     virtual PBoolean OnControlProtocolError(
01194       ControlProtocolErrors errorSource,  
01195       const void * errorData = NULL       
01196     );
01197 
01205     virtual void OnSendCapabilitySet(
01206       H245_TerminalCapabilitySet & pdu  
01207     );
01208 
01220     virtual PBoolean OnReceivedCapabilitySet(
01221       const H323Capabilities & remoteCaps,      
01222       const H245_MultiplexCapability * muxCap,  
01223       H245_TerminalCapabilitySetReject & reject 
01224     );
01225 
01228     virtual bool SendCapabilitySet(
01229       PBoolean empty  
01230     );
01231 
01234     virtual bool IsSendingCapabilitySet();
01235 
01244     virtual void OnSetLocalCapabilities();
01245 
01248     PBoolean IsH245Master() const;
01249 
01252     void StartRoundTripDelay();
01253 
01256     PTimeInterval GetRoundTripDelay() const;
01258 
01298     virtual void OnSelectLogicalChannels();
01299 
01302     virtual void SelectDefaultLogicalChannel(
01303       const OpalMediaType & mediaType,  
01304       unsigned sessionID                
01305     );
01306 
01310     virtual void SelectFastStartChannels(
01311       unsigned sessionID,   
01312       PBoolean transmitter,     
01313       PBoolean receiver         
01314     );
01315 
01319     virtual void StartFastStartChannel(
01320       unsigned sessionID,               
01321       H323Channel::Directions direction 
01322     );
01323 
01338     virtual PBoolean OpenLogicalChannel(
01339       const H323Capability & capability,  
01340       unsigned sessionID,                 
01341       H323Channel::Directions dir         
01342     );
01343     
01344     virtual void SendFlowControlCommand(
01345       unsigned channelNumber,
01346       unsigned newBitRate
01347     );
01348     
01358     virtual PBoolean OnOpenLogicalChannel(
01359       const H245_OpenLogicalChannel & openPDU,  
01360       H245_OpenLogicalChannelAck & ackPDU,      
01361       unsigned & errorCode                      
01362     );
01363 
01371     virtual PBoolean OnConflictingLogicalChannel(
01372       H323Channel & channel    
01373     );
01374 
01379     virtual H323Channel * CreateLogicalChannel(
01380       const H245_OpenLogicalChannel & open, 
01381       PBoolean startingFast,                    
01382       unsigned & errorCode                  
01383     );
01384 
01419     virtual H323Channel * CreateRealTimeLogicalChannel(
01420       const H323Capability & capability, 
01421       H323Channel::Directions dir,       
01422       unsigned sessionID,                
01423       const H245_H2250LogicalChannelParameters * param,
01425       RTP_QOS * rtpqos = NULL            
01426     );
01427     
01431     virtual H323_RTPChannel * CreateRTPChannel(
01432       const H323Capability & capability,
01433       H323Channel::Directions direction,
01434       RTP_Session & rtp
01435     );
01436 
01447     virtual PBoolean OnCreateLogicalChannel(
01448       const H323Capability & capability,  
01449       H323Channel::Directions dir,        
01450       unsigned & errorCode                
01451     );
01452 
01457     virtual PBoolean OnStartLogicalChannel(
01458       H323Channel & channel    
01459     );
01460 
01463     virtual void CloseLogicalChannel(
01464       unsigned number,    
01465       PBoolean fromRemote     
01466     );
01467 
01470     virtual void CloseLogicalChannelNumber(
01471       const H323ChannelNumber & number    
01472     );
01473 
01476     virtual void CloseAllLogicalChannels(
01477       PBoolean fromRemote     
01478     );
01479 
01485     virtual void OnClosedLogicalChannel(
01486       const H323Channel & channel   
01487     );
01488 
01497     virtual PBoolean OnClosingLogicalChannel(
01498       H323Channel & channel   
01499     );
01500 
01509     virtual void OnLogicalChannelFlowControl(
01510       H323Channel * channel,   
01511       long bitRateRestriction  
01512     );
01513 
01522     virtual void OnLogicalChannelJitter(
01523       H323Channel * channel,   
01524       DWORD jitter,            
01525       int skippedFrameCount,   
01526       int additionalBuffer     
01527     );
01528 
01532     H323Channel * GetLogicalChannel(
01533       unsigned number,    
01534       PBoolean fromRemote     
01535     ) const;
01536 
01542     H323Channel * FindChannel(
01543       unsigned sessionId,   
01544       PBoolean fromRemote       
01545     ) const;
01547 
01554     virtual PBoolean SetBandwidthAvailable(
01555       unsigned newBandwidth,    
01556       PBoolean force = false        
01557     );
01558 
01563     virtual unsigned GetBandwidthUsed() const;
01565 
01573     virtual SendUserInputModes GetRealSendUserInputMode() const;
01574 
01588     virtual PBoolean SendUserInputString(
01589       const PString & value                   
01590     );
01591 
01616     virtual PBoolean SendUserInputTone(
01617       char tone,             
01618       unsigned duration = 0  
01619     );
01620 
01627     virtual PBoolean SendUserInputIndicationQ931(
01628       const PString & value                   
01629     );
01630 
01637     virtual PBoolean SendUserInputIndicationString(
01638       const PString & value                   
01639     );
01640 
01645     virtual PBoolean SendUserInputIndicationTone(
01646       char tone,                   
01647       unsigned duration = 0,       
01648       unsigned logicalChannel = 0, 
01649       unsigned rtpTimestamp = 0    
01650     );
01651 
01660     virtual PBoolean SendUserInputIndication(
01661       const H245_UserInputIndication & pdu    
01662     );
01663 
01668     virtual void OnUserInputIndication(
01669       const H245_UserInputIndication & pdu  
01670     );
01672 
01678     virtual H323_RTP_Session * GetSessionCallbacks(
01679       unsigned sessionID
01680     ) const;
01681 
01687     virtual RTP_Session * UseSession(
01688       const OpalTransport & transport,
01689                    unsigned sessionID,
01690       const OpalMediaType & mediatype,  
01691                   RTP_QOS * rtpqos = NULL
01692     );
01693 
01701     virtual void OnRTPStatistics(
01702       const RTP_Session & session   
01703     ) const;
01704 
01708     virtual PString GetSessionCodecNames(
01709       unsigned sessionID
01710     ) const;
01711 
01713 
01731     virtual PBoolean RequestModeChange(
01732       const PString & newModes  
01733     );
01734 
01742     virtual PBoolean RequestModeChange(
01743       const H245_ArrayOf_ModeDescription & newModes  
01744     );
01745 
01748     virtual PBoolean OnRequestModeChange(
01749       const H245_RequestMode & pdu,     
01750       H245_RequestModeAck & ack,        
01751       H245_RequestModeReject & reject,  
01752       PINDEX & selectedMode           
01753     );
01754 
01761     virtual void OnModeChanged(
01762       const H245_ModeDescription & newMode
01763     );
01764 
01769     virtual void OnAcceptModeChange(
01770       const H245_RequestModeAck & pdu  
01771     );
01772 
01777     virtual void OnRefusedModeChange(
01778       const H245_RequestModeReject * pdu  
01779     );
01781 
01789     virtual PBoolean RequestModeChangeT38(
01790       const char * capabilityNames = "T.38\nT38FaxUDP"
01791     );
01792 
01802     virtual PBoolean GetAdmissionRequestAuthentication(
01803       const H225_AdmissionRequest & arq,  
01804       H235Authenticators & authenticators 
01805     );
01807 
01812     H323EndPoint & GetEndPoint() const { return endpoint; }
01813 
01816     PBoolean HadAnsweredCall() const { return !originating; }
01817 
01820     PBoolean IsGatekeeperRouted() const { return gatekeeperRouted; }
01821 
01826     unsigned GetDistinctiveRing() const { return distinctiveRing; }
01827 
01834     void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
01835 
01839     const PString & GetCallToken() const { return GetToken(); }
01840 
01843     unsigned GetCallReference() const { return callReference; }
01844 
01847     inline const OpalGloballyUniqueID & GetCallIdentifier() const 
01848     { return callIdentifier; }
01849 
01852     virtual PString GetIdentifier() const;
01853 
01856     const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
01857 
01860     void SetLocalPartyName(const PString & name);
01861 
01864     const PStringList & GetLocalAliasNames() const { return localAliasNames; }
01865 
01868     virtual void SetRemotePartyInfo(
01869       const H323SignalPDU & pdu 
01870     );
01871 
01874     void SetRemoteApplication(
01875       const H225_EndpointType & pdu 
01876     );
01877     
01880     const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
01881 
01884     const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
01885 
01888     unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
01889 
01892     const H323Transport * GetSignallingChannel() const { return signallingChannel; }
01893 
01896     unsigned GetSignallingVersion() const { return h225version; }
01897 
01900     const H323Transport & GetControlChannel() const;
01901 
01904     OpalTransport & GetTransport() const;
01905 
01908     unsigned GetControlVersion() const { return h245version; }
01909 
01912     unsigned GetUUIEsRequested() const { return uuiesRequested; }
01913 
01916     void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
01917 
01920     const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
01921 
01924     void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
01925 
01928     const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
01929 
01932     void SetDestExtraCallInfo(
01933       const PString & info
01934     ) { destExtraCallInfo = info; }
01935 
01938     void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
01939 
01945     int GetRemoteCallWaiting() const { return remoteCallWaiting; }
01946 
01951     void SetEnforcedDurationLimit(
01952       unsigned seconds  
01953     );
01955     
01956 #if OPAL_H239
01957 
01959     bool GetLocalH239Control() const { return m_h239Control; }
01960 
01963     void SetLocalH239Control(
01964       bool on   
01965     ) { m_h239Control = on; }
01966 
01969     bool GetRemoteH239Control() const;
01970 
01973     OpalMediaFormatList GetRemoteH239Formats() const;
01974 #endif
01975 
01976     virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
01977     
01978     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
01979 
01980 #if OPAL_H460
01981 
01983     virtual H460_FeatureSet * GetFeatureSet();
01984 #endif
01985 
01986     
01987 #if OPAL_H450
01988 
01992     H4507Handler&  getH4507handler(){return *h4507handler;}
01993 #endif
01994 
02000     virtual bool OnMediaCommand(
02001       OpalMediaStream & stream,         
02002       const OpalMediaCommand & command  
02003     );
02004     
02005   protected:
02011     virtual void InternalEstablishedConnectionCheck();
02012     PBoolean InternalEndSessionCheck(PPER_Stream & strm);
02013     void SetRemoteVersions(const H225_ProtocolIdentifier & id);
02014     void SetBearerCapabilities(H323SignalPDU & pdu) const;
02015     void MonitorCallStatus();
02016     PDECLARE_NOTIFIER(PThread, H323Connection, StartOutgoing);
02017     PDECLARE_NOTIFIER(PThread, H323Connection, NewOutgoingControlChannel);
02018     PDECLARE_NOTIFIER(PThread, H323Connection, NewIncomingControlChannel);
02019 
02020     H323EndPoint & endpoint;
02021 
02022     H323TransportAddress m_remoteConnectAddress;
02023     int                  remoteCallWaiting; // Number of call's waiting at the remote endpoint
02024     bool                 gatekeeperRouted;
02025     unsigned             distinctiveRing;
02026     unsigned             callReference;
02027     unsigned             m_progressIndicator;
02028     OpalGloballyUniqueID callIdentifier;
02029     OpalGloballyUniqueID conferenceIdentifier;
02030 
02031     PString            localDestinationAddress;
02032     PStringList        localAliasNames;
02033     H323Capabilities   localCapabilities; // Capabilities local system supports
02034     PString            destExtraCallInfo;
02035     H323Capabilities   remoteCapabilities; // Capabilities remote system supports
02036     unsigned           remoteMaxAudioDelayJitter;
02037     PTimer             roundTripDelayTimer;
02038     unsigned           uuiesRequested;
02039     PString            gkAccessTokenOID;
02040     PBYTEArray         gkAccessTokenData;
02041     bool               addAccessTokenToSetup;
02042 
02043     H323Transport * signallingChannel;
02044     H323Transport * controlChannel;
02045     OpalListener  * controlListener;
02046     bool            h245Tunneling;
02047     H323SignalPDU * h245TunnelRxPDU;
02048     H323SignalPDU * h245TunnelTxPDU;
02049     H323SignalPDU * setupPDU;
02050     H323SignalPDU * alertingPDU;
02051     H323SignalPDU * connectPDU;
02052     H323SignalPDU * progressPDU;
02053 
02054     enum ConnectionStates {
02055       NoConnectionActive,
02056       AwaitingGatekeeperAdmission,
02057       AwaitingTransportConnect,
02058       AwaitingSignalConnect,
02059       AwaitingLocalAnswer,
02060       HasExecutedSignalConnect,
02061       EstablishedConnection,
02062       ShuttingDownConnection,
02063       NumConnectionStates
02064     } connectionState;
02065 
02066     unsigned   h225version;
02067     unsigned   h245version;
02068     bool       h245versionSet;
02069     bool       doH245inSETUP;
02070     bool       lastPDUWasH245inSETUP;
02071 
02072     bool       mustSendDRQ;
02073     bool       mediaWaitForConnect;
02074     bool       transmitterSidePaused;
02075     bool       remoteTransmitPaused;
02076     bool       earlyStart;
02077     PString    t38ModeChangeCapabilities;
02078     PSyncPoint digitsWaitFlag;
02079     bool       endSessionNeeded;
02080     PSyncPoint endSessionReceived;
02081     PTimer     enforcedDurationLimit;
02082     bool       isConsultationTransfer;
02083 
02085     bool     isCallIntrusion;
02086     unsigned callIntrusionProtectionLevel;
02087 
02088     enum FastStartStates {
02089       FastStartDisabled,
02090       FastStartInitiate,
02091       FastStartResponse,
02092       FastStartAcknowledged,
02093       NumFastStartStates
02094     };
02095     FastStartStates        fastStartState;
02096     H323LogicalChannelList fastStartChannels;
02097     OpalMediaStreamPtr     fastStartMediaStream;
02098     
02099 #if PTRACING
02100     static const char * GetConnectionStatesName(ConnectionStates s);
02101     friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << GetConnectionStatesName(s); }
02102     static const char * GetFastStartStateName(FastStartStates s);
02103     friend ostream & operator<<(ostream & o, FastStartStates s) { return o << GetFastStartStateName(s); }
02104 #endif
02105 
02106 
02107     // The following pointers are to protocol procedures, they are pointers to
02108     // hide their complexity from the H323Connection classes users.
02109     H245NegMasterSlaveDetermination  * masterSlaveDeterminationProcedure;
02110     H245NegTerminalCapabilitySet     * capabilityExchangeProcedure;
02111     H245NegLogicalChannels           * logicalChannels;
02112     H245NegRequestMode               * requestModeProcedure;
02113     H245NegRoundTripDelay            * roundTripDelayProcedure;
02114 
02115 #if OPAL_H239
02116     bool m_h239Control;
02117 #endif
02118 
02119 #if OPAL_H450
02120     H450xDispatcher * h450dispatcher;
02121     H4502Handler    * h4502handler;
02122     H4504Handler    * h4504handler;
02123     H4506Handler    * h4506handler;
02124     H4507Handler    * h4507handler;
02125     H45011Handler   * h45011handler;
02126 #endif
02127 
02128 #if OPAL_H460
02129     H460_FeatureSet * features;
02130 #endif
02131 
02132   private:
02133     P_REMOVE_VIRTUAL_VOID(CleanUpOnCallEnd());
02134     P_REMOVE_VIRTUAL_VOID(OnCleared());
02135 };
02136 
02137 
02138 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
02139 
02140 
02141 #endif // OPAL_H323
02142 
02143 #endif // OPAL_H323_H323CON_H
02144 
02145 

Generated on 14 Aug 2013 for OPAL by  doxygen 1.4.7