#include <connection.h>
Inheritance diagram for OpalConnection:
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) |
virtual void | TransferConnection (const PString &remoteParty, const PString &callIdentity=PString::Empty()) |
virtual void | HoldConnection () |
virtual void | RetrieveConnection () |
virtual BOOL | IsConnectionOnHold () |
Public Types | |
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. | |
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. | |
NumAnswerCallResponses | |
As for AnswerCallDeferred but starts media channels. | |
UninitialisedPhase | |
SetUpPhase | |
AlertingPhase | |
ConnectedPhase | |
EstablishedPhase | |
ReleasingPhase | |
ReleasedPhase | |
NumPhases | |
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, NumAnswerCallResponses } |
Public Member Functions | |
const RTP_DataFrame::PayloadMapType & | GetRTPPayloadMap () 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 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 OpalMediaStream * | OpenSinkMediaStream (OpalMediaStream &source) |
virtual void | StartMediaStreams () |
virtual void | CloseMediaStreams () |
virtual void | RemoveMediaStreams () |
virtual void | PauseMediaStreams (BOOL paused) |
virtual OpalMediaStream * | CreateMediaStream (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) |
OpalMediaStream * | GetMediaStream (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_Session * | GetSession (unsigned sessionID) const |
virtual RTP_Session * | UseSession (const OpalTransport &transport, unsigned sessionID, RTP_QOS *rtpqos=NULL) |
virtual void | ReleaseSession (unsigned sessionID) |
virtual RTP_Session * | CreateSession (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) |
User input | |
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) |
Other services | |
virtual OpalT120Protocol * | CreateT120ProtocolHandler () |
virtual OpalT38Protocol * | CreateT38ProtocolHandler () |
Member variable access | |
OpalEndPoint & | GetEndPoint () const |
OpalCall & | GetCall () 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) |
OpalSilenceDetector * | GetSilenceDetector () const |
OpalEchoCanceler * | GetEchoCanceler () const |
virtual const OpalGloballyUniqueID & | GetIdentifier () const |
virtual OpalTransport & | GetTransport () const |
PDICTIONARY (MediaAddressesDict, POrdinalKey, OpalTransportAddress) | |
MediaAddressesDict & | GetMediaTransportAddresses () |
Protected Member Functions | |
PDECLARE_NOTIFIER (OpalRFC2833Info, OpalConnection, OnUserInputInlineRFC2833) | |
PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnUserInputInBandDTMF) | |
PDECLARE_NOTIFIER (PThread, OpalConnection, OnReleaseThreadMain) | |
void | SetPhase (Phases phaseToSet) |
Protected Attributes | |
OpalCall & | ownerCall |
OpalEndPoint & | endpoint |
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 |
PString | userInputString |
PMutex | userInputMutex |
PSyncPoint | userInputAvailable |
BOOL | detectInBandDTMF |
OpalSilenceDetector * | silenceDetector |
OpalEchoCanceler * | echoCanceler |
OpalRFC2833Proto * | rfc2833Handler |
OpalT120Protocol * | t120handler |
OpalT38Protocol * | t38handler |
MediaAddressesDict | mediaTransportAddresses |
PMutex | mediaStreamMutex |
OpalMediaStreamList | mediaStreams |
RTP_SessionManager | rtpSessions |
unsigned | minAudioJitterDelay |
unsigned | maxAudioJitterDelay |
unsigned | bandwidthAvailable |
RTP_DataFrame::PayloadMapType | rtpPayloadMap |
PDTMFDecoder | dtmfDecoder |
Classes | |
struct | MediaInformation |
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.
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. |
NumAnswerCallResponses | As for AnswerCallDeferred but starts media channels. |
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.
OpalConnection::OpalConnection | ( | OpalCall & | call, | |
OpalEndPoint & | endpoint, | |||
const PString & | token | |||
) |
Create a new connection.
call | Owner calll for connection |
endpoint | Owner endpoint for connection |
token | Token to identify the connection |
OpalConnection::~OpalConnection | ( | ) |
Destroy connection.
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.
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.
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.
response | Answer response to incoming call |
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.
reason | Reason for call clearing |
virtual void OpalConnection::ClearCallSynchronous | ( | PSyncPoint * | sync, | |
CallEndReason | reason = EndedByLocalUser | |||
) | [virtual] |
Clear a current connection, synchronously
reason | Reason for call clearing |
virtual void OpalConnection::CloseMediaStreams | ( | ) | [virtual] |
Close media streams for session.
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.
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.
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.
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.
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 | ( | ) | const [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.
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 | ( | ) | const [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.
sessionID | Session ID for media channel |
info | Information on media channel |
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.
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.
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 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.
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.
timeout | Timeout in seconds on input |
virtual void OpalConnection::HoldConnection | ( | ) | [virtual] |
Put the current connection on hold, suspending all media streams.
Reimplemented in H323Connection, and SIPConnection.
virtual BOOL OpalConnection::IsConnectionOnHold | ( | ) | [virtual] |
Return TRUE if the current connection is on hold.
Reimplemented in H323Connection, 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.
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.
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.
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.
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.
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 there is not a one to one relationship with the OnEstablishedConnection() function. This function may be called without that function being called. For example if SetUpConnection() was used but the call never completed.
Classes that override this function should make sure they call the ancestor version for correct operation.
An application will not typically call this function as it is used by the OpalManager during a release of the connection.
The default behaviour calls the OpalEndPoint function of the same name.
Reimplemented in H323Connection, IAX2Connection, OpalLineConnection, and SIPConnection.
virtual void OpalConnection::OnUserInputString | ( | const PString & | value | ) | [virtual] |
Call back for remote enpoint has sent user input as a string. 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.
value | String value of indication |
virtual void OpalConnection::OnUserInputTone | ( | char | tone, | |
unsigned | duration | |||
) | [virtual] |
Call back for remote enpoint has sent user input. If duration is zero then this indicates the beginning of the tone. If duration is non-zero then it indicates the end of the tone output.
The default behaviour calls the OpalEndPoint function of the same name.
virtual OpalMediaStream* OpalConnection::OpenSinkMediaStream | ( | OpalMediaStream & | source | ) | [virtual] |
Open source transmitter media stream for session.
source | Source media sink format to open to |
Reimplemented in OpalPCSSConnection, and SIPConnection.
virtual BOOL OpalConnection::OpenSourceMediaStream | ( | const OpalMediaFormatList & | mediaFormats, | |
unsigned | sessionID | |||
) | [virtual] |
Open source transmitter media stream for session.
mediaFormats | Optional media format to open |
sessionID | Session to start stream on |
Reimplemented in H323Connection, OpalPCSSConnection, and SIPConnection.
virtual void OpalConnection::PauseMediaStreams | ( | BOOL | paused | ) | [virtual] |
Pause media streams for session.
OpalConnection::PDECLARE_NOTIFIER | ( | PThread | , | |
OpalConnection | , | |||
OnReleaseThreadMain | ||||
) | [protected] |
OpalConnection::PDECLARE_NOTIFIER | ( | RTP_DataFrame | , | |
OpalConnection | , | |||
OnUserInputInBandDTMF | ||||
) | [protected] |
OpalConnection::PDECLARE_NOTIFIER | ( | OpalRFC2833Info | , | |
OpalConnection | , | |||
OnUserInputInlineRFC2833 | ||||
) | [protected] |
OpalConnection::PDICTIONARY | ( | MediaAddressesDict | , | |
POrdinalKey | , | |||
OpalTransportAddress | ||||
) |
void OpalConnection::PrintOn | ( | ostream & | strm | ) | const |
Standard stream print function. The PObject class has a << operator defined that calls this function polymorphically.
strm | Stream to output text representation |
virtual BOOL OpalConnection::PromptUserInput | ( | BOOL | play | ) | [virtual] |
Play a prompt to the connection before rading user indication string.
For example the LID connection would play a dial tone.
The default behaviour does nothing.
play | Flag to start or stop playing the prompt |
Reimplemented in OpalLineConnection.
virtual PString OpalConnection::ReadUserInput | ( | const char * | terminators = "#\r\n" , |
|
unsigned | lastDigitTimeout = 4 , |
|||
unsigned | firstDigitTimeout = 30 | |||
) | [virtual] |
Read a sequence of user indications with timeouts.
terminators | Characters that can terminte input |
lastDigitTimeout | Timeout on last digit in string |
firstDigitTimeout | Timeout on receiving any digits |
virtual void OpalConnection::Release | ( | CallEndReason | reason = EndedByLocalUser |
) | [virtual] |
Release the current connection. This removes the connection from the current call. The call may continue if there are other connections still active on it. If this was the last connection for the call then the call is disposed of as well.
Note that this function will return quickly as the release and disposal of the connections is done by another thread.
reason | Reason for call release |
virtual void OpalConnection::ReleaseSession | ( | unsigned | sessionID | ) | [virtual] |
Release the session. If the session ID is not being used any more any clients via the UseSession() function, then the session is deleted.
sessionID | RTP session number |
Reimplemented in H323Connection.
virtual void OpalConnection::RemoveMediaStreams | ( | ) | [virtual] |
Close media streams from session.
virtual void OpalConnection::RetrieveConnection | ( | ) | [virtual] |
Retrieve the current connection from hold, activating all media streams.
Reimplemented in H323Connection, and SIPConnection.
void OpalConnection::SendUserInputHookFlash | ( | unsigned | duration = 500 |
) | [inline] |
Send a user input indication to the remote endpoint. This sends a Hook Flash emulation user input.
duration | Duration of tone in milliseconds |
virtual BOOL OpalConnection::SendUserInputString | ( | const PString & | value | ) | [virtual] |
Send a user input indication to the remote endpoint. This is for sending arbitrary strings as user indications.
The default behaviour is to call SendUserInputTone() for each character in the string.
value | String value of indication |
Reimplemented in H323Connection, IAX2Connection, OpalLineConnection, and OpalPCSSConnection.
virtual BOOL OpalConnection::SendUserInputTone | ( | char | tone, | |
unsigned | duration = 0 | |||
) | [virtual] |
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 default behaviour sends the tone using RFC2833.
tone | DTMF tone code |
duration | Duration of tone in milliseconds |
Reimplemented in H323Connection, and IAX2Connection.
virtual BOOL OpalConnection::SetAlerting | ( | const PString & | calleeName, | |
BOOL | withMedia | |||
) | [pure virtual] |
Indicate to remote endpoint an alert is in progress. If this is an incoming connection and the AnswerCallResponse is in a AnswerCallDeferred or AnswerCallPending state, then this function is used to indicate to that endpoint that an alert is in progress. This is usually due to another connection which is in the call (the B party) has received an OnAlerting() indicating that its remoteendpoint is "ringing".
The default behaviour is pure.
calleeName | Name of endpoint being alerted. |
withMedia | Open media with alerting |
Implemented in H323Connection, IAX2Connection, OpalLineConnection, OpalPCSSConnection, and SIPConnection.
void OpalConnection::SetAudioJitterDelay | ( | unsigned | minDelay, | |
unsigned | maxDelay | |||
) |
Set the maximum audio delay jitter parameter.
minDelay | New minimum jitter buffer delay in milliseconds |
maxDelay | New maximum jitter buffer delay in milliseconds |
virtual BOOL OpalConnection::SetBandwidthAvailable | ( | unsigned | newBandwidth, | |
BOOL | force = FALSE | |||
) | [virtual] |
Set the available bandwidth in 100's of bits/sec. Note if the force parameter is TRUE this function will close down active media streams to meet the new bandwidth requirement.
newBandwidth | New bandwidth limit |
force | Force bandwidth limit |
Reimplemented in H323Connection.
virtual BOOL OpalConnection::SetBandwidthUsed | ( | unsigned | releasedBandwidth, | |
unsigned | requiredBandwidth | |||
) | [virtual] |
Set the used bandwidth in 100's of bits/sec. This is an internal function used by the OpalMediaStream bandwidth management code.
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.
releasedBandwidth | Bandwidth to release |
requiredBandwidth | Bandwidth required |
virtual void OpalConnection::SetCallEndReason | ( | CallEndReason | reason | ) | [virtual] |
Set the call clearance reason. An application should have no cause to use this function. It is present for the H323EndPoint::ClearCall() function to set the clearance reason.
reason | Reason for clearance of connection. |
virtual BOOL OpalConnection::SetConnected | ( | ) | [pure virtual] |
Indicate to remote endpoint we are connected.
The default behaviour is pure.
Implemented in H323Connection, IAX2Connection, OpalLineConnection, OpalPCSSConnection, and SIPConnection.
void OpalConnection::SetDisplayName | ( | const PString & | name | ) | [inline] |
Set the local display name.
virtual void OpalConnection::SetLocalPartyName | ( | const PString & | name | ) | [virtual] |
Set the local name/alias.
Reimplemented in H323Connection.
void OpalConnection::SetPhase | ( | Phases | phaseToSet | ) | [protected] |
Set the phase of the connection.
phaseToSet | the phase to set |
virtual BOOL OpalConnection::SetUpConnection | ( | ) | [pure virtual] |
Start an outgoing connection. This function will initiate the connection to the remote entity, for example in H.323 it sends a SETUP, in SIP it sends an INVITE etc.
The default behaviour is pure.
Implemented in H323Connection, IAX2Connection, OpalLineConnection, OpalPCSSConnection, and SIPConnection.
virtual void OpalConnection::SetUserInput | ( | const PString & | input | ) | [virtual] |
Set a user indication string. This allows the GetUserInput() function to unblock and return this string.
input | Input string |
virtual void OpalConnection::StartMediaStreams | ( | ) | [virtual] |
Start media streams for session.
virtual void OpalConnection::TransferConnection | ( | const PString & | remoteParty, | |
const PString & | callIdentity = PString::Empty() | |||
) | [virtual] |
Initiate the transfer of an existing call (connection) to a new remote party.
remoteParty | Remote party to transfer the existing call to |
callIdentity | Call Identity of secondary call if present |
Reimplemented in H323Connection, and SIPConnection.
virtual RTP_Session* OpalConnection::UseSession | ( | const OpalTransport & | transport, | |
unsigned | sessionID, | |||
RTP_QOS * | rtpqos = NULL | |||
) | [virtual] |
Use an RTP session for the specified ID. This will find a session of the specified ID and increment its reference count. Multiple OpalRTPStreams use this to indicate their usage of the RTP session.
If this function is used, then the ReleaseSession() function MUST be called or the session is never deleted for the lifetime of the Opal connection.
If there is no session of the specified ID one is created.
The type of RTP session that is created will be compatible with the transport. At this time only IP (RTp over UDP) is supported.
transport | Transport of signalling |
sessionID | RTP session number |
rtpqos | Quiality of Service information |
Reimplemented in H323Connection.
PTime OpalConnection::alertingTime [protected] |
unsigned OpalConnection::bandwidthAvailable [protected] |
PString OpalConnection::calledDestinationName [protected] |
PString OpalConnection::calledDestinationNumber [protected] |
CallEndReason OpalConnection::callEndReason [protected] |
PTime OpalConnection::callEndTime [protected] |
OpalGloballyUniqueID OpalConnection::callIdentifier [protected] |
PString OpalConnection::callToken [protected] |
PTime OpalConnection::connectedTime [protected] |
BOOL OpalConnection::detectInBandDTMF [protected] |
PString OpalConnection::displayName [protected] |
PDTMFDecoder OpalConnection::dtmfDecoder [protected] |
OpalEchoCanceler* OpalConnection::echoCanceler [protected] |
OpalEndPoint& OpalConnection::endpoint [protected] |
Reimplemented in H323Connection, IAX2Connection, OpalLineConnection, OpalPCSSConnection, and SIPConnection.
PString OpalConnection::localPartyName [protected] |
unsigned OpalConnection::maxAudioJitterDelay [protected] |
PMutex OpalConnection::mediaStreamMutex [protected] |
OpalMediaStreamList OpalConnection::mediaStreams [protected] |
MediaAddressesDict OpalConnection::mediaTransportAddresses [protected] |
unsigned OpalConnection::minAudioJitterDelay [protected] |
BOOL OpalConnection::originating [protected] |
OpalCall& OpalConnection::ownerCall [protected] |
Phases OpalConnection::phase [protected] |
PString OpalConnection::remoteApplication [protected] |
PString OpalConnection::remotePartyAddress [protected] |
PString OpalConnection::remotePartyName [protected] |
PString OpalConnection::remotePartyNumber [protected] |
OpalRFC2833Proto* OpalConnection::rfc2833Handler [protected] |
RTP_SessionManager OpalConnection::rtpSessions [protected] |
PTime OpalConnection::setupTime [protected] |
OpalSilenceDetector* OpalConnection::silenceDetector [protected] |
OpalT120Protocol* OpalConnection::t120handler [protected] |
OpalT38Protocol* OpalConnection::t38handler [protected] |
PSyncPoint OpalConnection::userInputAvailable [protected] |
PMutex OpalConnection::userInputMutex [protected] |
PString OpalConnection::userInputString [protected] |