void AttachSignalChannel( const PString & token, H323Transport* channel, BOOL answeringCall )
- Attach a transport to this connection as the signalling channel.
- Parameters:
- token - New token to use to identify connection
channel - Transport for the PDU's
answeringCall - Flag for if incoming/outgoing call.
BOOL WriteSignalPDU( H323SignalPDU & pdu )
- Write a PDU to the signalling channel.
- Parameters:
- pdu - PDU to write.
virtual void HandleSignallingChannel()
- Handle reading PDU's from the signalling channel.
This is an internal function and is unlikely to be used by applications.
virtual BOOL HandleSignalPDU( H323SignalPDU & pdu )
- Handle PDU from the signalling channel.
This is an internal function and is unlikely to be used by applications.
- Parameters:
- pdu - PDU to handle.
virtual void HandleTunnelPDU( H323SignalPDU* txPDU )
- Handle Control PDU tunnelled in the signalling channel.
This is an internal function and is unlikely to be used by applications.
- Parameters:
- txPDU - PDU tunnel response into.
virtual BOOL OnReceivedSignalSetup( const H323SignalPDU & pdu )
- Handle an incoming Q931 setup PDU.
The default behaviour is to do the handshaking operation calling a few
virtuals at certain moments in the sequence.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
- Parameters:
- pdu - Received setup PDU
virtual BOOL OnReceivedSignalSetupAck( const H323SignalPDU & pdu )
- Handle an incoming Q931 setup acknowledge PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour does nothing.
- Parameters:
- pdu - Received setup PDU
virtual BOOL OnReceivedSignalInformation( const H323SignalPDU & pdu )
- Handle an incoming Q931 information PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour does nothing.
- Parameters:
- pdu - Received setup PDU
virtual BOOL OnReceivedCallProceeding( const H323SignalPDU & pdu )
- Handle an incoming Q931 call proceeding PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour checks for hH245Address field and if present
starts the separate H245 channel, if successful or not present it
returns TRUE.
- Parameters:
- pdu - Received call proceeding PDU
virtual BOOL OnReceivedProgress( const H323SignalPDU & pdu )
- Handle an incoming Q931 progress PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour checks for hH245Address field and if present
starts the separate H245 channel, if successful or not present it
returns TRUE.
- Parameters:
- pdu - Received call proceeding PDU
virtual BOOL OnReceivedAlerting( const H323SignalPDU & pdu )
- Handle an incoming Q931 alerting PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour obtains the display name and calls OnAlerting().
- Parameters:
- pdu - Received connect PDU
virtual BOOL OnReceivedSignalConnect( const H323SignalPDU & pdu )
- Handle an incoming Q931 connect PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour checks for hH245Address field and if present
starts the separate H245 channel, if successful it returns TRUE.
If not present and there is no H245Tunneling then it returns FALSE.
- Parameters:
- pdu - Received connect PDU
virtual BOOL OnReceivedFacility( const H323SignalPDU & pdu )
- Handle an incoming Q931 facility PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour checks for hH245Address field and if present
starts the separate H245 channel, if successful or not present it
returns TRUE.
- Parameters:
- pdu - Received connect PDU
virtual BOOL OnReceivedSignalNotify( const H323SignalPDU & pdu )
- Handle an incoming Q931 Notify PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour simply returns TRUE.
- Parameters:
- pdu - Received connect PDU
virtual BOOL OnReceivedSignalStatus( const H323SignalPDU & pdu )
- Handle an incoming Q931 Status PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour simply returns TRUE.
- Parameters:
- pdu - Received connect PDU
virtual BOOL OnReceivedStatusEnquiry( const H323SignalPDU & pdu )
- Handle an incoming Q931 Status Enquiry PDU.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour sends a Q931 Status PDU back.
- Parameters:
- pdu - Received connect PDU
virtual void OnReceivedReleaseComplete( const H323SignalPDU & pdu )
- Handle an incoming Q931 Release Complete PDU.
The default behaviour calls Clear() using reason code based on the
Release Complete Cause field and the current connection state.
- Parameters:
- pdu - Received connect PDU
virtual BOOL OnUnknownSignalPDU( const H323SignalPDU & pdu )
- This function is called from the HandleSignallingChannel() function
for unhandled PDU types.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent. The default behaviour returns TRUE.
- Parameters:
- pdu - Received PDU
virtual BOOL OnIncomingCall( const H323SignalPDU & setupPDU, H323SignalPDU & alertingPDU )
- Call back for incoming call.
This function is called from the OnReceivedSignalSetup() function
before it sends the Alerting PDU. It gives an opportunity for an
application to alter the reply before transmission to the other
endpoint.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour calls the endpoint function of the same name.
- Parameters:
- setupPDU - Received setup PDU
alertingPDU - Alerting PDU to send
virtual BOOL ForwardCall( const PString & forwardParty )
- Forward incoming call to specified address.
This would typically be called from within the OnIncomingCall()
function when an application wishes to redirct an unwanted incoming
call.
The return value is TRUE if the call is to be forwarded, FALSE
otherwise. Note that if the call is forwarded the current connection is
cleared with the ended call code of EndedByCallForwarded.
- Parameters:
- forwardParty - Party to forward call to.
void TransferCall( const PString & remoteParty, const PString & callIdentity = PString::Empty() )
- Initiate the transfer of an existing call (connection) to a new remote party
using H4502. This sends a Call Transfer Initiate Invoke message from the
A-Party (transferring endpoint) to the B-Party (transferred endpoint).
- Parameters:
- remoteParty - Remote party to transfer the existing call to
callIdentity - Call Identity of secondary call if present
void ConsultationTransfer( const PString & primaryCallToken )
- Transfer the call through consultation so the remote party in the primary call is connected to
the called party in the second call using H4502. This sends a Call Transfer Identify Invoke
message from the A-Party (transferring endpoint) to the C-Party (transferred-to endpoint).
- Parameters:
- primaryCallToken - Primary call
virtual void HandleConsultationTransfer( const PString & callIdentity, H323Connection & incoming )
- Handle the reception of a callTransferSetupInvoke APDU whilst a secondary call exists. This
method checks whether the secondary call is still waiting for a callTransferSetupInvoke APDU and
proceeds to clear the call if the call identies match.
This is an internal function and it is not expected the user will call
it directly.
- Parameters:
- callIdentity - Call Identity of secondary call
received in SETUP Message.
incoming - Connection upon which SETUP PDU was received.
BOOL IsTransferringCall() const
- Determine whether this connection is being transferred
BOOL IsTransferredCall() const
- Determine whether this connection is the result of a transferred call
virtual void HandleTransferCall( const PString & token, const PString & identity )
- Handle the transfer of an existing connection to a new remote.
This is an internal function and it is not expected the user will call
it directly.
int GetCallTransferInvokeId()
- Get transfer invoke ID dureing trasfer.
This is an internal function and it is not expected the user will call
it directly.
virtual void HandleCallTransferFailure( const int returnError )
- Handle the failure of a call transfer operation at the Transferred Endpoint. This method is
used to handle the following transfer failure cases that can occur at the Transferred Endpoint.
The cases are:
Reception of an Admission Reject
Reception of a callTransferSetup return error APDU.
Expiry of Call Transfer timer CT-T4.
- Parameters:
- returnError - Failure reason code
void SetAssociatedCallToken( const PString & token )
- Store the passed token on the current connection's H4502Handler.
This is an internal function and it is not expected the user will call
it directly.
- Parameters:
- token - Associated token
virtual void OnConsultationTransferSuccess( H323Connection & secondaryCall )
- Callback to indicate a successful transfer through consultation. The paramter passed is a
reference to the existing connection between the Transferring endpoint and Transferred-to
endpoint.
- Parameters:
- secondaryCall - Secondary call for consultation
void HoldCall( BOOL localHold )
- Place the call on hold, suspending all media channels (H4504). Note it is the responsibility
of the application layer to delete the MOH Channel if music on hold is provided to the remote
endpoint. So far only Local Hold has been implemented.
- Parameters:
- localHold - true for Local Hold, false for Remote Hold
void RetrieveCall()
- Retrieve the call from hold, activating all media channels (H4504).
This method examines the call hold state and performs the necessary
actions required to retrieve a Near-end or Remote-end call on hold.
NOTE: Only Local Hold is implemented so far.
void SetHoldMedia( PChannel* audioChannel )
- Set the alternative media channel. This channel can be used to provide
Media On Hold (MOH) for a near end call hold operation or to provide
Recorded Voice Anouncements (RVAs). If this method is not called before
a call hold operation is attempted, no media on hold will be provided
for the held endpoint.
BOOL IsMediaOnHold() const
- Determine if Meadia On Hold is enabled
BOOL IsLocalHold() const
- Determine if held
BOOL IsRemoteHold() const
- Determine if held
BOOL IsCallOnHold() const
- Determine if the current call is held or in the process of being held
virtual void IntrudeCall( unsigned capabilityLevel )
- Begin a call intrusion request.
Calls h45011handler->IntrudeCall where SS pdu is added to Call Setup
message.
virtual void HandleIntrudeCall( const PString & token, const PString & identity )
- Handle an incoming call instrusion request.
Calls h45011handler->AwaitSetupResponse where we set Handler state to
CI-Wait-Ack
void SetCallIntrusion()
- Set flag indicating call intrusion.
Used to set a flag when intrusion occurs and to determine if
connection is created for Call Intrusion. This flag is used when we
should decide whether to Answer the call or to Close it.
unsigned GetLocalCallIntrusionProtectionLevel()
- Get Call Intrusion Protection Level of the local endpoint
virtual BOOL GetRemoteCallIntrusionProtectionLevel( const PString & callToken, unsigned callIntrusionProtectionLevel )
- Get Call Intrusion Protection Level of other endpoints that we are in
connection with
void SendCallWaitingIndication( const unsigned nbOfAddWaitingCalls = 0 )
- Send a Call Waiting indication message to the remote endpoint using
H4506. The second paramter is used to indicate to the calling user
how many additional users are "camped on" the called user. A value of
zero indicates to the calling user that he/she is the only user
attempting to reach the busy called user.
- Parameters:
- nbOfAddWaitingCalls - number of additional waiting calls at the served user
virtual AnswerCallResponse OnAnswerCall( const PString & callerName, const H323SignalPDU & setupPDU, H323SignalPDU & connectPDU )
- Call back for answering an incoming call.
This function is used for an application to control the answering of
incoming calls. It is usually used to indicate the immediate action to
be taken in answering the call.
It is called from the OnReceivedSignalSetup() function before it sends
the Alerting or Connect PDUs. It also gives an opportunity for an
application to alter the Connect PDU reply before transmission to the
remote endpoint.
If AnswerCallNow is returned then the H.323 protocol proceeds with the
connection. If AnswerCallDenied is returned the connection is aborted
and a Release Complete PDU is sent. If AnswerCallPending is returned
then the Alerting PDU is sent and the protocol negotiations are paused
until the AnsweringCall() function is called. Finally, if
AnswerCallDeferred is returned then no Alerting PDU is sent, but the
system still waits as in the AnswerCallPending response.
Note this function should not block for any length of time. If the
decision to answer the call may take some time eg waiting for a user to
pick up the phone, then AnswerCallPending or AnswerCallDeferred should
be returned.
The default behaviour calls the endpoint function of the same name
which in turn will return AnswerCallNow.
- Parameters:
- callerName - Name of caller
setupPDU - Received setup PDU
connectPDU - Connect PDU to send.
void AnsweringCall( AnswerCallResponse response )
- Indicate the result of answering an incoming call.
This should only be called if the OnAnswerCall() callback function has
returned a AnswerCallPending or AnswerCallDeferred response.
Note sending further AnswerCallPending responses via this function will
have the result of an Alerting PDU being sent to the remote endpoint.
In this way multiple Alerting PDUs may be sent.
Sending a AnswerCallDeferred response would have no effect.
- Parameters:
- response - Answer response to incoming call
virtual CallEndReason SendSignalSetup( const PString & alias, const H323TransportAddress & address )
- Send first PDU in signalling channel.
This function does the signalling handshaking for establishing a
connection to a remote endpoint. The transport (TCP/IP) for the
signalling channel is assumed to be already created. This function
will then do the SetRemoteAddress() and Connect() calls o establish
the transport.
Returns the error code for the call failure reason or NumCallEndReasons
if the call was successful to that point in the protocol.
- Parameters:
- alias - Name of remote party
address - Address of destination
virtual BOOL OnSendSignalSetup( H323SignalPDU & setupPDU )
- Adjust setup PDU being sent on initialisation of signal channel.
This function is called from the SendSignalSetup() function before it
sends the Setup PDU. It gives an opportunity for an application to
alter the request before transmission to the other endpoint.
The default behaviour simply returns TRUE. Note that this is usually
overridden by the transport dependent descendent class, eg the
H323ConnectionTCP descendent fills in the destCallSignalAddress field
with the TCP/IP data. Therefore if you override this in your
application make sure you call the ancestor function.
- Parameters:
- setupPDU - Setup PDU to send
virtual BOOL OnSendCallProceeding( H323SignalPDU & callProceedingPDU )
- Adjust call proceeding PDU being sent. This function is called from
the OnReceivedSignalSetup() function before it sends the Call
Proceeding PDU. It gives an opportunity for an application to alter
the request before transmission to the other endpoint. If this function
returns FALSE then the Call Proceeding PDU is not sent at all.
The default behaviour simply returns TRUE.
- Parameters:
- callProceedingPDU - Call Proceeding PDU to send
virtual BOOL OnSendReleaseComplete( H323SignalPDU & releaseCompletePDU )
- Call back for Release Complete being sent.
This allows an application to add things to the release complete before
it is sent to the remote endpoint.
Returning FALSE will prevent the release complete from being sent. Note
that this would be very unusual as this is called when the connection
is being cleaned up. There will be no second chance to send the PDU and
it must be sent.
The default behaviour simply returns TRUE.
- Parameters:
- releaseCompletePDU - Release Complete PDU to send
virtual BOOL OnAlerting( const H323SignalPDU & alertingPDU, const PString & user )
- Call back for remote party being alerted.
This function is called from the SendSignalSetup() function after it
receives the optional Alerting PDU from the remote endpoint. That is
when the remote "phone" is "ringing".
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour calls the endpoint function of the same name.
- Parameters:
- alertingPDU - Received Alerting PDU
user - Username of remote endpoint
virtual BOOL OnInsufficientDigits()
- This function is called when insufficient digits have been entered.
This supports overlapped dialling so that a call can begin when it is
not known how many more digits are to be entered in a phone number.
It is expected that the application will override this function. It
should be noted that the application should not block in the function
but only indicate to whatever other thread is gathering digits that
more are required and that thread should call SendMoreDigits().
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour simply returns FALSE.
virtual void SendMoreDigits( const PString & digits )
- This function is called when sufficient digits have been entered.
This supports overlapped dialling so that a call can begin when it is
not known how many more digits are to be entered in a phone number.
The digits parameter is appended to the existing remoteNumber member
variable and the call is retried.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour simply returns TRUE.
- Parameters:
- digits - Extra digits
virtual BOOL OnOutgoingCall( const H323SignalPDU & connectPDU )
- This function is called from the SendSignalSetup() function after it
receives the Connect PDU from the remote endpoint, but before it
attempts to open the control channel.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour simply returns TRUE.
- Parameters:
- connectPDU - Received Connect PDU
virtual BOOL SendFastStartAcknowledge( H225_ArrayOf_PASN_OctetString & array )
- Send an the acknowldege of a fast start.
This function is called when the fast start channels provided to this
connection by the original SETUP PDU have been selected and opened and
need to be sent back to the remote endpoint.
If FALSE is returned then no fast start has been acknowledged, possibly
due to no common codec in fast start request.
The default behaviour uses OnSelectLogicalChannels() to find a pair of
channels and adds then to the provided PDU.
- Parameters:
- array - Array of H245_OpenLogicalChannel
virtual BOOL HandleFastStartAcknowledge( const H225_ArrayOf_PASN_OctetString & array )
- Handle the acknowldege of a fast start.
This function is called from one of a number of functions after it
receives a PDU from the remote endpoint that has a fastStart field. It
is in response to a request for a fast strart from the local endpoint.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour parses the provided array and starts the channels
acknowledged in it.
- Parameters:
- array - Array of H245_OpenLogicalChannel
virtual BOOL StartControlChannel()
- Start a separate H245 channel.
This function is called from one of a number of functions when it needs
to create the h245 channel for the remote endpoint to connect back to.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
virtual BOOL StartControlChannel( const H225_TransportAddress & h245Address )
- Start a separate H245 channel.
This function is called from one of a number of functions after it
receives a PDU from the remote endpoint that has a h245Address field.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent.
The default behaviour checks to see if it is a known transport and
creates a corresponding H323Transport decendent for the control
channel.
- Parameters:
- h245Address - H245 address
virtual void OnSelectLogicalChannels()
- Call back to select logical channels to start.
This function must be defined by the descendent class. It is used
to select the logical channels to be opened between the two endpoints.
There are three ways in which this may be called: when a "fast start"
has been initiated by the local endpoint (via SendSignalSetup()
function), when a "fast start" has been requested from the remote
endpoint (via the OnReceivedSignalSetup() function) or when the H245
capability set (and master/slave) negotiations have completed (via the
OnControlChannelOpen() function.
The function would typically examine several member variable to decide
which mode it is being called in and what to do. If fastStartState is
FastStartDisabled then non-fast start semantics should be used. The
H245 capabilities in the remoteCapabilities members should be
examined, and appropriate transmit channels started using
OpenLogicalChannel().
If fastStartState is FastStartInitiate, then the local endpoint has
initiated a call and is asking the application if fast start semantics
are to be used. If so it is expected that the function call
OpenLogicalChannel() for all the channels that it wishes to be able to
be use. A subset (possibly none!) of these would actually be started
when the remote endpoint replies.
If fastStartState is FastStartResponse, then this indicates the remote
endpoint is attempting a fast start. The fastStartChannels member
contains a list of possible channels from the remote that the local
endpoint is to select which to accept. For each accepted channel it
simply necessary to call the Start() function on that channel eg
fastStartChannels[0].Start();
The default behaviour selects the first codec of each session number
that is available. This is according to the order of the capabilities
in the remoteCapabilities, the local capability table or of the
fastStartChannels list respectively for each of the above scenarios.
virtual void SelectDefaultLogicalChannel( unsigned sessionID )
- Select default logical channel for normal start.
- Parameters:
- sessionID - Session ID to find default logical channel.
virtual void SelectFastStartChannels( unsigned sessionID, BOOL transmitter, BOOL receiver )
- Select default logical channel for fast start.
Internal function, not for normal use.
- Parameters:
- sessionID - Session ID to find default logical channel.
transmitter - Whether to open transmitters
receiver - Whether to open receivers
virtual BOOL OpenLogicalChannel( const H323Capability & capability, unsigned sessionID, H323Channel::Directions dir )
- Open a new logical channel.
This function will open a channel between the endpoints for the
specified capability.
If this function is called while there is not yet a conenction
established, eg from the OnFastStartLogicalChannels() function, then
a "trial" receiver/transmitter channel is created. This channel is not
started until the remote enpoint has confirmed that they are to start.
Any channels not confirmed are deleted.
If this function is called later in the call sequence, eg from
OnSelectLogicalChannels(), then it may only establish a transmit
channel, ie fromRemote must be FALSE.
- Parameters:
- capability - Capability to open channel with
sessionID - Session for the channel
dir - Direction of channel
virtual BOOL OnOpenLogicalChannel( const H245_OpenLogicalChannel & openPDU, H245_OpenLogicalChannelAck & ackPDU, unsigned & errorCode )
- This function is called when the remote endpoint want's to open
a new channel.
If the return value is FALSE then the open is rejected using the
errorCode as the cause, this would be a value from the enum
H245_OpenLogicalChannelReject_cause::Choices.
The default behaviour simply returns TRUE.
- Parameters:
- openPDU - Received PDU for the channel open
ackPDU - PDU to send for acknowledgement
errorCode - Error to return if refused
virtual BOOL OnConflictingLogicalChannel( H323Channel & channel )
- Callback for when a logical channel conflict has occurred.
This is called when the remote endpoint, which is a master, rejects
our transmitter channel due to a resource conflict. Typically an
inability to do asymmetric codecs. The local (slave) endpoint must then
try and open a new transmitter channel using the same codec as the
receiver that is being opened.
- Parameters:
- channel - Channel that conflicted
virtual H323Channel* CreateLogicalChannel( const H245_OpenLogicalChannel & open, BOOL startingFast, unsigned & errorCode )
- Create a new logical channel object.
This is in response to a request from the remote endpoint to open a
logical channel.
- Parameters:
- open - Parameters for opening channel
startingFast - Flag for fast/slow starting.
errorCode - Reason for create failure
virtual H323Channel* CreateRealTimeLogicalChannel( const H323Capability & capability, H323Channel::Directions dir, unsigned sessionID, const H245_H2250LogicalChannelParameters* param )
- Create a new real time logical channel object.
This creates a logical channel for handling RTP data. It is primarily
used to allow an application to redirect the RTP media streams to other
hosts to the local one. In that case it would create an instance of
the H323_ExternalRTPChannel class with the appropriate address. eg:
H323Channel * MyConnection::CreateRealTimeLogicalChannel(
const H323Capability & capability,
H323Channel::Directions dir,
unsigned sessionID,
const H245_H2250LogicalChannelParameters * param)
{
return new H323_ExternalRTPChannel(*this, capability, dir, sessionID,
externalIpAddress, externalPort);
}
An application would typically also override the OnStartLogicalChannel()
function to obtain from the H323_ExternalRTPChannel instance the address
of the remote endpoints media server RTP addresses to complete the
setting up of the external RTP stack. eg:
BOOL OnStartLogicalChannel(H323Channel & channel)
{
H323_ExternalRTPChannel & external = (H323_ExternalRTPChannel &)channel;
external.GetRemoteAddress(remoteIpAddress, remotePort);
}
Note that the port in the above example is always the data port, the
control port is assumed to be data+1.
The default behaviour assures there is an RTP session for the session ID,
and if not creates one, then creates a H323_RTPChannel which will do RTP
media to the local host.
- Parameters:
- capability - Capability creating channel
dir - Direction of channel
sessionID - Session ID for RTP channel
param - Parameters for channel
virtual BOOL OnCreateLogicalChannel( const H323Capability & capability, H323Channel::Directions dir, unsigned & errorCode )
- This function is called when the remote endpoint want's to create
a new channel.
If the return value is FALSE then the open is rejected using the
errorCode as the cause, this would be a value from the enum
H245_OpenLogicalChannelReject_cause::Choices.
The default behaviour checks the capability set for if this capability
is allowed to be opened with other channels that may already be open.
- Parameters:
- capability - Capability for the channel open
dir - Direction of channel
errorCode - Error to return if refused
virtual BOOL OnStartLogicalChannel( H323Channel & channel )
- Call back function when a logical channel thread begins.
The default behaviour does nothing and returns TRUE.
- Parameters:
- channel - Channel that has been started.
virtual BOOL OpenAudioChannel( BOOL isEncoding, unsigned bufferSize, H323AudioCodec & codec )
- 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.
- Parameters:
- isEncoding - Direction of data flow
bufferSize - Size of each sound buffer
codec - codec that is doing the opening
virtual BOOL OpenVideoChannel( BOOL isEncoding, H323VideoCodec & codec )
- 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.
- Parameters:
- isEncoding - Direction of data flow
codec - codec doing the opening
virtual void CloseLogicalChannel( unsigned number, BOOL fromRemote )
- Close a logical channel.
- Parameters:
- number - Channel number to close.
fromRemote - Indicates close request of remote channel
virtual void CloseLogicalChannelNumber( const H323ChannelNumber & number )
- Close a logical channel by number.
- Parameters:
- number - Channel number to close.
virtual void CloseAllLogicalChannels( BOOL fromRemote )
- Close a logical channel.
- Parameters:
- fromRemote - Indicates close request of remote channel
virtual void OnClosedLogicalChannel( const H323Channel & channel )
- This function is called when the remote endpoint has closed down
a logical channel.
The default behaviour does nothing.
- Parameters:
- channel - Channel that was closed
virtual BOOL OnClosingLogicalChannel( H323Channel & channel )
- 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.
- Parameters:
- channel - Channel that is to be closed
virtual void OnLogicalChannelFlowControl( H323Channel* channel, long bitRateRestriction )
- 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.
- Parameters:
- channel - Channel that is to be limited
bitRateRestriction - Limit for channel
virtual void OnLogicalChannelJitter( H323Channel* channel, DWORD jitter, int skippedFrameCount, int additionalBuffer )
- 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.
- Parameters:
- channel - Channel that is to be limited
jitter - Estimated received jitter in microseconds
skippedFrameCount - Frames skipped by decodec
additionalBuffer - Additional size of video decoder buffer
void SendLogicalChannelMiscCommand( H323Channel & channel, unsigned command )
- Send a miscellaneous command on the associated H245 channel.
- Parameters:
- channel - Channel to send command for
command - Command code to send
H323Channel* GetLogicalChannel( unsigned number, BOOL fromRemote ) const
- Get a logical channel.
Locates the specified channel number and returns a pointer to it.
- Parameters:
- number - Channel number to get.
fromRemote - Indicates get a remote channel
H323Channel* FindChannel( unsigned sessionId, BOOL fromRemote ) 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.
- Parameters:
- sessionId - Session ID to search for.
fromRemote - Indicates the direction of RTP data.
void SetSendUserInputMode(SendUserInputModes mode)
- Set the user input indication transmission mode
SendUserInputModes GetSendUserInputMode() const
- Get the user input indication transmission mode
SendUserInputModes GetRealSendUserInputMode() const
- Get the real user input indication transmission mode.
This will return the user input mode that will actually be used for
transmissions. It will be the value of GetSendUserInputMode() provided
the remote endpoint is capable of that mode.
virtual void SendUserInput( const PString & value )
- Send a user input indication to the remote endpoint.
This is for sending arbitrary strings as user indications.
The user indication is sent according to the sendUserInputMode member
variable. If SendUserInputAsString then this uses an H.245 "string"
UserInputIndication pdu sending the entire string in one go. If
SendUserInputAsTone then a separate H.245 "signal" UserInputIndication
pdu is sent for each character. If SendUserInputAsInlineRFC2833 then
the indication is inserted into the outgoing audio stream as an RFC2833
RTP data pdu.
SendUserInputAsSeparateRFC2833 is not yet supported.
- Parameters:
- value - String value of indication
virtual void OnUserInputString( const PString & value )
- Call back for remote endpoint has sent user input.
This will be called irrespective of the source (H.245 string, H.245
signal or RFC2833).
The default behaviour calls the endpoint function of the same name.
- Parameters:
- value - String value of indication
virtual void SendUserInputTone( char tone, unsigned duration = 0, unsigned logicalChannel = 0, unsigned rtpTimestamp = 0 )
- 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.
The user indication is sent according to the sendUserInputMode member
variable. If SendUserInputAsString then this uses an H.245 "string"
UserInputIndication pdu sending the entire string in one go. If
SendUserInputAsTone then a separate H.245 "signal" UserInputIndication
pdu is sent for each character. If SendUserInputAsInlineRFC2833 then
the indication is inserted into the outgoing audio stream as an RFC2833
RTP data pdu.
SendUserInputAsSeparateRFC2833 is not yet supported.
- Parameters:
- tone - DTMF tone code
duration - Duration of tone in milliseconds
logicalChannel - Logical channel number for RTP sync.
rtpTimestamp - RTP timestamp in logical channel sync.
virtual void OnUserInputTone( char tone, unsigned duration, unsigned logicalChannel, unsigned rtpTimestamp )
- Call back for remote enpoint has sent user input.
The default behaviour calls the endpoint function of the same name.
- Parameters:
- tone - DTMF tone code
duration - Duration of tone in milliseconds
logicalChannel - Logical channel number for RTP sync.
rtpTimestamp - RTP timestamp in logical channel sync.
void SendUserInputHookFlash( int duration = 500 )
- Send a user input indication to the remote endpoint.
This sends a Hook Flash emulation user input.
- Parameters:
- duration - Duration of tone in milliseconds
virtual void SendUserInputIndicationQ931( const PString & value )
- Send a user input indication to the remote endpoint.
This is for sending arbitrary strings as user indications.
This always uses a Q.931 Keypad Information Element in a Information
pdu sending the entire string in one go.
- Parameters:
- value - String value of indication
virtual void SendUserInputIndicationString( const PString & value )
- Send a user input indication to the remote endpoint.
This is for sending arbitrary strings as user indications.
This always uses an H.245 "string" UserInputIndication pdu sending the
entire string in one go.
- Parameters:
- value - String value of indication
virtual void SendUserInputIndicationTone( char tone, unsigned duration = 0, unsigned logicalChannel = 0, unsigned rtpTimestamp = 0 )
- Send a user input indication to the remote endpoint.
This sends DTMF emulation user input.This uses an H.245 "signal"
UserInputIndication pdu.
- Parameters:
- tone - DTMF tone code
duration - Duration of tone in milliseconds
logicalChannel - Logical channel number for RTP sync.
rtpTimestamp - RTP timestamp in logical channel sync.
virtual void SendUserInputIndication( const H245_UserInputIndication & pdu )
- 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.
- Parameters:
- pdu - Full user indication PDU
virtual void OnUserInputIndication( const H245_UserInputIndication & pdu )
- 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.
- Parameters:
- pdu - Full user indication PDU