OpalIVRConnection Class Reference

`#include <ivr.h>`

Inheritance diagram for OpalIVRConnection:

## Public Member Functions

virtual void | OnEndDialog ()
const PString & | GetVXML () const
const OpalVXMLSession & | GetVXMLSession () const
OpalVXMLSession & | GetVXMLSession ()
PTextToSpeech * | GetTextToSpeech () const
PTextToSpeech * | SetTextToSpeech (const PString &ttsName)
PTextToSpeech * | SetTextToSpeech (PTextToSpeech *tts, PBoolean autoDelete=false)
Construction
| OpalIVRConnection (OpalCall &call, OpalIVREndPoint &endpoint, void *userData, const PString &vxml, unsigned int options, OpalConnection::StringOptions *stringOptions=NULL)
| ~OpalIVRConnection ()
Overrides from OpalConnection
virtual bool | IsNetworkConnection () const
virtual PString | GetLocalPartyURL () const
void | OnEstablished ()
virtual bool | OnTransferNotify (const PStringToString &info, const OpalConnection *transferringConnection)
virtual bool | TransferConnection (const PString &remoteParty)
virtual OpalMediaFormatList | GetMediaFormats () const
virtual OpalMediaStream * | CreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, PBoolean isSource)
virtual PBoolean | SendUserInputString (const PString &value)
Public Member Functions inherited from OpalLocalConnection
| OpalLocalConnection (OpalCall &call, OpalLocalEndPoint &endpoint, void *userData, unsigned options, OpalConnection::StringOptions *stringOptions, char tokenPrefix= 'L')
| ~OpalLocalConnection ()
virtual void | OnApplyStringOptions ()
| Call back for connection to act on changed string options. More...
virtual PBoolean | SetUpConnection ()
virtual PBoolean | SetAlerting (const PString &calleeName, PBoolean withMedia)
virtual PBoolean | SetConnected ()
virtual OpalMediaStreamPtr | OpenMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource)
virtual bool | OnOutgoingSetUp ()
virtual bool | OnOutgoing ()
virtual bool | OnIncoming ()
virtual void | AlertingIncoming ()
virtual void | AcceptIncoming ()
void * | GetUserData () const
| Get user data pointer. More...
void | SetUserData (void *v)
| Set user data pointer. More...
Public Member Functions inherited from OpalConnection
virtual bool | GarbageCollection ()
const StringOptions & | GetStringOptions () const
| Get the string options associated with this connection. More...
void | SetStringOptions (const StringOptions &options, bool overwrite)
| Set the string options associated with this connection. 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 | Release (CallEndReason reason=EndedByLocalUser, bool synchronous=false)
virtual void | OnReleased ()
virtual PString | GetDestinationAddress ()
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 unsigned | GetNextSessionID (const OpalMediaType &mediaType, bool isSource)
virtual OpalMediaType::AutoStartMode | GetAutoStart (const OpalMediaType &mediaType) const
virtual void | AutoStartMediaStreams (bool force=false)
virtual bool | SwitchFaxMediaStreams (bool toT38)
virtual void | OnSwitchedFaxMediaStreams (bool toT38, bool success)
virtual bool | OnSwitchingFaxMediaStreams (bool toT38)
virtual bool | CloseMediaStream (unsigned sessionId, bool source)
virtual bool | CloseMediaStream (OpalMediaStream &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 PBoolean | OnOpenMediaStream (OpalMediaStream &stream)
virtual void | OnClosedMediaStream (const OpalMediaStream &stream)
virtual void | OnPatchMediaStream (PBoolean isSource, OpalMediaPatch &patch)
virtual void | OnStartMediaPatch (OpalMediaPatch &patch)
virtual void | OnStopMediaPatch (OpalMediaPatch &patch)
virtual bool | OnMediaCommand (OpalMediaStream &stream, const OpalMediaCommand &command)
virtual void | AttachRFC2833HandlerToPatch (PBoolean isSource, OpalMediaPatch &patch)
virtual PBoolean | IsMediaBypassPossible (unsigned sessionID) const
virtual PBoolean | CreateVideoInputDevice (const OpalMediaFormat &mediaFormat, PVideoInputDevice *&device, PBoolean &autoDelete)
virtual PBoolean | CreateVideoOutputDevice (const OpalMediaFormat &mediaFormat, PBoolean preview, PVideoOutputDevice *&device, PBoolean &autoDelete)
virtual bool | SendVideoUpdatePicture (unsigned sessionID=0, bool force=false) const
virtual PBoolean | SetAudioVolume (PBoolean source, unsigned percentage)
virtual PBoolean | GetAudioVolume (PBoolean source, unsigned &percentage)
virtual bool | SetAudioMute (bool source, bool mute)
virtual bool | GetAudioMute (bool source, bool &mute)
virtual unsigned | GetAudioSignalLevel (PBoolean source)
unsigned | GetBandwidthAvailable () const
virtual PBoolean | SetBandwidthAvailable (unsigned newBandwidth, PBoolean force=false)
virtual unsigned | GetBandwidthUsed () const
virtual PBoolean | SetBandwidthUsed (unsigned releasedBandwidth, unsigned requiredBandwidth)
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)
virtual PString | GetPrefixName () const
const PString & | GetLocalPartyName () const
virtual void | SetLocalPartyName (const PString &name)
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
const PString & | GetRemotePartyAddress () const
void | SetRemotePartyAddress (const PString &addr)
virtual PString | GetRemotePartyURL () const
const PString & | GetRedirectingParty () const
void | SetRedirectingParty (const PString &party)
const PString | GetRemotePartyCallbackURL () const
PCaselessString | GetRemoteApplication () const
const OpalProductInfo & | GetRemoteProductInfo () const
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
virtual OpalTransport & | GetTransport () const
| PDICTIONARY (MediaAddressesDict, POrdinalKey, OpalTransportAddress)
MediaAddressesDict & | GetMediaTransportAddresses ()
unsigned | GetVideoUpdateRequestsSent () const
__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 | Hold (bool fromRemote, bool placeOnHold)
virtual bool | IsOnHold (bool fromRemote)
virtual void | OnHold (bool fromRemote, bool onHold)
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)
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 PBoolean | PromptUserInput (PBoolean play)

## Protected Member Functions

virtual bool | StartVXML (const PString &vxml)
virtual bool | StartScript (const PString &script)
Protected Member Functions inherited from OpalConnection
void | OnConnectedInternal ()
| PDECLARE_NOTIFIER (PThread, OpalConnection, OnReleaseThreadMain)
| PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnRecordAudio)
| PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnRecordVideo)
void | OnStartRecording (OpalMediaPatch *patch)
void | OnStopRecording (OpalMediaPatch *patch)

## Protected Attributes

OpalIVREndPoint & | endpoint
PString | m_vxmlScript
OpalMediaFormatList | m_vxmlMediaFormats
OpalVXMLSession | m_vxmlSession
Protected Attributes inherited from OpalLocalConnection
OpalLocalEndPoint & | endpoint
void * | m_userData
Protected Attributes inherited from OpalConnection
OpalCall & | ownerCall
OpalEndPoint & | endpoint
PString | callToken
PBoolean | originating
OpalProductInfo | productInfo
PString | localPartyName
PString | displayName
PString | remotePartyName
PString | remotePartyURL
OpalProductInfo | remoteProductInfo
PString | remotePartyNumber
PString | remotePartyAddress
PString | m_redirectingParty
CallEndReason | callEndReason
PString | m_calledPartyNumber
PString | m_calledPartyName
SendUserInputModes | sendUserInputMode
PString | userInputString
PSyncPoint | userInputAvailable
OpalSilenceDetector * | silenceDetector
OpalMediaFormat | m_filterMediaFormat
OpalMediaFormatList | m_localMediaFormats
MediaAddressesDict | mediaTransportAddresses
PSafeList< OpalMediaStream > | mediaStreams
unsigned | minAudioJitterDelay
unsigned | maxAudioJitterDelay
unsigned | bandwidthAvailable
StringOptions | m_stringOptions
PString | m_recordingFilename
PNotifier | m_recordAudioNotifier
PNotifier | m_recordVideoNotifier
unsigned | m_VideoUpdateRequestsSent
AutoStartMap | m_autoStartInfo
enum OpalConnection:: { ... } | m_faxMediaStreamsSwitchState
ZeroTime | m_phaseTime [NumPhases]

## Additional Inherited Members

Public Types inherited from OpalConnection

enum

CallEndReasonCodes {
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, EndedByNoDialTone, EndedByNoRingBackTone,
EndedByOutOfService, EndedByAcceptingCallWaiting, EndedByGkAdmissionFailed, NumCallEndReasons
}

enum | AnswerCallResponse { AnswerCallNow, AnswerCallDenied, AnswerCallPending, AnswerCallDeferred, AnswerCallAlertWithMedia, AnswerCallDeferredWithMedia, AnswerCallProgress, AnswerCallNowAndReleaseCurrent, NumAnswerCallResponses }

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
}

enum | Phases { UninitialisedPhase, SetUpPhase, ProceedingPhase, AlertingPhase, ConnectedPhase, EstablishedPhase, ForwardingPhase, ReleasingPhase, ReleasedPhase, NumPhases }
enum | SendUserInputModes { SendUserInputAsQ931, SendUserInputAsString, SendUserInputAsTone, SendUserInputAsRFC2833, SendUserInputInBand, SendUserInputAsProtocolDefault, NumSendUserInputModes, SendUserInputAsInlineRFC2833 = SendUserInputAsRFC2833 }
Static Public Member Functions inherited from OpalConnection
static PString | GetCallEndReasonText (CallEndReason reason)
static void | SetCallEndReasonText (CallEndReasonCodes reasonCode, const PString &newText)
Protected Types inherited from OpalConnection
enum | { e_NotSwitchingFaxMediaStreams, e_SwitchingToFaxMediaStreams, e_SwitchingFromFaxMediaStreams }

## Detailed Description

Interactive Voice Response connection.

## Constructor & Destructor Documentation

OpalIVRConnection::OpalIVRConnection | ( | OpalCall & | call,
|  | OpalIVREndPoint & | endpoint,
|  | void * | userData,
|  | const PString & | vxml,
|  | unsigned int | options,
|  | OpalConnection::StringOptions * | stringOptions = `NULL`
| ) |  |

Create a new endpoint.

Parameters

  call | Owner calll for connection
  endpoint | Owner endpoint for connection
  userData | Arbitrary data to pass to connection
  vxml | vxml to execute

OpalIVRConnection::~OpalIVRConnection | ( |  | ) |

Destroy endpoint.

## Member Function Documentation

virtual OpalMediaStream* OpalIVRConnection::CreateMediaStream | ( | const OpalMediaFormat & | mediaFormat,
|  | unsigned | sessionID,
|  | PBoolean | isSource
| ) |  |

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.

Parameters

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

Reimplemented from OpalLocalConnection.

virtual PString OpalIVRConnection::GetLocalPartyURL | ( |  | ) | const

virtual

Get the local name/alias.

Reimplemented from OpalConnection.

virtual OpalMediaFormatList OpalIVRConnection::GetMediaFormats | ( |  | ) | const

virtual

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

The default behaviour returns the formats the PSoundChannel can do, typically only PCM-16.

Reimplemented from OpalConnection.

PTextToSpeech* OpalIVRConnection::GetTextToSpeech | ( |  | ) | const

inline

References m_vxmlSession.

const PString& OpalIVRConnection::GetVXML | ( |  | ) | const

inline

References m_vxmlScript.

const OpalVXMLSession& OpalIVRConnection::GetVXMLSession | ( |  | ) | const

inline

References m_vxmlSession.

OpalVXMLSession& OpalIVRConnection::GetVXMLSession | ( |  | ) |

inline

References m_vxmlSession.

virtual bool OpalIVRConnection::IsNetworkConnection | ( |  | ) | const

inline virtual

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.

Reimplemented from OpalLocalConnection.

virtual void OpalIVRConnection::OnEndDialog | ( |  | ) |

virtual

Called when VXML ends. Default action calls equivalent function in OpalIVREndPoint.

void OpalIVRConnection::OnEstablished | ( |  | ) |

virtual

A call back function whenever a connection is "established". This indicates that a connection to an endpoint was established. This usually occurs after OnConnected() and indicates that the connection is both connected and has media flowing.

Reimplemented from OpalConnection.

virtual bool OpalIVRConnection::OnTransferNotify | ( | const PStringToString & | info,
|  | const OpalConnection * | transferringConnection
| ) |  |

virtual

A call back function to monitor the progress of a transfer.

The default behaviour calls the OpalEndPoint function of the same name. The default action of that function is to return false, thereby releasing the connection if the info["result"] == "success".

Parameters

  info | State of the transfer
  transferringConnection | Connection performing transfer, maybe "this"

Reimplemented from OpalConnection.

virtual PBoolean OpalIVRConnection::SendUserInputString | ( | const PString & | value | ) |

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.

Parameters

  value | String value of indication

Reimplemented from OpalLocalConnection.

PTextToSpeech* OpalIVRConnection::SetTextToSpeech | ( | const PString & | ttsName | ) |

inline

References m_vxmlSession.

PTextToSpeech* OpalIVRConnection::SetTextToSpeech | ( | PTextToSpeech * | tts,
|  | PBoolean | autoDelete = `false`
| ) |  |

inline

References m_vxmlSession.

virtual bool OpalIVRConnection::StartScript | ( | const PString & | script | ) |

protected virtual

virtual bool OpalIVRConnection::StartVXML | ( | const PString & | vxml | ) |

protected virtual

virtual bool OpalIVRConnection::TransferConnection | ( | const PString & | remoteParty | ) |

virtual

Initiate the transfer of an existing call (connection) to a new remote party.

If remoteParty is a valid call token, then the remote party is transferred to that party (consultation transfer) and both calls are cleared.

Parameters

  remoteParty | Remote party to transfer the existing call to

Reimplemented from OpalConnection.

## Field Documentation

OpalIVREndPoint& OpalIVRConnection::endpoint

protected

OpalMediaFormatList OpalIVRConnection::m_vxmlMediaFormats

protected

PString OpalIVRConnection::m_vxmlScript

protected

Referenced by GetVXML().

OpalVXMLSession OpalIVRConnection::m_vxmlSession

protected

Referenced by GetTextToSpeech(), GetVXMLSession(), and SetTextToSpeech().

The documentation for this class was generated from the following file:

- ivr.h