📄 h323.h
字号:
const H323Capability & capability, /// Capability for the channel open H323Channel::Directions dir, /// Direction of channel unsigned & errorCode /// Error to return if refused ); /**Call back function when a logical channel thread begins. The default behaviour does nothing and returns TRUE. */ virtual BOOL OnStartLogicalChannel( H323Channel & channel /// Channel that has been started. ); /**Open a channel for use by an audio codec. The H323AudioCodec class will use this function to open the channel to read/write PCM data. The default behaviour calls the equivalent function on the endpoint. */ virtual BOOL OpenAudioChannel( BOOL isEncoding, /// Direction of data flow unsigned bufferSize, /// Size of each sound buffer H323AudioCodec & codec /// codec that is doing the opening ); /**Open a channel for use by an video codec. The H323VideoCodec class will use this function to open the channel to read/write image data. The default behaviour calls the equivalent function on the endpoint. */ virtual BOOL OpenVideoDevice( BOOL isEncoding, /// Direction of data flow H323VideoCodec & codec /// codec doing the opening ); /**Close a logical channel. */ virtual void CloseLogicalChannel( unsigned number, /// Channel number to close. BOOL fromRemote /// Indicates close request of remote channel ); /**This function is called when the remote endpoint has closed down a logical channel. The default behaviour does nothing. */ virtual void OnClosedLogicalChannel( const H323Channel & channel /// Channel that was closed ); /**This function is called when the remote endpoint request the close of a logical channel. The application may get an opportunity to refuse to close the channel by returning FALSE from this function. The default behaviour returns TRUE. */ virtual BOOL OnClosingLogicalChannel( H323Channel & channel /// Channel that is to be closed ); /**This function is called when the remote endpoint wishes to limit the bit rate being sent on a channel. If channel is NULL, then the bit rate limit applies to all channels. The default behaviour does nothing if channel is NULL, otherwise calls H323Channel::OnFlowControl() on the specific channel. */ virtual void OnLogicalChannelFlowControl( H323Channel * channel, /// Channel that is to be limited long bitRateRestriction /// Limit for channel ); /**This function is called when the remote endpoint indicates the level of jitter estimated by the receiver. If channel is NULL, then the jitter applies to all channels. The default behaviour does nothing if channel is NULL, otherwise calls H323Channel::OnJitter() on the specific channel. */ virtual void OnLogicalChannelJitter( H323Channel * channel, /// Channel that is to be limited DWORD jitter, /// Estimated received jitter in microseconds int skippedFrameCount, /// Frames skipped by decodec int additionalBuffer /// Additional size of video decoder buffer ); /**Get a logical channel. Locates the specified channel number and returns a pointer to it. */ H323Channel * GetLogicalChannel( unsigned number, /// Channel number to get. BOOL fromRemote /// Indicates get a remote channel ) const; /**Find a logical channel. Locates a channel give a RTP session ID. Each session would usually have two logical channels associated with it, so the fromRemote flag bay be used to distinguish which channel to return. */ H323Channel * FindChannel( unsigned sessionId, /// Session ID to search for. BOOL fromRemote /// Indicates the direction of RTP data. ) const; //@} /**@name Bandwidth Management */ //@{ /**Get the bandwidth currently used. This totals the open channels and returns the total bandwidth used in 100's of bits/sec */ unsigned GetBandwidthUsed() const; /**Request use the available bandwidth in 100's of bits/sec. If there is insufficient bandwidth available, FALSE is returned. If sufficient bandwidth is available, then TRUE is returned and the amount of available bandwidth is reduced by the specified amount. */ BOOL UseBandwidth( unsigned bandwidth, /// Bandwidth required BOOL removing /// Flag for adding/removing bandwidth usage ); /**Get the available bandwidth in 100's of bits/sec. */ unsigned GetBandwidthAvailable() const { return bandwidthAvailable; } /**Set the available bandwidth in 100's of bits/sec. Note if the force parameter is TRUE this function will close down active logical channels to meet the new bandwidth requirement. */ BOOL SetBandwidthAvailable( unsigned newBandwidth, /// New bandwidth limit BOOL force = FALSE /// Force bandwidth limit ); //@} /**@name Indications */ //@{ /**Send a user input indication to the remote endpoint. The two forms are for basic user input of a simple string using the SendUserInput() function or a full DTMF emulation user input using the SendUserInputTone() function. An application could do more sophisticated usage by filling in the H245_UserInputIndication structure directly ans using this function. */ virtual void SendUserInputIndication( const H245_UserInputIndication & pdu /// Full user indication PDU ); /**Send a user input indication to the remote endpoint. This is for sending arbitrary strings as user indications. Simple DTMF tones can be sent this way with the tone value being a single character string. */ virtual void SendUserInput( const PString & value /// String value of indication ); /**Send a user input indication to the remote endpoint. This sends DTMF emulation user input. If something more sophisticated than the simple tones that can be sent using the SendUserInput() function. A duration of zero indicates that no duration is to be indicated. A non-zero logical channel indicates that the tone is to be syncronised with the logical channel at the rtpTimestamp value specified. The tone parameter must be one of "0123456789#*ABCD!" where '!' indicates a hook flash. If tone is a ' ' character then a signalUpdate PDU is sent that updates the last tone indication sent. See the H.245 specifcation for more details on this. */ virtual void SendUserInputTone( char tone, /// DTMF tone code unsigned duration = 0, /// Duration of tone in milliseconds unsigned logicalChannel = 0, /// Logical channel number for RTP sync. unsigned rtpTimestamp = 0 /// RTP timestamp in logical channel sync. ); /**Send a user input indication to the remote endpoint. This sends a Hook Flash emulation user input. */ void SendUserInputHookFlash( int duration = 500 /// Duration of tone in milliseconds ) { SendUserInputTone('!', duration); } /**Call back for remote enpoint has sent user input. The default behaviour calls OnUserInputString() if the PDU is of the alphanumeric type, or OnUserInputTone() if of a tone type. */ virtual void OnUserInputIndication( const H245_UserInputIndication & pdu /// Full user indication PDU ); /**Call back for remote enpoint has sent user input as a string. The default behaviour calls the endpoint function of the same name. */ virtual void OnUserInputString( const PString & value /// String value of indication ); /**Call back for remote enpoint has sent user input. The default behaviour calls the endpoint function of the same name. */ virtual void OnUserInputTone( char tone, /// DTMF tone code unsigned duration, /// Duration of tone in milliseconds unsigned logicalChannel, /// Logical channel number for RTP sync. unsigned rtpTimestamp /// RTP timestamp in logical channel sync. ); //@} /**@name RTP Session Management */ //@{ /**Get an RTP session for the specified ID. If there is no session of the specified ID, NULL is returned. */ RTP_Session * GetSession( unsigned sessionID ) const; /**Get an H323 RTP session for the specified ID. If there is no session of the specified ID, NULL is returned. */ H323_RTP_Session * GetSessionCallbacks( unsigned sessionID ) const; /**Use an RTP session for the specified ID. If there is no session of the specified ID, a new one is created using the information prvided in the H245_TransportAddress PDU. If the system does not support the specified transport, NULL is returned. If this function is used, then the ReleaseSession() function MUST be called or the session is never deleted for the lifetime of the H323 connection. */ RTP_Session * UseSession( unsigned sessionID, const H245_TransportAddress & pdu ); /**Release the session. If the session ID is not being used any more any clients via the UseSession() function, then the session is deleted. */ void ReleaseSession( unsigned sessionID ); /**Callback from the RTP session for statistics monitoring. This is called every so many packets on the transmitter and receiver threads of the RTP session indicating that the statistics have been updated. The default behaviour calls H323EndPoint::OnRTPStatistics(). */ virtual void OnRTPStatistics( const RTP_Session & session /// Session with statistics ) const; /**Get the names of the codecs in use for the RTP session. If there is no session of the specified ID, an empty string is returned. */ PString GetSessionCodecNames( unsigned sessionID ) const; //@} /**@name Request Mode Changes */ //@{ /**Make a request to mode change to remote. */ void RequestModeChange(); /**Received request for mode change from remote. */ BOOL OnRequestModeChange( const H245_RequestMode & pdu, /// Received PDU H245_RequestModeAck & ack, /// Ack PDU to send H245_RequestModeReject & reject /// Reject PDU to send ); /**Received acceptance of last mode change request from remote. */ void OnAcceptModeChange( const H245_RequestModeAck & pdu /// Received PDU ); /**Received reject of last mode change request from remote. */ void OnRefusedModeChange( const H245_RequestModeReject * pdu /// Received PDU, if NULL is a timeout ); //@} /**@name Member variable access */ //@{ /**Get the owner endpoint for this connection. */ H323EndPoint & GetEndPoint() const { return endpoint; } /**Get the call direction for this connection. */ BOOL HadAnsweredCall() const { return callAnswered; } /**Get the distinctive ring code for incoming call. This returns an integer from 0 to 7 that may indicate to an application that different ring cadences are to be used. */ unsigned GetDistinctiveRing() const { return distinctiveRing; } /**Set the distinctive ring code for outgoing call. This sets the integer from 0 to 7 that will be used in the outgoing Setup PDU. Note this must be called either immediately after construction or during the OnSendSignalSetup() callback function so the member variable is set befor ethe PDU is sent. */ void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; } /**Get the internal OpenH323 call token for this connection. */ const PString & GetCallToken() const { return callToken; } /**Get the call reference for this connection. */ unsigned GetCallReference() const { return callReference; } /**Get the call identifier for this connection. */ const H323GloballyUniqueID & GetCallIdentifier() const { return callIdentifier; } /**Get the conference identifier for this connection. */ const H323GloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -