Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OpalConnection Class Reference

#include <connection.h>

Inheritance diagram for OpalConnection:

H323Connection IAX2Connection OpalLineConnection OpalPCSSConnection SIPConnection List of all members.

Basic operations

enum  Phases {
  UninitialisedPhase, SetUpPhase, AlertingPhase, ConnectedPhase,
  EstablishedPhase, ReleasingPhase, ReleasedPhase, NumPhases
}
Phases GetPhase () const
CallEndReason GetCallEndReason () const
virtual void SetCallEndReason (CallEndReason reason)
void ClearCall (CallEndReason reason=EndedByLocalUser)
virtual void ClearCallSynchronous (PSyncPoint *sync, CallEndReason reason=EndedByLocalUser)
unsigned GetQ931Cause () const
void SetQ931Cause (unsigned v)
virtual void TransferConnection (const PString &remoteParty, const PString &callIdentity=PString::Empty())
virtual void HoldConnection ()
virtual void RetrieveConnection ()
virtual BOOL IsConnectionOnHold ()

User input

enum  SendUserInputModes {
  SendUserInputAsQ931, SendUserInputAsString, SendUserInputAsTone, SendUserInputAsInlineRFC2833,
  SendUserInputAsSeparateRFC2833, SendUserInputAsProtocolDefault, NumSendUserInputModes
}
virtual void SetSendUserInputMode (SendUserInputModes mode)
virtual SendUserInputModes GetSendUserInputMode () const
virtual SendUserInputModes GetRealSendUserInputMode () const
virtual BOOL SendUserInputString (const PString &value)
virtual BOOL SendUserInputTone (char tone, unsigned duration=0)
virtual void OnUserInputString (const PString &value)
virtual void OnUserInputTone (char tone, unsigned duration)
void SendUserInputHookFlash (unsigned duration=500)
virtual PString GetUserInput (unsigned timeout=30)
virtual void SetUserInput (const PString &input)
virtual PString ReadUserInput (const char *terminators="#\r\n", unsigned lastDigitTimeout=4, unsigned firstDigitTimeout=30)
virtual BOOL PromptUserInput (BOOL play)

Public Types

enum  CallEndReason {
  EndedByLocalUser, EndedByNoAccept, EndedByAnswerDenied, EndedByRemoteUser,
  EndedByRefusal, EndedByNoAnswer, EndedByCallerAbort, EndedByTransportFail,
  EndedByConnectFail, EndedByGatekeeper, EndedByNoUser, EndedByNoBandwidth,
  EndedByCapabilityExchange, EndedByCallForwarded, EndedBySecurityDenial, EndedByLocalBusy,
  EndedByLocalCongestion, EndedByRemoteBusy, EndedByRemoteCongestion, EndedByUnreachable,
  EndedByNoEndPoint, EndedByHostOffline, EndedByTemporaryFailure, EndedByQ931Cause,
  EndedByDurationLimit, EndedByInvalidConferenceID, NumCallEndReasons
}
enum  AnswerCallResponse {
  AnswerCallNow, AnswerCallDenied, AnswerCallPending, AnswerCallDeferred,
  AnswerCallAlertWithMedia, AnswerCallDeferredWithMedia, AnswerCallProgress, NumAnswerCallResponses
}

Public Methods

const RTP_DataFrame::PayloadMapTypeGetRTPPayloadMap () const
PMutex & GetMediaStreamMutex ()
Construction
 OpalConnection (OpalCall &call, OpalEndPoint &endpoint, const PString &token)
 ~OpalConnection ()
Overrides from PObject
void PrintOn (ostream &strm) const
Call progress functions
virtual BOOL OnIncomingConnection ()
virtual BOOL SetUpConnection ()=0
virtual BOOL OnSetUpConnection ()
virtual void OnAlerting ()
virtual BOOL SetAlerting (const PString &calleeName, BOOL withMedia)=0
virtual AnswerCallResponse OnAnswerCall (const PString &callerName)
virtual void AnsweringCall (AnswerCallResponse response)
virtual void OnConnected ()
virtual BOOL SetConnected ()=0
virtual void OnEstablished ()
virtual void Release (CallEndReason reason=EndedByLocalUser)
virtual void OnReleased ()
Additional signalling functions
virtual PString GetDestinationAddress ()
virtual BOOL ForwardCall (const PString &forwardParty)
Media Stream Management
virtual OpalMediaFormatList GetMediaFormats () const=0
virtual void AdjustMediaFormats (OpalMediaFormatList &mediaFormats) const
virtual BOOL OpenSourceMediaStream (const OpalMediaFormatList &mediaFormats, unsigned sessionID)
virtual OpalMediaStreamOpenSinkMediaStream (OpalMediaStream &source)
virtual void StartMediaStreams ()
virtual void CloseMediaStreams ()
virtual void RemoveMediaStreams ()
virtual void PauseMediaStreams (BOOL paused)
virtual OpalMediaStreamCreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, BOOL isSource)
virtual BOOL OnOpenMediaStream (OpalMediaStream &stream)
virtual void OnClosedMediaStream (const OpalMediaStream &stream)
virtual void OnPatchMediaStream (BOOL isSource, OpalMediaPatch &patch)
OpalMediaStreamGetMediaStream (unsigned sessionId, BOOL source) const
virtual BOOL IsMediaBypassPossible (unsigned sessionID) const
virtual BOOL GetMediaInformation (unsigned sessionID, MediaInformation &info) const
virtual void AddVideoMediaFormats (OpalMediaFormatList &mediaFormats) const
virtual BOOL CreateVideoInputDevice (const OpalMediaFormat &mediaFormat, PVideoInputDevice *&device, BOOL &autoDelete)
virtual BOOL CreateVideoOutputDevice (const OpalMediaFormat &mediaFormat, BOOL preview, PVideoOutputDevice *&device, BOOL &autoDelete)
RTP Session Management
virtual RTP_SessionGetSession (unsigned sessionID) const
virtual RTP_SessionUseSession (const OpalTransport &transport, unsigned sessionID, RTP_QOS *rtpqos=NULL)
virtual void ReleaseSession (unsigned sessionID)
virtual RTP_SessionCreateSession (const OpalTransport &transport, unsigned sessionID, RTP_QOS *rtpqos)
Bandwidth Management
unsigned GetBandwidthAvailable () const
virtual BOOL SetBandwidthAvailable (unsigned newBandwidth, BOOL force=FALSE)
virtual unsigned GetBandwidthUsed () const
virtual BOOL SetBandwidthUsed (unsigned releasedBandwidth, unsigned requiredBandwidth)
Other services
virtual OpalT120ProtocolCreateT120ProtocolHandler ()
virtual OpalT38ProtocolCreateT38ProtocolHandler ()
virtual OpalH224HandlerCreateH224ProtocolHandler (unsigned sessionID)
virtual OpalH281HandlerCreateH281ProtocolHandler (OpalH224Handler &h224Handler)
OpalH224HandlerGetH224Handler () const
Member variable access
OpalEndPointGetEndPoint () const
OpalCallGetCall () const
const PString & GetToken () const
BOOL IsOriginating () const
PTime GetSetupUpTime () const
PTime GetAlertingTime () const
PTime GetConnectionStartTime () const
PTime GetConnectionEndTime () const
const PString & GetLocalPartyName () const
virtual void SetLocalPartyName (const PString &name)
const PString & GetDisplayName () const
void SetDisplayName (const PString &name)
const PString & GetRemotePartyName () const
const PString & GetRemoteApplication () const
const PString & GetRemotePartyNumber () const
const PString & GetRemotePartyAddress () const
virtual const PString GetRemotePartyCallbackURL () const
virtual const PString & GetCalledDestinationNumber () const
virtual const PString & GetCalledDestinationName () const
unsigned GetMinAudioJitterDelay () const
unsigned GetMaxAudioJitterDelay () const
void SetAudioJitterDelay (unsigned minDelay, unsigned maxDelay)
OpalSilenceDetectorGetSilenceDetector () const
OpalEchoCancelerGetEchoCanceler () const
virtual const OpalGloballyUniqueIDGetIdentifier () const
virtual OpalTransportGetTransport () const
 PDICTIONARY (MediaAddressesDict, POrdinalKey, OpalTransportAddress)
MediaAddressesDict & GetMediaTransportAddresses ()

Protected Methods

 PDECLARE_NOTIFIER (OpalRFC2833Info, OpalConnection, OnUserInputInlineRFC2833)
 PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnUserInputInBandDTMF)
 PDECLARE_NOTIFIER (PThread, OpalConnection, OnReleaseThreadMain)
void SetPhase (Phases phaseToSet)

Protected Attributes

OpalCallownerCall
OpalEndPointendpoint
Phases phase
PString callToken
OpalGloballyUniqueID callIdentifier
BOOL originating
PTime setupTime
PTime alertingTime
PTime connectedTime
PTime callEndTime
PString localPartyName
PString displayName
PString remotePartyName
PString remoteApplication
PString remotePartyNumber
PString remotePartyAddress
CallEndReason callEndReason
PString calledDestinationNumber
PString calledDestinationName
SendUserInputModes sendUserInputMode
PString userInputString
PMutex userInputMutex
PSyncPoint userInputAvailable
BOOL detectInBandDTMF
unsigned q931Cause
OpalSilenceDetectorsilenceDetector
OpalEchoCancelerechoCanceler
OpalRFC2833Protorfc2833Handler
OpalT120Protocolt120handler
OpalT38Protocolt38handler
OpalH224Handlerh224Handler
MediaAddressesDict mediaTransportAddresses
PMutex mediaStreamMutex
OpalMediaStreamList mediaStreams
RTP_SessionManager rtpSessions
unsigned minAudioJitterDelay
unsigned maxAudioJitterDelay
unsigned bandwidthAvailable
RTP_DataFrame::PayloadMapType rtpPayloadMap
PDTMFDecoder dtmfDecoder

Detailed Description

This is the base class for connections to an endpoint. A particular protocol will have a descendant class from this to implement the specific semantics of that protocols connection.

A connection is part of a call, and will be "owned" by an OpalCall object. It is also attached to the creator endpoint to do any protocol specific management of the connection. However the deletion of the connection is done by a special thread in the OpalManager class. A connnection should never be deleted directly.

The connection is also in charge of creating media streams. It may do this in respose to an explicit call to OpenMediaStream or implicitly due to requests in the underlying protocol.

When media streams are created they must make requests for bandwidth which is managed by the connection.


Member Enumeration Documentation

enum OpalConnection::AnswerCallResponse
 

Enumeration values:
AnswerCallNow 
AnswerCallDenied  Answer the call continuing with the connection.
AnswerCallPending  Refuse the call sending a release complete.
AnswerCallDeferred  Send an Alerting PDU and wait for AnsweringCall().
AnswerCallAlertWithMedia  As for AnswerCallPending but does not send Alerting PDU.
AnswerCallDeferredWithMedia  As for AnswerCallPending but starts media channels.
AnswerCallProgress  As for AnswerCallDeferred but starts media channels.
NumAnswerCallResponses  Answer the call with a h323 progress, or sip 183 session in progress, or ...

enum OpalConnection::CallEndReason
 

Call/Connection ending reasons. NOTE: if anything is added to this, you also need to add the field to the tables in call.cxx and h323pdu.cxx.

Enumeration values:
EndedByLocalUser 
EndedByNoAccept  Local endpoint application cleared call.
EndedByAnswerDenied  Local endpoint did not accept call OnIncomingCall()=FALSE.
EndedByRemoteUser  Local endpoint declined to answer call.
EndedByRefusal  Remote endpoint application cleared call.
EndedByNoAnswer  Remote endpoint refused call.
EndedByCallerAbort  Remote endpoint did not answer in required time.
EndedByTransportFail  Remote endpoint stopped calling.
EndedByConnectFail  Transport error cleared call.
EndedByGatekeeper  Transport connection failed to establish call.
EndedByNoUser  Gatekeeper has cleared call.
EndedByNoBandwidth  Call failed as could not find user (in GK).
EndedByCapabilityExchange  Call failed as could not get enough bandwidth.
EndedByCallForwarded  Could not find common capabilities.
EndedBySecurityDenial  Call was forwarded using FACILITY message.
EndedByLocalBusy  Call failed a security check and was ended.
EndedByLocalCongestion  Local endpoint busy.
EndedByRemoteBusy  Local endpoint congested.
EndedByRemoteCongestion  Remote endpoint busy.
EndedByUnreachable  Remote endpoint congested.
EndedByNoEndPoint  Could not reach the remote party.
EndedByHostOffline  The remote party is not running an endpoint.
EndedByTemporaryFailure  The remote party host off line.
EndedByQ931Cause  The remote failed temporarily app may retry.
EndedByDurationLimit  The remote ended the call with unmapped Q.931 cause code.
EndedByInvalidConferenceID  Call cleared due to an enforced duration limit.
NumCallEndReasons  Call cleared due to invalid conference ID.

enum OpalConnection::Phases
 

Enumeration values:
UninitialisedPhase 
SetUpPhase 
AlertingPhase 
ConnectedPhase 
EstablishedPhase 
ReleasingPhase 
ReleasedPhase 
NumPhases 

enum OpalConnection::SendUserInputModes
 

Enumeration values:
SendUserInputAsQ931 
SendUserInputAsString 
SendUserInputAsTone 
SendUserInputAsInlineRFC2833 
SendUserInputAsSeparateRFC2833 
SendUserInputAsProtocolDefault 
NumSendUserInputModes 


Constructor & Destructor Documentation

OpalConnection::OpalConnection OpalCall   call,
OpalEndPoint   endpoint,
const PString &    token
 

Create a new connection.

Parameters:
call  Owner calll for connection
endpoint  Owner endpoint for connection
token  Token to identify the connection

OpalConnection::~OpalConnection  
 

Destroy connection.


Member Function Documentation

virtual void OpalConnection::AddVideoMediaFormats OpalMediaFormatList   mediaFormats const [virtual]
 

Add video media formats available on a connection.

The default behaviour calls the OpalEndPoint function of the same name.

Parameters:
mediaFormats  Media formats to use

virtual void OpalConnection::AdjustMediaFormats OpalMediaFormatList   mediaFormats const [virtual]
 

Adjust media formats available on a connection. This is called by a connection after it has called OpalCall::GetMediaFormats() to get all media formats that it can use so that an application may remove or reorder the media formats before they are used to open media streams.

The default behaviour calls the OpalEndPoint function of the same name.

Parameters:
mediaFormats  Media formats to use

virtual void OpalConnection::AnsweringCall AnswerCallResponse    response [virtual]
 

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 notification PDUs being sent to the remote endpoint (if possible). In this way multiple notification PDUs may be sent.

Sending a AnswerCallDeferred response would have no effect.

Parameters:
response  Answer response to incoming call

Reimplemented in H323Connection, and SIPConnection.

void OpalConnection::ClearCall CallEndReason    reason = EndedByLocalUser
 

Clear a current call. This hangs up the current call. This will release all connections currently in the call by calling the OpalCall::Clear() function.

Note that this function will return quickly as the release and disposal of the connections is done by another thread.

Parameters:
reason  Reason for call clearing

Reimplemented in IAX2Connection.

virtual void OpalConnection::ClearCallSynchronous PSyncPoint *    sync,
CallEndReason    reason = EndedByLocalUser
[virtual]
 

Clear a current connection, synchronously

Parameters:
reason  Reason for call clearing

virtual void OpalConnection::CloseMediaStreams   [virtual]
 

Close media streams for session.

virtual OpalH224Handler* OpalConnection::CreateH224ProtocolHandler unsigned    sessionID [virtual]
 

Create an instance of the H.224 protocol handler. This is called when the subsystem requires that a H.224 channel be established.

Note that if the application overrides this it should return a pointer to a heap variable (using new) as it will be automatically deleted when the OpalConnection is deleted.

The default behaviour calls the OpalEndpoint function of the same name if there is not already a H.224 handler associated with this connection. If there is already such a H.224 handler associated, this instance is returned instead.

virtual OpalH281Handler* OpalConnection::CreateH281ProtocolHandler OpalH224Handler   h224Handler [virtual]
 

Create an instance of the H.281 protocol handler. This is called when the subsystem requires that a H.224 channel be established.

Note that if the application overrides this it should return a pointer to a heap variable (using new) as it will be automatically deleted when the associated H.224 handler is deleted.

The default behaviour calls the OpalEndpoint function of the same name.

virtual OpalMediaStream* OpalConnection::CreateMediaStream const OpalMediaFormat   mediaFormat,
unsigned    sessionID,
BOOL    isSource
[virtual]
 

Create a new media stream. This will create a media stream of an appropriate subclass as required by the underlying connection protocol. For instance H.323 would create an OpalRTPStream.

The sessionID parameter may not be needed by a particular media stream and may be ignored. In the case of an OpalRTPStream it us used.

Note that media streams may be created internally to the underlying protocol. This function is not the only way a stream can come into existance.

The default behaviour is pure.

Parameters:
mediaFormat  Media format for stream
sessionID  Session number for stream
isSource  Is a source stream

Reimplemented in H323Connection, IAX2Connection, OpalLineConnection, OpalPCSSConnection, and SIPConnection.

virtual RTP_Session* OpalConnection::CreateSession const OpalTransport   transport,
unsigned    sessionID,
RTP_QOS   rtpqos
[virtual]
 

Create and open a new RTP session. The type of RTP session that is created will be compatible with the transport. At this time only IP (RTp over UDP) is supported.

virtual OpalT120Protocol* OpalConnection::CreateT120ProtocolHandler   [virtual]
 

Create an instance of the T.120 protocol handler. This is called when the OpenLogicalChannel subsystem requires that a T.120 channel be established.

Note that if the application overrides this and returns a pointer to a heap variable (using new) then it is the responsibility of the creator to subsequently delete the object. The user of this function (the H323_T120Channel class) will not do so.

The default behavour returns H323Endpoint::CreateT120ProtocolHandler() while keeping track of that variable for autmatic deletion.

virtual OpalT38Protocol* OpalConnection::CreateT38ProtocolHandler   [virtual]
 

Create an instance of the T.38 protocol handler. This is called when the OpenLogicalChannel subsystem requires that a T.38 fax channel be established.

Note that if the application overrides this and returns a pointer to a heap variable (using new) then it is the responsibility of the creator to subsequently delete the object. The user of this function (the H323_T38Channel class) will not do so.

The default behavour returns H323Endpoint::CreateT38ProtocolHandler() while keeping track of that variable for autmatic deletion.

virtual BOOL OpalConnection::CreateVideoInputDevice const OpalMediaFormat   mediaFormat,
PVideoInputDevice *&    device,
BOOL &    autoDelete
[virtual]
 

Create an PVideoInputDevice for a source media stream.

Parameters:
mediaFormat  Media format for stream
device  Created device
autoDelete  Flag for auto delete device

virtual BOOL OpalConnection::CreateVideoOutputDevice const OpalMediaFormat   mediaFormat,
BOOL    preview,
PVideoOutputDevice *&    device,
BOOL &    autoDelete
[virtual]
 

Create an PVideoOutputDevice for a sink media stream or the preview display for a source media stream.

Parameters:
mediaFormat  Media format for stream
preview  Flag indicating is a preview output
device  Created device
autoDelete  Flag for auto delete device

virtual BOOL OpalConnection::ForwardCall const PString &    forwardParty [virtual]
 

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 teh ended call code of EndedByCallForwarded.

Parameters:
forwardParty  Party to forward call to.

Reimplemented in H323Connection, and SIPConnection.

PTime OpalConnection::GetAlertingTime   const [inline]
 

Get the time at which the ALERTING was received

unsigned OpalConnection::GetBandwidthAvailable   const [inline]
 

Get the available bandwidth in 100's of bits/sec.

virtual unsigned OpalConnection::GetBandwidthUsed   [virtual]
 

Get the bandwidth currently used. This totals the bandwidth used by open streams and returns the total bandwidth used in 100's of bits/sec

Reimplemented in H323Connection.

OpalCall& OpalConnection::GetCall   const [inline]
 

Get the owner call for this connection.

virtual const PString& OpalConnection::GetCalledDestinationName   const [inline, virtual]
 

Get the called name (for incoming calls). This is useful for gateway applications where the destination name may not be the same as the local username

virtual const PString& OpalConnection::GetCalledDestinationNumber   const [inline, virtual]
 

Get the called number (for incoming calls). This is useful for gateway applications where the destination number may not be the same as the local number

CallEndReason OpalConnection::GetCallEndReason   const [inline]
 

Get the call clearand reason for this connection shutting down. Note that this function is only generally useful in the H323EndPoint::OnConnectionCleared() function. This is due to the connection not being cleared before that, and the object not even exiting after that.

If the call is still active then this will return NumCallEndReasons.

PTime OpalConnection::GetConnectionEndTime   const [inline]
 

Get the time at which the connection was cleared

PTime OpalConnection::GetConnectionStartTime   const [inline]
 

Get the time at which the connection was established

virtual PString OpalConnection::GetDestinationAddress   [virtual]
 

Get the destination address of an incoming connection. This will, for example, collect a phone number from a POTS line, or get the fields from the H.225 SETUP pdu in a H.323 connection.

The default behaviour returns "*", which by convention means any address the endpoint/connection can get to.

Reimplemented in H323Connection, OpalLineConnection, and OpalPCSSConnection.

const PString& OpalConnection::GetDisplayName   const [inline]
 

Get the local display name.

OpalEchoCanceler* OpalConnection::GetEchoCanceler   const [inline]
 

Get the echo canceler active on connection.

OpalEndPoint& OpalConnection::GetEndPoint   const [inline]
 

Get the owner endpoint for this connection.

Reimplemented in H323Connection, and SIPConnection.

OpalH224Handler* OpalConnection::GetH224Handler   const [inline]
 

Returns the H.224 handler associated with this connection or NULL if no handler was created

virtual const OpalGloballyUniqueID& OpalConnection::GetIdentifier   const [inline, virtual]
 

Get the protocol-specific unique identifier for this connection.

const PString& OpalConnection::GetLocalPartyName   const [inline]
 

Get the local name/alias.

unsigned OpalConnection::GetMaxAudioJitterDelay   const [inline]
 

Get the default maximum audio delay jitter parameter. Defaults to 250ms.

virtual OpalMediaFormatList OpalConnection::GetMediaFormats   [pure virtual]
 

Get the data formats this connection is capable of operating. This provides a list of media data format names that a OpalMediaStream may be created in within this connection.

The default behaviour is pure.

Implemented in H323Connection, IAX2Connection, OpalLineConnection, OpalPCSSConnection, and SIPConnection.

virtual BOOL OpalConnection::GetMediaInformation unsigned    sessionID,
MediaInformation   info
const [virtual]
 

Get information on the media channel for the connection. The default behaviour checked the mediaTransportAddresses dictionary for the session ID and returns information based on that. It also uses the rfc2833Handler variable for that part of the info.

It is up to the descendant class to assure that the mediaTransportAddresses dictionary is set correctly before OnIncomingCall() is executed.

Parameters:
sessionID  Session ID for media channel
info  Information on media channel

Reimplemented in H323Connection.

OpalMediaStream* OpalConnection::GetMediaStream unsigned    sessionId,
BOOL    source
const
 

Get a media stream. Locates a stream given a RTP session ID. Each session would usually have two media streams associated with it, so the source flag may be used to distinguish which channel to return.

Parameters:
sessionId  Session ID to search for.
source  Indicates the direction of stream.

PMutex& OpalConnection::GetMediaStreamMutex   [inline]
 

MediaAddressesDict& OpalConnection::GetMediaTransportAddresses   [inline]
 

unsigned OpalConnection::GetMinAudioJitterDelay   const [inline]
 

Get the default maximum audio jitter delay parameter. Defaults to 50ms

Phases OpalConnection::GetPhase   const [inline]
 

Get the phase of the connection. This indicates the current phase of the connection sequence. Whether all phases and the transitions between phases is protocol dependent.

unsigned OpalConnection::GetQ931Cause   const [inline]
 

Get the Q.931 cause code (Q.850) that terminated this call. See Q931::CauseValues for common values.

virtual SendUserInputModes OpalConnection::GetRealSendUserInputMode   const [inline, virtual]
 

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.

Reimplemented in H323Connection, and SIPConnection.

const PString& OpalConnection::GetRemoteApplication   const [inline]
 

Get the remote application.

const PString& OpalConnection::GetRemotePartyAddress   const [inline]
 

Get the remote party address.

virtual const PString OpalConnection::GetRemotePartyCallbackURL   const [inline, virtual]
 

Get the remote party address. This will return the "best guess" at an address to use in a to call the user again later.

Reimplemented in H323Connection, and SIPConnection.

const PString& OpalConnection::GetRemotePartyName   const [inline]
 

Get the caller name/alias.

const PString& OpalConnection::GetRemotePartyNumber   const [inline]
 

Get the remote party number, if there was one one. If the remote party has indicated an e164 number as one of its aliases or as a field in the Q.931 PDU, then this function will return it.

const RTP_DataFrame::PayloadMapType& OpalConnection::GetRTPPayloadMap   const [inline]
 

virtual SendUserInputModes OpalConnection::GetSendUserInputMode   const [inline, virtual]
 

Get the user input indication transmission mode.

virtual RTP_Session* OpalConnection::GetSession unsigned    sessionID const [virtual]
 

Get an RTP session for the specified ID. If there is no session of the specified ID, NULL is returned.

Parameters:
sessionID  RTP session number

Reimplemented in H323Connection.

PTime OpalConnection::GetSetupUpTime   const [inline]
 

Get the time at which the connection was begun

OpalSilenceDetector* OpalConnection::GetSilenceDetector   const [inline]
 

Get the silence detector active on connection.

const PString& OpalConnection::GetToken   const [inline]
 

Get the token for this connection.

virtual OpalTransport& OpalConnection::GetTransport   const [inline, virtual]
 

Reimplemented in H323Connection, and SIPConnection.

virtual PString OpalConnection::GetUserInput unsigned    timeout = 30 [virtual]
 

Get a user input indication string, waiting until one arrives.

Parameters:
timeout  Timeout in seconds on input

virtual void OpalConnection::HoldConnection   [virtual]
 

Put the current connection on hold, suspending all media streams.

Reimplemented in H323Connection, IAX2Connection, and SIPConnection.

virtual BOOL OpalConnection::IsConnectionOnHold   [virtual]
 

Return TRUE if the current connection is on hold.

Reimplemented in H323Connection, IAX2Connection, and SIPConnection.

virtual BOOL OpalConnection::IsMediaBypassPossible unsigned    sessionID const [virtual]
 

See if the media can bypass the local host.

The default behaviour returns FALSE indicating that media bypass is not possible.

Parameters:
sessionID  Session ID for media channel

Reimplemented in H323Connection, and SIPConnection.

BOOL OpalConnection::IsOriginating   const [inline]
 

Get the call direction for this connection.

virtual void OpalConnection::OnAlerting   [virtual]
 

Call back for remote party being alerted. This function is called after the connection is informed that the remote endpoint is "ringing". Generally some time after the SetUpConnection() function was called, this is function is called.

If FALSE is returned the connection is aborted.

If an application overrides this function, it should generally call the ancestor version for correct operation. An application would typically only intercept this function if it wishes to do some form of logging. For this you can obtain the name of the caller by using the function OpalConnection::GetRemotePartyName().

The default behaviour calls the OpalEndPoint function of the same name.

Reimplemented in IAX2Connection.

virtual AnswerCallResponse OpalConnection::OnAnswerCall const PString &    callerName [virtual]
 

Call back for answering an incoming call. This function is called after the connection has been acknowledged but before the connection is established

This gives the application time to wait for some event before signalling to the endpoint that the connection is to proceed. For example the user pressing an "Answer call" button.

If AnswerCallDenied is returned the connection is aborted and the connetion specific end call PDU is sent. If AnswerCallNow is returned then the connection proceeding, Finally if AnswerCallPending is returned then the protocol negotiations are paused until the AnsweringCall() function is called.

The default behaviour simply returns AnswerNow.

Parameters:
callerName  Name of caller

Reimplemented in H323Connection, and SIPConnection.

virtual void OpalConnection::OnClosedMediaStream const OpalMediaStream   stream [virtual]
 

Call back for closed a media stream.

The default behaviour calls the OpalEndPoint function of the same name.

Parameters:
stream  Media stream being closed

virtual void OpalConnection::OnConnected   [virtual]
 

A call back function whenever a connection is "connected". This indicates that a connection to an endpoint was connected. That is the endpoint received acknowledgement via whatever protocol it uses that the connection may now start media streams.

In the context of H.323 this means that the CONNECT pdu has been received.

The default behaviour calls the OpalEndPoint function of the same name.

Reimplemented in IAX2Connection, and SIPConnection.

virtual void OpalConnection::OnEstablished   [virtual]
 

A call back function whenever a connection is established. This indicates that a connection to an endpoint was established. This differs from OnConnected() in that the media streams are started.

In the context of H.323 this means that the signalling and control channels are open and the TerminalCapabilitySet and MasterSlave negotiations are complete.

The default behaviour calls the OpalEndPoint function of the same name.

Reimplemented in H323Connection, and IAX2Connection.

virtual BOOL OpalConnection::OnIncomingConnection   [virtual]
 

Call back for an incoming call. This function is used for an application to control the answering of incoming calls.

If TRUE is returned then the connection continues. If FALSE then the connection is aborted.

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.

If an application overrides this function, it should generally call the ancestor version to complete calls. Unless the application completely takes over that responsibility. Generally, an application would only intercept this function if it wishes to do some form of logging. For this you can obtain the name of the caller by using the function OpalConnection::GetRemotePartyName().

The default behaviour calls the OpalManager function of the same name.

Reimplemented in IAX2Connection.

virtual BOOL OpalConnection::OnOpenMediaStream OpalMediaStream   stream [virtual]
 

Call back when opening a media stream. This function is called when a connection has created a new media stream according to the logic of its underlying protocol.

The usual requirement is that media streams are created on all other connections participating in the call and all of the media streams are attached to an instance of an OpalMediaPatch object that will read from one of the media streams passing data to the other media streams.

The default behaviour calls the OpalEndPoint function of the same name.

Parameters:
stream  New media stream being opened

Reimplemented in OpalLineConnection.

virtual void OpalConnection::OnPatchMediaStream BOOL    isSource,
OpalMediaPatch   patch
[virtual]
 

Call back when patching a media stream. This function is called when a connection has created a new media patch between two streams.

Parameters:
patch  New patch

Reimplemented in OpalPCSSConnection.

virtual void OpalConnection::OnReleased   [virtual]
 

Clean up the termination of the connection. This function can do any internal cleaning up and waiting on background threads that may be using the connection object.

Note that t