This class manages the H323 endpoint.
![]() | Construction |
![]() | Capabilities |
![]() | Gatekeeper management |
![]() | Connection management |
![]() | Logical Channels management |
![]() | Indications |
![]() | Other services |
![]() | Member variable access |
This class manages the H323 endpoint. An endpoint may have zero or more listeners to create incoming connections or zero or more outgoing conenctions initiated via the MakeCall() function. Once a conection exists it is managed by this class instance.The main thing this class embodies is the capabilities of the application, that is the codecs and protocols it is capable of.
An application may create a descendent off this class and overide the CreateConnection() function, if they require a descendent of H323Connection to be created. This would be quite likely in most applications.
~H323EndPoint()
virtual void SetEndpointTypeInfo( H225_EndpointType & info ) const
virtual void SetVendorIdentifierInfo( H225_VendorIdentifier & info ) const
virtual void SetH221NonStandardInfo( H225_H221NonStandard & info ) const
If the specific instnace of the capability is already in the table, it is not added again. Ther can be multiple instances of the same capability class however.
If descriptorNum is P_MAX_INDEX, the the next available index in the
array of descriptors is used. Similarly if simultaneous is P_MAX_INDEX
the the next available SimultaneousCapabilitySet is used. The return
value is the index used for the new entry. Note if both are P_MAX_INDEX
then the return value is the descriptor index as the simultaneous index
must be zero. Note that the capability specified here is automatically added to the
capability table using the AddCapability() function. A specific
instance of a capability is only ever added once, so multiple
SetCapability() calls with the same H323Capability pointer will only
add that capability once.
PINDEX SetCapability( PINDEX descriptorNum, PINDEX simultaneous, H323Capability * cap )
simultaneous - The member of the SimultaneousCapabilitySet to add
cap - New capability specificationPINDEX AddAllCapabilities( PINDEX descriptorNum, PINDEX simultaneous, const PString & name )
simultaneous - The member of the SimultaneousCapabilitySet to add
name - New capabilities name, if using "known" one.void AddAllUserInputCapabilities( PINDEX descriptorNum, PINDEX simultaneous )
simultaneous - The member of the SimultaneousCapabilitySet to addvoid RemoveCapabilities( const PStringArray & codecNames )
void ReorderCapabilities( const PStringArray & preferenceOrder )
H323Capability* FindCapability( const H245_Capability & cap ) const
H323Capability* FindCapability( const H245_DataType & dataType ) const
H323Capability* FindCapability( H323Capability::MainTypes mainType, unsigned subType ) const
subType - Subtype of codec
Note the transport being passed in will be deleted by this function or the H323Gatekeeper object it becomes associated with. Also if transport is NULL then a H323TransportUDP is created.
The gatekeeper identifier is set to the spplied parameter to allow the
gatekeeper to either allocate a zone or sub-zone, or refuse to register
if the zones do not match. Note the transport being passed in will be deleted by this function or
the H323Gatekeeper object it becomes associated with. Also if transport
is NULL then a H323TransportUDP is created.
Note the transport being passed in will be deleted becomes owned by the
H323Gatekeeper created by this function and will be deleted by it. Also
if transport is NULL then a H323TransportUDP is created.
Note the transport being passed in will be deleted becomes owned by the
H323Gatekeeper created by this function and will be deleted by it. Also
if transport is NULL then a H323TransportUDP is created.
The default creates an instance of the H323Gatekeeper class.
BOOL SetGatekeeperZone( const PString & address, const PString & identifier, H323Transport * transport = NULL )
identifier - Identifier of gatekeeper to use.
transport - Transport over which to talk to gatekeeper.BOOL LocateGatekeeper( const PString & identifier, H323Transport * transport = NULL )
transport - Transport over which to talk to gatekeeper.BOOL DiscoverGatekeeper( H323Transport * transport = NULL )
virtual H323Gatekeeper* CreateGatekeeper( H323Transport * transport )
H323Gatekeeper* GetGatekeeper() const
BOOL RemoveGatekeeper( int reason = -1 )
void SetGatekeeperPassword( const PString & password )
This function returns almost immediately with the call occurring in a
new background thread. Note, the returned pointer to the connection is not locked and may be
deleted at any time. This is extremely unlikely immediately after the
function is called, but you should not keep this pointer beyond that
brief time. The the FindConnectionWithLock() function for future
references to the connection object.
If the transport parameter is NULL the transport is determined from the
remoteParty description. This function returns almost immediately with the call occurring in a
new background thread. Note, the returned pointer to the connection is not locked and may be
deleted at any time. This is extremely unlikely immediately after the
function is called, but you should not keep this pointer beyond that
brief time. The the FindConnectionWithLock() function for future
references to the connection object.
If the transport parameter is NULL the transport is determined from the
remoteParty description. The general form for this parameter is
[alias@][transport$]host[:port] where the default alias is the same as
the host, the default transport is "ip" and the default port is 1720. This function returns almost immediately with the transfer occurring in a
new background thread. Note, the returned pointer to the connection is not locked and may be
deleted at any time. This is extremely unlikely immediately after the
function is called, but you should not keep this pointer beyond that
brief time. The the FindConnectionWithLock() function for future
references to the connection object. This function is declared virtual to allow an application to override
the function and get the new call token of the forwarded call.
Note the caller of this function MUSt call the H323Connection::Unlock()
function if this function returns a non-NULL pointer. If it does not
then a deadlock can occur.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent. The default behaviour simply returns TRUE.
It also gives an application time to wait for some event before
signalling to the endpoint that the connection is to proceed. For
example the user pressing an Änswer call" button. If AnswerCallDenied is returned the connection is aborted and a Release
Complete PDU is sent. If AnswerCallNow is returned then the H.323
protocol proceeds. Finally if AnswerCallPending is returned then the
protocol negotiations are paused until the AnsweringCall() function is
called. The default behaviour simply returns AnswerNow.
If FALSE is returned the connection is aborted and a Release Complete
PDU is sent. The default behaviour simply returns TRUE.
The default behaviour simply returns FALSE.
The default behaviour does nothing.
The default behaviour does nothing.
This would not normally be called by an application.
BOOL StartListener( const H323TransportAddress & iface )
BOOL RemoveListener( H323Listener * listener )
H323Connection* MakeCall( const PString & remoteParty, PString & token, void * userData = NULL )
token - String to receive token for connection
userData - user data to pass to CreateConnectionH323Connection* MakeCall( const PString & remoteParty, H323Transport * transport, PString & token, void * userData = NULL )
transport - Transport to use for call.
token - String to receive token for connection
userData - user data to pass to CreateConnectionvirtual H323Connection* SetupTransfer( const PString & token, const PString & callIdentity, const PString & remoteParty, PString & newToken )
callIdentity - Call identity of the secondary call (if it exists)
remoteParty - Remote party to transfer the existing call to
newToken - String to receive token for the new connectionvoid TransferCall( const PString & token, const PString & remoteParty )
remoteParty - Remote party to transfer the existing call tovoid HoldCall( const PString & token, BOOL localHold )
localHold - true for Local Hold, false for Remote Holdvoid ParsePartyName( const PString & party, PString & alias, H323TransportAddress & address ) const
alias - Parsed alias name
address - Parsed transport addressvirtual BOOL ClearCall( const PString & token, H323Connection::CallEndReason reason = H323Connection::EndedByLocalUser )
reason - Reason for call clearingvirtual BOOL ClearCallSynchronous(const PString & token, H323Connection::CallEndReason reason = H323Connection::EndedByLocalUser )
reason - Reason for call clearingvirtual void ClearAllCalls( H323Connection::CallEndReason reason = H323Connection::EndedByLocalUser, BOOL wait = TRUE )
wait - Flag for wait for calls to e cleared.virtual BOOL HasConnection( const PString & token )
H323Connection* FindConnectionWithLock( const PString & token )
virtual BOOL OnIncomingCall( H323Connection & connection, const H323SignalPDU & setupPDU, H323SignalPDU & alertingPDU )
setupPDU - Received setup PDU
alertingPDU - Alerting PDU to sendBOOL OnCallTransferInitiate( H323Connection & connection, const PString & remoteParty )
remoteParty - Party transferring to.virtual H323Connection::AnswerCallResponse OnAnswerCall( H323Connection & connection, const PString & callerName, const H323SignalPDU & setupPDU, H323SignalPDU & connectPDU )
callerName - Name of caller
setupPDU - Received setup PDU
connectPDU - Connect PDU to send. virtual BOOL OnAlerting( H323Connection & connection, const H323SignalPDU & alertingPDU, const PString & user )
alertingPDU - Received Alerting PDU
user - Username of remote endpointvirtual BOOL OnConnectionForwarded( H323Connection & connection, const PString & forwardParty, const H323SignalPDU & pdu )
forwardParty - Remote party to forward to
pdu - Full PDU initiating forwardingvirtual void OnConnectionEstablished( H323Connection & connection, const PString & token )
token - Token for identifying connectionvirtual BOOL IsConnectionEstablished( const PString & token )
virtual void OnConnectionCleared( H323Connection & connection, const PString & token )
token - Token for identifying connectionstatic PString BuildConnectionToken( const H323Transport & transport, unsigned callReference, BOOL fromRemote )
callReference - Call reference of Q.931 link
fromRemote - Call reference is from remote endpointH323Connection* OnIncomingConnection( H323Transport * transport, H323SignalPDU & setupPDU )
setupPDU - Setup PDUvirtual H323Connection* CreateConnection( unsigned callReference, void * userData, H323Transport * transport, H323SignalPDU * setupPDU )
userData - user data to pass to CreateConnection
transport - Transport for connection
setupPDU - Setup PDU, NULL if outgoing callvoid CleanUpConnections()
The default behaviour simply returns TRUE.
The default behaviour does nothing.
The default function creates a PSoundChannel using the member variables
soundChannelPlayDevice or soundChannelRecordDevice.
The default function creates a PVideoChannel using the member variables.
The default behaviour does nothing.
virtual void OnClosedLogicalChannel( H323Connection & connection, const H323Channel & channel )
channel - Channel being startedvirtual BOOL OpenAudioChannel( H323Connection & connection, BOOL isEncoding, unsigned bufferSize, H323AudioCodec & codec )
isEncoding - Direction of data flow
bufferSize - Size of each sound buffer
codec - codec that is doing the openingvirtual BOOL OpenVideoChannel( H323Connection & connection, BOOL isEncoding, H323VideoCodec & codec )
isEncoding - Direction of data flow
codec - codec doing the openingvirtual void OnRTPStatistics( const H323Connection & connection, const RTP_Session & session ) const
session - Session with statistics
The default behaviour does nothing.
The default behaviour calls H323Connection::OnUserInputTone().
virtual void OnUserInputTone( H323Connection & connection, char tone, unsigned duration, unsigned logicalChannel, unsigned rtpTimestamp )
tone - DTMF tone code
duration - Duration of tone in milliseconds
logicalChannel - Logical channel number for RTP sync.
rtpTimestamp - RTP timestamp in logical channel sync.
The default behavour returns NULL.
The default behavour returns NULL.
virtual OpalT38Protocol* CreateT38ProtocolHandler() const
Note that this name is technically the first alias for the endpoint. Additional aliases may be added by the use of the AddAliasName() function, however that list will be cleared when this function is used.
The list defaults to the value set in the SetLocalUserName() function.
Note that calling SetLocalUserName() will clear the alias list.
This defaults to the value of the PSoundChannel::GetDefaultDevice()
function.
This defaults to the value of the PSoundChannel::GetDefaultDevice()
function.
const PString& GetLocalUserName() const
BOOL AddAliasName( const PString & name )
BOOL RemoveAliasName( const PString & name )
const PStringList& GetAliasNames() const
virtual BOOL SetSoundChannelPlayDevice(const PString & name)
const PString& GetSoundChannelPlayDevice() const
virtual BOOL SetSoundChannelRecordDevice(const PString & name)
const PString& GetSoundChannelRecordDevice() const
unsigned GetSoundChannelBufferDepth() const
void SetSoundChannelBufferDepth( unsigned depth )
BOOL CanAutoStartReceiveVideo() const
BOOL CanAutoStartTransmitVideo() const
const H323ListenerList& GetListeners() const
const H323Capabilities& GetCapabilities() const
enum TerminalTypes
TerminalTypes GetTerminalType() const
BOOL IsTerminal() const
BOOL IsGateway() const
BOOL IsGatekeeper() const
BOOL IsMCU() const
WORD GetMaxAudioDelayJitter() const
void SetMaxAudioDelayJitter(unsigned jitter)
unsigned GetInitialBandwidth() const
void SetInitialBandwidth(unsigned bandwidth)
WORD GetTCPPortBase() const
WORD GetTCPPortMax() const
virtual void TranslateTCPAddress(PIPSocket::Address & , const PIPSocket::Address & )
WORD GetRtpIpPortBase() const
WORD GetRtpIpPortMax() const
BYTE GetRtpIpTypeofService() const
void SetRtpIpTypeofService(unsigned tos)
PTimeInterval GetSignallingChannelCallTimeout() const
PTimeInterval GetMasterSlaveDeterminationTimeout() const
unsigned GetMasterSlaveDeterminationRetries() const
PTimeInterval GetCapabilityExchangeTimeout() const
PTimeInterval GetLogicalChannelTimeout() const
PTimeInterval GetRequestModeTimeout() const
PTimeInterval GetRoundTripDelayTimeout() const
PTimeInterval GetRoundTripDelayRate() const
BOOL ShouldClearCallOnRoundTripFail() const
PTimeInterval GetGatekeeperRequestTimeout() const
unsigned GetGatekeeperRequestRetries() const
PTimeInterval GetRasRequestTimeout() const
unsigned GetRasRequestRetries() const
PTimeInterval GetGatekeeperTimeToLive() const
PINDEX GetCleanerThreadStackSize() const
PINDEX GetListenerThreadStackSize() const
PINDEX GetSignallingThreadStackSize() const
PINDEX GetControlThreadStackSize() const
PINDEX GetChannelThreadStackSize() const
PINDEX GetRasThreadStackSize() const
PINDEX GetJitterThreadStackSize() const
Alphabetic index HTML hierarchy of classes or Java