OPAL
Version 3.14.3
|
#include <lidep.h>
Public Member Functions | |
Construction | |
OpalLineConnection (OpalCall &call, OpalLineEndPoint &endpoint, OpalLine &line, const PString &number) | |
Overrides from OpalConnection | |
virtual PString | GetPrefixName () const |
virtual bool | IsNetworkConnection () const |
virtual PBoolean | SetUpConnection () |
virtual PBoolean | SetAlerting (const PString &calleeName, PBoolean withMedia) |
virtual PBoolean | SetConnected () |
virtual void | OnReleased () |
virtual PString | GetDestinationAddress () |
virtual OpalMediaFormatList | GetMediaFormats () const |
virtual OpalMediaStream * | CreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, PBoolean isSource) |
virtual PBoolean | OnOpenMediaStream (OpalMediaStream &stream) |
virtual void | OnClosedMediaStream (const OpalMediaStream &stream) |
virtual PBoolean | SetAudioVolume (PBoolean source, unsigned percentage) |
virtual unsigned | GetAudioSignalLevel (PBoolean source) |
virtual PBoolean | SendUserInputString (const PString &value) |
virtual PBoolean | SendUserInputTone (char tone, int duration) |
virtual PBoolean | PromptUserInput (PBoolean play) |
Call handling functions | |
void | StartIncoming () |
virtual void | Monitor () |
Member variable access | |
OpalLine & | GetLine () |
OpalLineInterfaceDevice::CallProgressTones | GetPromptTone () const |
void | SetPromptTone (OpalLineInterfaceDevice::CallProgressTones tone) |
void | setDialDelay (unsigned int uiDialDelay) |
unsigned int | getDialDelay () const |
![]() | |
P_DECLARE_TRACED_ENUM_EX (CallEndReasonCodes, NumCallEndReasons, EndedByLocalUser, 0, 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, EndedByNoDialTone, EndedByNoRingBackTone, EndedByOutOfService, EndedByAcceptingCallWaiting, EndedByGkAdmissionFailed, EndedByMediaFailed, EndedByCallCompletedElsewhere, EndedByCertificateAuthority, EndedByIllegalAddress, EndedByCustomCode) | |
P_DECLARE_TRACED_ENUM (AnswerCallResponse, AnswerCallNow, AnswerCallDenied, AnswerCallPending, AnswerCallDeferred, AnswerCallAlertWithMedia, AnswerCallDeferredWithMedia, AnswerCallProgress, AnswerCallNowAndReleaseCurrent) | |
const StringOptions & | GetStringOptions () const |
Get the string options associated with this connection. More... | |
StringOptions & | GetStringOptions () |
void | SetStringOptions (const StringOptions &options, bool overwrite) |
Set the string options associated with this connection. More... | |
virtual void | OnApplyStringOptions () |
Call back for connection to act on changed string options. More... | |
virtual void | EnableRecording () |
virtual void | DisableRecording () |
OpalConnection (OpalCall &call, OpalEndPoint &endpoint, const PString &token, unsigned options=0, OpalConnection::StringOptions *stringOptions=NULL) | |
~OpalConnection () | |
void | PrintOn (ostream &strm) const |
virtual PBoolean | OnIncomingConnection (unsigned int options, OpalConnection::StringOptions *stringOptions) |
virtual PBoolean | OnSetUpConnection () |
virtual void | OnProceeding () |
virtual void | OnAlerting () |
virtual AnswerCallResponse | OnAnswerCall (const PString &callerName) |
virtual void | AnsweringCall (AnswerCallResponse response) |
virtual void | OnConnected () |
virtual void | OnEstablished () |
virtual bool | OnTransferNotify (const PStringToString &info, const OpalConnection *transferringConnection) |
virtual void | Release (CallEndReason reason=EndedByLocalUser, bool synchronous=false) |
virtual PBoolean | ForwardCall (const PString &forwardParty) |
PSafePtr< OpalConnection > | GetOtherPartyConnection () const |
template<class cls > | |
PSafePtr< cls > | GetOtherPartyConnectionAs () const |
virtual OpalMediaFormatList | GetLocalMediaFormats () |
virtual void | AdjustMediaFormats (bool local, const OpalConnection *otherConnection, OpalMediaFormatList &mediaFormats) const |
virtual PStringArray | GetMediaCryptoSuites () const |
virtual unsigned | GetNextSessionID (const OpalMediaType &mediaType, bool isSource) |
virtual bool | RequireSymmetricMediaStreams () const |
virtual OpalMediaType::AutoStartMode | GetAutoStart (const OpalMediaType &mediaType) const |
virtual void | AutoStartMediaStreams (bool transfer=false) |
virtual OpalMediaStreamPtr | OpenMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource) |
bool | CloseMediaStream (unsigned sessionId, bool source) |
bool | CloseMediaStream (OpalMediaStreamPtr stream) |
bool | RemoveMediaStream (OpalMediaStream &strm) |
virtual void | StartMediaStreams () |
virtual void | CloseMediaStreams () |
virtual void | PauseMediaStreams (bool paused) |
virtual void | OnPauseMediaStream (OpalMediaStream &strm, bool paused) |
OpalMediaStreamPtr | GetMediaStream (const PString &streamID, bool source) const |
OpalMediaStreamPtr | GetMediaStream (unsigned sessionId, bool source) const |
OpalMediaStreamPtr | GetMediaStream (const OpalMediaType &mediaType, bool source, OpalMediaStreamPtr previous=NULL) const |
virtual void | OnFailedMediaStream (bool fromRemote, const PString &reason) |
virtual void | OnPatchMediaStream (PBoolean isSource, OpalMediaPatch &patch) |
virtual void | OnStartMediaPatch (OpalMediaPatch &patch) |
virtual void | OnStopMediaPatch (OpalMediaPatch &patch) |
virtual bool | OnMediaFailed (unsigned sessionId, bool source) |
bool | AllMediaFailed () const |
virtual bool | OnMediaCommand (OpalMediaStream &stream, const OpalMediaCommand &command) |
virtual bool | ExecuteMediaCommand (const OpalMediaCommand &command, unsigned sessionID=0, const OpalMediaType &mediaType=OpalMediaType()) const |
virtual bool | GetMediaTransportAddresses (OpalConnection &otherConnection, const OpalMediaType &mediaType, OpalTransportAddressArray &transports) const |
virtual bool | SendVideoUpdatePicture (unsigned sessionID=0, bool force=false) const |
void | SendVideoUpdatePictureCallback (unsigned sessionID, bool force) |
virtual void | OnRxIntraFrameRequest (const OpalMediaSession &session, bool force) |
virtual PBoolean | GetAudioVolume (PBoolean source, unsigned &percentage) |
virtual bool | SetAudioMute (bool source, bool mute) |
virtual bool | GetAudioMute (bool source, bool &mute) |
OpalBandwidth | GetBandwidthAvailable (OpalBandwidth::Direction dir) const |
virtual bool | SetBandwidthAvailable (OpalBandwidth::Direction dir, OpalBandwidth availableBandwidth) |
virtual bool | SetBandwidthAllocated (OpalBandwidth::Direction dir, OpalBandwidth newBandwidth) |
virtual OpalBandwidth | GetBandwidthUsed (OpalBandwidth::Direction dir) const |
virtual bool | SetBandwidthUsed (OpalBandwidth::Direction dir, OpalBandwidth releasedBandwidth, OpalBandwidth requiredBandwidth) |
P_DECLARE_TRACED_ENUM (SendUserInputModes, SendUserInputAsQ931, SendUserInputAsString, SendUserInputAsTone, SendUserInputAsRFC2833, SendUserInputAsInlineRFC2833=SendUserInputAsRFC2833, SendUserInputInBand, SendUserInputAsProtocolDefault) | |
virtual void | SetSendUserInputMode (SendUserInputModes mode) |
virtual SendUserInputModes | GetSendUserInputMode () const |
virtual SendUserInputModes | GetRealSendUserInputMode () const |
virtual PBoolean | SendUserInputTone (char tone, unsigned duration=0) |
virtual void | OnUserInputString (const PString &value) |
void | OnUserInputStringCallback (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="YX#\r\n", unsigned lastDigitTimeout=4, unsigned firstDigitTimeout=30) |
virtual bool | GetConferenceState (OpalConferenceState *state) const |
virtual bool | RequestPresentationRole (bool release) |
virtual bool | OnChangedPresentationRole (const PString &newChairURI, bool request) |
virtual bool | HasPresentationRole () const |
virtual bool | GarbageCollection () |
OpalEndPoint & | GetEndPoint () const |
OpalCall & | GetCall () const |
const PString & | GetToken () const |
PBoolean | IsOriginating () const |
const PTime & | GetPhaseTime (Phases phase) const |
const PTime & | GetSetupUpTime () const |
const PTime & | GetAlertingTime () const |
const PTime & | GetConnectionStartTime () const |
const PTime & | GetConnectionEndTime () const |
const OpalProductInfo & | GetProductInfo () const |
void | SetProductInfo (const OpalProductInfo &info) |
const PString & | GetLocalPartyName () const |
virtual void | SetLocalPartyName (const PString &name) |
virtual PString | GetLocalPartyURL () const |
const PString & | GetDisplayName () const |
void | SetDisplayName (const PString &name) |
virtual bool | IsPresentationBlocked () const |
const PString & | GetRemotePartyName () const |
void | SetRemotePartyName (const PString &name) |
const PString & | GetRemotePartyNumber () const |
virtual OpalTransportAddress | GetRemoteAddress () const |
virtual PString | GetRemotePartyURL () const |
virtual PString | GetRemoteIdentity () const |
P_DEPRECATED PString | GetRemotePartyAddress () const |
P_DEPRECATED const PString | GetRemotePartyCallbackURL () const |
PCaselessString | GetRemoteApplication () const |
const OpalProductInfo & | GetRemoteProductInfo () const |
const PString & | GetRedirectingParty () const |
void | SetRedirectingParty (const PString &party) |
const PString & | GetCalledPartyName () const |
const PString & | GetCalledPartyNumber () const |
virtual PString | GetCalledPartyURL () |
void | CopyPartyNames (const OpalConnection &other) |
virtual PString | GetAlertingType () const |
virtual bool | SetAlertingType (const PString &info) |
virtual PString | GetCallInfo () const |
unsigned | GetMinAudioJitterDelay () const |
unsigned | GetMaxAudioJitterDelay () const |
void | SetAudioJitterDelay (unsigned minDelay, unsigned maxDelay) |
OpalSilenceDetector * | GetSilenceDetector () const |
virtual PString | GetIdentifier () const |
virtual PINDEX | GetMaxRtpPayloadSize () const |
unsigned | GetVideoUpdateRequestsSent () const |
unsigned | GetVideoUpdateRequestsReceived () const |
P_DECLARE_TRACED_ENUM (Phases, UninitialisedPhase, SetUpPhase, ProceedingPhase, AlertingPhase, ConnectedPhase, EstablishedPhase, ForwardingPhase, ReleasingPhase, ReleasedPhase) | |
__inline Phases | GetPhase () const |
__inline bool | IsEstablished () const |
Return true if connection is in the established phase. More... | |
__inline bool | IsReleased () const |
Return true if connection is in the established phase. More... | |
void | SetPhase (Phases phaseToSet) |
CallEndReason | GetCallEndReason () const |
PString | GetCallEndReasonText () const |
virtual void | SetCallEndReason (CallEndReason reason) |
void | ClearCall (CallEndReason reason=EndedByLocalUser, PSyncPoint *sync=NULL) |
virtual void | ClearCallSynchronous (PSyncPoint *sync, CallEndReason reason=EndedByLocalUser) |
unsigned | GetQ931Cause () const |
void | SetQ931Cause (unsigned v) |
virtual bool | TransferConnection (const PString &remoteParty) |
virtual bool | HoldRemote (bool placeOnHold) |
virtual bool | IsOnHold (bool fromRemote) const |
virtual void | OnHold (bool fromRemote, bool onHold) |
Protected Member Functions | |
PDECLARE_NOTIFIER (PThread, OpalLineConnection, HandleIncoming) | |
![]() | |
void | OnConnectedInternal () |
void | InternalSetAsOriginating () |
bool | InternalRelease (CallEndReason reason) |
void | InternalOnReleased () |
PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnRecordAudio) | |
PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnRecordVideo) | |
void | OnStartRecording (OpalMediaPatch *patch) |
void | OnStopRecording (OpalMediaPatch *patch) |
Additional Inherited Members | |
![]() | |
enum | Options { FastStartOptionDisable = 0x0001, FastStartOptionEnable = 0x0002, FastStartOptionMask = 0x0003, H245TunnelingOptionDisable = 0x0004, H245TunnelingOptionEnable = 0x0008, H245TunnelingOptionMask = 0x000c, H245inSetupOptionDisable = 0x0010, H245inSetupOptionEnable = 0x0020, H245inSetupOptionMask = 0x0030, DetectInBandDTMFOptionDisable = 0x0040, DetectInBandDTMFOptionEnable = 0x0080, DetectInBandDTMFOptionMask = 0x00c0, RTPAggregationDisable = 0x0100, RTPAggregationEnable = 0x0200, RTPAggregationMask = 0x0300, SendDTMFAsDefault = 0x0000, SendDTMFAsString = 0x0400, SendDTMFAsTone = 0x0800, SendDTMFAsRFC2833 = 0x0c00, SendDTMFMask = 0x0c00 } |
![]() | |
static PString | GetCallEndReasonText (CallEndReason reason) |
static void | SetCallEndReasonText (CallEndReasonCodes reasonCode, const PString &newText) |
This class describes the LID based codec capability.
OpalLineConnection::OpalLineConnection | ( | OpalCall & | call, |
OpalLineEndPoint & | endpoint, | ||
OpalLine & | line, | ||
const PString & | number | ||
) |
Create a new connection.
call | Owner calll for connection |
endpoint | Endpoint for LID connection |
line | Line to make connection on |
number | Number to call on line |
|
virtual |
Open 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 from OpalConnection.
|
virtual |
Get the average signal level (0..32767) for the audio media channel. A return value of UINT_MAX indicates no valid signal, eg no audio channel opened.
source | true for source (microphone), false for sink (speaker) |
Reimplemented from OpalConnection.
|
virtual |
Get the destination address of an incoming connection. The default behaviour collects a DTMF number terminated with a '#' or if no digits were entered for a time (default 3 seconds). If no digits are entered within a longer time time (default 30 seconds), then an empty string is returned.
Reimplemented from OpalConnection.
|
inline |
Delay in msec to wait between the dial tone detection and dialing the dtmf
References m_dialParams, and OpalLineInterfaceDevice::DialParams::m_dialStartDelay.
|
inline |
Get the line being used by this media stream.
References line.
|
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 returns the capabilities of the LID line.
Reimplemented from OpalConnection.
|
virtual |
Get this connections protocol prefix for URLs.
Reimplemented from OpalConnection.
|
inline |
Get the prompt tone used on POTS lines. Defaults to OpalLineInterfaceDevice::DialTone.
References m_promptTone.
|
inlinevirtual |
Get indication of connection being to a "network". This indicates the if the connection may be regarded as a "network" connection. The distinction is about if there is a concept of a "remote" party being connected to and is best described by example: sip, h323, iax and pstn are all "network" connections as they connect to something "remote". While pc, pots and ivr are not as the entity being connected to is intrinsically local.
Implements OpalConnection.
References OpalLine::IsTerminal().
|
virtual |
Check for line hook state, DTMF tone for user indication etc.
|
virtual |
Call back for closed a media stream.
Note that this is called while the OpalMediaStream is locked. Care needs to be taken to avoid deadlocks.
The default behaviour calls the OpalEndPoint function of the same name.
stream | Media stream being closed |
Reimplemented from OpalConnection.
|
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 ancestor and adds a LID silence detector filter.
stream | New media stream being opened |
Reimplemented from OpalConnection.
|
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 starts playing the busy tone and calls the ancestor function.
Reimplemented from OpalConnection.
|
protected |
|
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 from OpalConnection.
|
virtual |
Send a user input indication to the remote endpoint. This sends an arbitrary string as a user indication. If DTMF tones in particular are required to be sent then the SendIndicationTone() function should be used.
The default behaviour plays the DTMF tones on the line.
value | String value of indication |
Reimplemented from OpalConnection.
|
virtual |
Send a user input indication to the remote endpoint. This sends DTMF emulation user input. If something other than the standard tones need be sent use the SendUserInputString() function.
The default behaviour plays the DTMF tone on the line.
tone | DTMF tone code |
duration | Duration of tone in milliseconds |
|
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 starts the ring back tone.
calleeName | Name of endpoint being alerted. |
withMedia | Open media with alerting |
Reimplemented from OpalConnection.
|
virtual |
Set the volume (gain) for the audio media channel to the specified percentage.
source | true for source (microphone), false for sink (speaker) |
percentage | Gain, 0=silent, 100=maximun |
Reimplemented from OpalConnection.
|
virtual |
Indicate to remote endpoint we are connected.
The default behaviour stops the ring back tone.
Reimplemented from OpalConnection.
|
inline |
Delay in msec to wait between the dial tone detection and dialing the dtmf
uiDialDelay | Dialing delay |
References m_dialParams, and OpalLineInterfaceDevice::DialParams::m_dialStartDelay.
|
inline |
Set the prompt tone used on POTS lines.
References m_promptTone.
|
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 does.
Reimplemented from OpalConnection.
void OpalLineConnection::StartIncoming | ( | ) |
Handle a new connection from the LID line.
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by getDialDelay(), and setDialDelay().
|
protected |
Referenced by GetPromptTone(), and SetPromptTone().
|
protected |
|
protected |