#include <ivr.h>
Inheritance diagram for OpalIVREndPoint:
Public Member Functions | |
Construction | |
OpalIVREndPoint (OpalManager &manager, const char *prefix="ivr") | |
~OpalIVREndPoint () | |
Overrides from OpalEndPoint | |
virtual PSafePtr< OpalConnection > | MakeConnection (OpalCall &call, const PString &party, void *userData=NULL, unsigned int options=0, OpalConnection::StringOptions *stringOptions=NULL) |
virtual OpalMediaFormatList | GetMediaFormats () const |
Customisation call backs | |
virtual OpalIVRConnection * | CreateConnection (OpalCall &call, void *userData, const PString &vxml, unsigned int options, OpalConnection::StringOptions *stringOptions=NULL) |
Options and configuration | |
PSafePtr< OpalIVRConnection > | GetIVRConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite) |
const PString & | GetDefaultVXML () const |
void | SetDefaultVXML (const PString &vxml) |
void | SetDefaultMediaFormats (const OpalMediaFormatList &formats) |
virtual PBoolean | StartVXML () |
void | SetDefaultTextToSpeech (const PString &tts) |
PString | GetDefaultTextToSpeech () const |
Protected Attributes | |
PString | defaultVXML |
OpalMediaFormatList | defaultMediaFormats |
PString | defaultTts |
The script, set via the OpalIVREndPoint::SetDefaultVXML() function, or presented after the "ivr:" in the URI string used to make the call, may be any of the following:
VXML script, in which case it MUST start with "<?xml" or "<vxml".
A file path with the extension .vxml, the VSM script is read from that file.
A file URI for a .vxml file as above.
A file URI for a .WAV file, the WAV file is played and the connection is released.
Or a series of simple separated by ';'. The commands are:
repeat=n Repeat next WAV file or Speak command n times. delay=n Delay after repeats n milliseconds. voice=name Set Text To Speech voice to name tone=t Emit DTMF tone t silence=n Emit silence for n milliseconds speak=text Speak the text using the Text To Speech system. speak=$var Speak the internal variable using the Text To Speech system. file:///x.wav File URI for WAV file to play.
Variables may be one of: Time Originator-Address Remote-Address Source-IP-Address
OpalIVREndPoint::OpalIVREndPoint | ( | OpalManager & | manager, | |
const char * | prefix = "ivr" | |||
) |
Create a new endpoint.
manager | Manager of all endpoints. |
prefix | Prefix for URL style address strings |
OpalIVREndPoint::~OpalIVREndPoint | ( | ) |
Destroy endpoint.
virtual OpalIVRConnection* OpalIVREndPoint::CreateConnection | ( | OpalCall & | call, | |
void * | userData, | |||
const PString & | vxml, | |||
unsigned int | options, | |||
OpalConnection::StringOptions * | stringOptions = NULL | |||
) | [virtual] |
Create a connection for the PCSS endpoint. The default implementation is to create a OpalPCSSConnection.
call | Owner of connection |
userData | Arbitrary data to pass to connection |
vxml | vxml to execute |
PString OpalIVREndPoint::GetDefaultTextToSpeech | ( | ) | const [inline] |
const PString& OpalIVREndPoint::GetDefaultVXML | ( | ) | const [inline] |
Get the default VXML to use.
PSafePtr<OpalIVRConnection> OpalIVREndPoint::GetIVRConnectionWithLock | ( | const PString & | token, | |
PSafetyMode | mode = PSafeReadWrite | |||
) | [inline] |
Find a connection that uses the specified token. This searches the endpoint for the connection that contains the token as provided by functions such as MakeConnection().
token | Token to identify connection |
virtual OpalMediaFormatList OpalIVREndPoint::GetMediaFormats | ( | ) | const [virtual] |
Get the data formats this endpoint is capable of operating. This provides a list of media data format names that may be used by an OpalMediaStream may be created by a connection from this endpoint.
Note that a specific connection may not actually support all of the media formats returned here, but should return no more.
The default behaviour is pure.
Reimplemented from OpalLocalEndPoint.
virtual PSafePtr<OpalConnection> OpalIVREndPoint::MakeConnection | ( | OpalCall & | call, | |
const PString & | party, | |||
void * | userData = NULL , |
|||
unsigned int | options = 0 , |
|||
OpalConnection::StringOptions * | stringOptions = NULL | |||
) | [virtual] |
Set up a connection to a remote party. This is called from the OpalManager::MakeConnection() function once it has determined that this is the endpoint for the protocol.
The general form for this party parameter is:
[proto:][alias@][transport$]address[:port]
where the various fields will have meanings specific to the endpoint type. For example, with H.323 it could be "h323:Fred@site.com" which indicates a user Fred at gatekeeper size.com. Whereas for the PSTN endpoint it could be "pstn:5551234" which is to call 5551234 on the first available PSTN line.
The proto field is optional when passed to a specific endpoint. If it is present, however, it must agree with the endpoints protocol name or PFalse is returned.
This function usually returns almost immediately with the connection continuing to occur in a new background thread.
If PFalse is returned then the connection could not be established. For example if a PSTN endpoint is used and the assiciated line is engaged then it may return immediately. Returning a non-NULL value does not mean that the connection will succeed, only that an attempt is being made.
The default behaviour is pure.
call | Owner of connection |
party | Remote party to call |
userData | Arbitrary data to pass to connection |
options | options to pass to conneciton |
Reimplemented from OpalLocalEndPoint.
void OpalIVREndPoint::SetDefaultMediaFormats | ( | const OpalMediaFormatList & | formats | ) |
Set the default media formats for all connections using VXML.
void OpalIVREndPoint::SetDefaultTextToSpeech | ( | const PString & | tts | ) | [inline] |
Set/get the default text to speech engine used by the IVR
void OpalIVREndPoint::SetDefaultVXML | ( | const PString & | vxml | ) |
Set the default VXML to use.
virtual PBoolean OpalIVREndPoint::StartVXML | ( | ) | [virtual] |
Called when a call needs to start the outgoing VXML. This can be used to do different behaviour
PString OpalIVREndPoint::defaultTts [protected] |
PString OpalIVREndPoint::defaultVXML [protected] |