vxml.h
Go to the documentation of this file.
/*
* vxml.h
*
* VXML engine for pwlib library
*
* Copyright (C) 2002 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Contributor(s): ______________________________________.
*
* $Revision: 29067 $
* $Author: rjongbloed $
* $Date: 2013-02-11 22:34:39 -0600 (Mon, 11 Feb 2013) $
*/
#ifndef PTLIB_VXML_H
#define PTLIB_VXML_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <ptclib/pxml.h>
#if P_VXML
#include <ptlib/pfactory.h>
#include <ptlib/pipechan.h>
#include <ptclib/delaychan.h>
#include <ptclib/pwavfile.h>
#include <ptclib/ptts.h>
#include <ptclib/url.h>
#include <queue>
class PVXMLSession;
class PVXMLDialog;
class PVXMLSession;
// these are the same strings as the Opal equivalents, but as this is PWLib, we can't use Opal contants
#define VXML_PCM16 "PCM-16"
#define VXML_G7231 "G.723.1"
#define VXML_G729 "G.729"
class PVXMLGrammar : public PObject
{
PCLASSINFO(PVXMLGrammar, PObject);
public:
PVXMLGrammar(PVXMLSession & session, PXMLElement & field);
virtual void OnUserInput(const char ch) = 0;
virtual void Start();
virtual bool Process();
enum GrammarState {
Idle,
Started,
Filled,
NoInput,
NoMatch,
Help
};
GrammarState GetState() const { return m_state; }
void SetTimeout(const PTimeInterval & timeout);
protected:
PDECLARE_NOTIFIER(PTimer, PVXMLGrammar, OnTimeout);
PVXMLSession & m_session;
PXMLElement & m_field;
PString m_value;
GrammarState m_state;
PTimeInterval m_timeout;
PTimer m_timer;
PMutex m_mutex;
};
class PVXMLMenuGrammar : public PVXMLGrammar
{
PCLASSINFO(PVXMLMenuGrammar, PVXMLGrammar);
public:
PVXMLMenuGrammar(PVXMLSession & session, PXMLElement & field);
virtual void OnUserInput(const char ch);
virtual bool Process();
};
class PVXMLDigitsGrammar : public PVXMLGrammar
{
PCLASSINFO(PVXMLDigitsGrammar, PVXMLGrammar);
public:
PVXMLDigitsGrammar(
PVXMLSession & session,
PXMLElement & field,
PINDEX minDigits,
PINDEX maxDigits,
PString terminators
);
virtual void OnUserInput(const char ch);
protected:
PINDEX m_minDigits;
PINDEX m_maxDigits;
PString m_terminators;
};
class PVXMLCache : public PMutex
{
public:
PVXMLCache(const PDirectory & directory);
PFilePath CreateFilename(const PString & prefix, const PString & key, const PString & fileType);
void Put(const PString & prefix,
const PString & key,
const PString & fileType,
const PString & contentType,
const PFilePath & fn,
PFilePath & dataFn);
PBoolean Get(const PString & prefix,
const PString & key,
const PString & fileType,
PString & contentType,
PFilePath & fn);
PFilePath GetCacheDir() const
{ return directory; }
PFilePath GetRandomFilename(const PString & prefix, const PString & fileType);
static PVXMLCache & GetResourceCache();
protected:
PDirectory directory;
};
class PVXMLChannel;
class PVXMLSession : public PIndirectChannel
{
PCLASSINFO(PVXMLSession, PIndirectChannel);
public:
PVXMLSession(PTextToSpeech * tts = NULL, PBoolean autoDelete = false);
virtual ~PVXMLSession();
// new functions
PTextToSpeech * SetTextToSpeech(PTextToSpeech * tts, PBoolean autoDelete = false);
PTextToSpeech * SetTextToSpeech(const PString & ttsName);
PTextToSpeech * GetTextToSpeech() const { return m_textToSpeech; }
virtual PBoolean Load(const PString & source);
virtual PBoolean LoadFile(const PFilePath & file, const PString & firstForm = PString::Empty());
virtual PBoolean LoadURL(const PURL & url);
virtual PBoolean LoadVXML(const PString & xml, const PString & firstForm = PString::Empty());
virtual PBoolean IsLoaded() const { return m_xml.IsLoaded(); }
virtual PBoolean Open(const PString & mediaFormat);
virtual PBoolean Close();
virtual PBoolean Execute();
PVXMLChannel * GetAndLockVXMLChannel();
void UnLockVXMLChannel() { m_sessionMutex.Signal(); }
PMutex & GetSessionMutex() { return m_sessionMutex; }
virtual PBoolean LoadGrammar(PVXMLGrammar * grammar);
virtual PBoolean PlayText(const PString & text, PTextToSpeech::TextType type = PTextToSpeech::Default, PINDEX repeat = 1, PINDEX delay = 0);
PBoolean ConvertTextToFilenameList(const PString & text, PTextToSpeech::TextType type, PStringArray & list, PBoolean useCacheing);
virtual PBoolean PlayFile(const PString & fn, PINDEX repeat = 1, PINDEX delay = 0, PBoolean autoDelete = false);
virtual PBoolean PlayData(const PBYTEArray & data, PINDEX repeat = 1, PINDEX delay = 0);
virtual PBoolean PlayCommand(const PString & data, PINDEX repeat = 1, PINDEX delay = 0);
virtual PBoolean PlayResource(const PURL & url, PINDEX repeat = 1, PINDEX delay = 0);
virtual PBoolean PlayTone(const PString & toneSpec, PINDEX repeat = 1, PINDEX delay = 0);
virtual PBoolean PlayElement(PXMLElement & element);
//virtual PBoolean PlayMedia(const PURL & url, PINDEX repeat = 1, PINDEX delay = 0);
virtual PBoolean PlaySilence(PINDEX msecs = 0);
virtual PBoolean PlaySilence(const PTimeInterval & timeout);
virtual PBoolean PlayStop();
virtual void SetPause(PBoolean pause);
virtual void GetBeepData(PBYTEArray & data, unsigned ms);
virtual PBoolean StartRecording(const PFilePath & fn, PBoolean recordDTMFTerm, const PTimeInterval & recordMaxTime, const PTimeInterval & recordFinalSilence);
virtual PBoolean EndRecording();
virtual void OnUserInput(const PString & str);
PString GetXMLError() const;
virtual void OnEndDialog();
virtual void OnEndSession();
enum TransferType {
BridgedTransfer,
BlindTransfer,
ConsultationTransfer
};
virtual bool OnTransfer(const PString & /*destination*/, TransferType /*type*/) { return false; }
void SetTransferComplete(bool state);
const PStringToString & GetVariables() { return m_variables; }
virtual PCaselessString GetVar(const PString & str) const;
virtual void SetVar(const PString & ostr, const PString & val);
virtual PString EvaluateExpr(const PString & oexpr);
static PTimeInterval StringToTime(const PString & str, int dflt = 0);
virtual PBoolean RetreiveResource(const PURL & url, PString & contentType, PFilePath & fn, PBoolean useCache = true);
PDECLARE_NOTIFIER(PThread, PVXMLSession, VXMLExecute);
bool SetCurrentForm(const PString & id, bool fullURI);
bool GoToEventHandler(PXMLElement & element, const PString & eventName);
// overrides from VXMLChannelInterface
virtual void OnEndRecording();
virtual void Trigger();
virtual PBoolean TraverseAudio(PXMLElement & element);
virtual PBoolean TraverseBreak(PXMLElement & element);
virtual PBoolean TraverseValue(PXMLElement & element);
virtual PBoolean TraverseSayAs(PXMLElement & element);
virtual PBoolean TraverseGoto(PXMLElement & element);
virtual PBoolean TraverseGrammar(PXMLElement & element);
virtual PBoolean TraverseRecord(PXMLElement & element);
virtual PBoolean TraversedRecord(PXMLElement & element);
virtual PBoolean TraverseIf(PXMLElement & element);
virtual PBoolean TraverseExit(PXMLElement & element);
virtual PBoolean TraverseVar(PXMLElement & element);
virtual PBoolean TraverseSubmit(PXMLElement & element);
virtual PBoolean TraverseMenu(PXMLElement & element);
virtual PBoolean TraversedMenu(PXMLElement & element);
virtual PBoolean TraverseChoice(PXMLElement & element);
virtual PBoolean TraverseProperty(PXMLElement & element);
virtual PBoolean TraverseDisconnect(PXMLElement & element);
virtual PBoolean TraverseForm(PXMLElement & element);
virtual PBoolean TraversedForm(PXMLElement & element);
virtual PBoolean TraversePrompt(PXMLElement & element);
virtual PBoolean TraversedPrompt(PXMLElement & element);
virtual PBoolean TraverseField(PXMLElement & element);
virtual PBoolean TraversedField(PXMLElement & element);
virtual PBoolean TraverseTransfer(PXMLElement & element);
virtual PBoolean TraversedTransfer(PXMLElement & element);
__inline PVXMLChannel * GetVXMLChannel() const { return (PVXMLChannel *)readChannel; }
protected:
virtual bool InternalLoadVXML(const PString & xml, const PString & firstForm);
virtual bool ProcessNode();
virtual bool ProcessEvents();
virtual bool ProcessGrammar();
virtual bool NextNode(bool processChildren);
void SayAs(const PString & className, const PString & text);
void SayAs(const PString & className, const PString & text, const PString & voice);
PURL NormaliseResourceName(const PString & src);
PMutex m_sessionMutex;
PURL m_rootURL;
PXML m_xml;
PTextToSpeech * m_textToSpeech;
bool m_autoDeleteTextToSpeech;
PThread * m_vxmlThread;
bool m_abortVXML;
PSyncPoint m_waitForEvent;
PXMLObject * m_currentNode;
bool m_xmlChanged;
bool m_speakNodeData;
bool m_bargeIn;
bool m_bargingIn;
PVXMLGrammar * m_grammar;
char m_defaultMenuDTMF;
PStringToString m_variables;
PString m_variableScope;
std::queue<char> m_userInputQueue;
PMutex m_userInputMutex;
enum {
NotRecording,
RecordingInProgress,
RecordingComplete
} m_recordingStatus;
bool m_recordStopOnDTMF;
enum {
NotTransfering,
TransferInProgress,
TransferFailed,
TransferSuccessful
} m_transferStatus;
PTime m_transferStartTime;
};
class PVXMLRecordable : public PObject
{
PCLASSINFO(PVXMLRecordable, PObject);
public:
PVXMLRecordable();
virtual PBoolean Open(const PString & arg) = 0;
virtual bool OnStart(PVXMLChannel & incomingChannel) = 0;
virtual void OnStop() { }
virtual PBoolean OnFrame(PBoolean /*isSilence*/) { return false; }
void SetFinalSilence(unsigned v)
{ m_finalSilence = v > 0 ? v : 60000; }
unsigned GetFinalSilence()
{ return m_finalSilence; }
void SetMaxDuration(unsigned v)
{ m_maxDuration = v > 0 ? v : 86400000; }
unsigned GetMaxDuration()
{ return m_maxDuration; }
protected:
PSimpleTimer m_silenceTimer;
PSimpleTimer m_recordTimer;
unsigned m_finalSilence;
unsigned m_maxDuration;
};
class PVXMLRecordableFilename : public PVXMLRecordable
{
PCLASSINFO(PVXMLRecordableFilename, PVXMLRecordable);
public:
PBoolean Open(const PString & arg);
bool OnStart(PVXMLChannel & incomingChannel);
PBoolean OnFrame(PBoolean isSilence);
protected:
PFilePath m_fileName;
};
class PVXMLPlayable : public PObject
{
PCLASSINFO(PVXMLPlayable, PObject);
public:
PVXMLPlayable();
virtual PBoolean Open(PVXMLChannel & chan, const PString & arg, PINDEX delay, PINDEX repeat, PBoolean autoDelete);
virtual bool OnStart() = 0;
virtual bool OnRepeat();
virtual bool OnDelay();
virtual void OnStop();
virtual void SetRepeat(PINDEX v)
{ m_repeat = v; }
virtual PINDEX GetRepeat() const
{ return m_repeat; }
virtual PINDEX GetDelay() const
{ return m_delay; }
void SetFormat(const PString & fmt)
{ m_format = fmt; }
void SetSampleFrequency(unsigned rate)
{ m_sampleFrequency = rate; }
friend class PVXMLChannel;
protected:
PVXMLChannel * m_vxmlChannel;
PChannel * m_subChannel;
PINDEX m_repeat;
PINDEX m_delay;
PString m_format;
unsigned m_sampleFrequency;
bool m_autoDelete;
bool m_delayDone; // very tacky flag used to indicate when the post-play delay has been done
};
class PVXMLPlayableStop : public PVXMLPlayable
{
PCLASSINFO(PVXMLPlayableStop, PVXMLPlayable);
public:
virtual bool OnStart();
};
class PVXMLPlayableURL : public PVXMLPlayable
{
PCLASSINFO(PVXMLPlayableURL, PVXMLPlayable);
public:
virtual PBoolean Open(PVXMLChannel & chan, const PString & arg, PINDEX delay, PINDEX repeat, PBoolean autoDelete);
virtual bool OnStart();
protected:
PURL m_url;
};
class PVXMLPlayableData : public PVXMLPlayable
{
PCLASSINFO(PVXMLPlayableData, PVXMLPlayable);
public:
virtual PBoolean Open(PVXMLChannel & chan, const PString & arg, PINDEX delay, PINDEX repeat, PBoolean autoDelete);
void SetData(const PBYTEArray & data);
virtual bool OnStart();
virtual bool OnRepeat();
protected:
PBYTEArray m_data;
};
#include <ptclib/dtmf.h>
class PVXMLPlayableTone : public PVXMLPlayableData
{
PCLASSINFO(PVXMLPlayableTone, PVXMLPlayableData);
public:
virtual PBoolean Open(PVXMLChannel & chan, const PString & arg, PINDEX delay, PINDEX repeat, PBoolean autoDelete);
protected:
PTones m_tones;
};
class PVXMLPlayableCommand : public PVXMLPlayable
{
PCLASSINFO(PVXMLPlayableCommand, PVXMLPlayable);
public:
virtual PBoolean Open(PVXMLChannel & chan, const PString & arg, PINDEX delay, PINDEX repeat, PBoolean autoDelete);
virtual bool OnStart();
virtual void OnStop();
protected:
PString m_command;
};
class PVXMLPlayableFile : public PVXMLPlayable
{
PCLASSINFO(PVXMLPlayableFile, PVXMLPlayable);
public:
virtual PBoolean Open(PVXMLChannel & chan, const PString & arg, PINDEX delay, PINDEX repeat, PBoolean autoDelete);
virtual bool OnStart();
virtual bool OnRepeat();
virtual void OnStop();
protected:
PFilePath m_filePath;
};
class PVXMLPlayableFileList : public PVXMLPlayableFile
{
PCLASSINFO(PVXMLPlayableFileList, PVXMLPlayableFile);
public:
PVXMLPlayableFileList();
virtual PBoolean Open(PVXMLChannel & chan, const PString & arg, PINDEX delay, PINDEX repeat, PBoolean autoDelete);
virtual PBoolean Open(PVXMLChannel & chan, const PStringArray & filenames, PINDEX delay, PINDEX repeat, PBoolean autoDelete);
virtual bool OnStart();
virtual bool OnRepeat();
virtual void OnStop();
protected:
PStringArray m_fileNames;
PINDEX m_currentIndex;
};
PQUEUE(PVXMLQueue, PVXMLPlayable);
class PVXMLChannel : public PDelayChannel
{
PCLASSINFO(PVXMLChannel, PDelayChannel);
public:
PVXMLChannel(unsigned frameDelay, PINDEX frameSize);
~PVXMLChannel();
virtual PBoolean Open(PVXMLSession * session);
// overrides from PIndirectChannel
virtual PBoolean IsOpen() const;
virtual PBoolean Close();
virtual PBoolean Read(void * buffer, PINDEX amount);
virtual PBoolean Write(const void * buf, PINDEX len);
// new functions
virtual PWAVFile * CreateWAVFile(const PFilePath & fn, PBoolean recording = false);
const PString & GetMediaFormat() const { return mediaFormat; }
PBoolean IsMediaPCM() const { return mediaFormat == "PCM-16"; }
virtual PString AdjustWavFilename(const PString & fn);
// Incoming channel functions
virtual PBoolean WriteFrame(const void * buf, PINDEX len) = 0;
virtual PBoolean IsSilenceFrame(const void * buf, PINDEX len) const = 0;
virtual PBoolean QueueRecordable(PVXMLRecordable * newItem);
PBoolean StartRecording(const PFilePath & fn, unsigned finalSilence = 3000, unsigned maxDuration = 30000);
PBoolean EndRecording();
PBoolean IsRecording() const { return m_recordable != NULL; }
// Outgoing channel functions
virtual PBoolean ReadFrame(void * buffer, PINDEX amount) = 0;
virtual PINDEX CreateSilenceFrame(void * buffer, PINDEX amount) = 0;
virtual void GetBeepData(PBYTEArray &, unsigned) { }
virtual PBoolean QueueResource(const PURL & url, PINDEX repeat= 1, PINDEX delay = 0);
virtual PBoolean QueuePlayable(const PString & type, const PString & str, PINDEX repeat = 1, PINDEX delay = 0, PBoolean autoDelete = false);
virtual PBoolean QueuePlayable(PVXMLPlayable * newItem);
virtual PBoolean QueueData(const PBYTEArray & data, PINDEX repeat = 1, PINDEX delay = 0);
virtual PBoolean QueueFile(const PString & fn, PINDEX repeat = 1, PINDEX delay = 0, PBoolean autoDelete = false)
{ return QueuePlayable("File", fn, repeat, delay, autoDelete); }
virtual PBoolean QueueCommand(const PString & cmd, PINDEX repeat = 1, PINDEX delay = 0)
{ return QueuePlayable("Command", cmd, repeat, delay, true); }
virtual void FlushQueue();
virtual PBoolean IsPlaying() const { return m_currentPlayItem != NULL || m_playQueue.GetSize() > 0; }
void SetPause(PBoolean pause) { m_paused = pause; }
unsigned GetSampleFrequency() const { return m_sampleFrequency; }
void SetSilence(unsigned msecs);
protected:
PVXMLSession * m_vxmlSession;
unsigned m_sampleFrequency;
PString mediaFormat;
PString wavFilePrefix;
PMutex m_channelWriteMutex;
PMutex m_channelReadMutex;
bool m_closed;
bool m_paused;
PINDEX m_totalData;
// Incoming audio variables
PVXMLRecordable * m_recordable;
unsigned m_finalSilence;
unsigned m_silenceRun;
// Outgoing audio variables
PVXMLQueue m_playQueue;
PVXMLPlayable * m_currentPlayItem;
PSimpleTimer m_silenceTimer;
};
class PVXMLNodeHandler : public PObject
{
PCLASSINFO(PVXMLNodeHandler, PObject);
public:
// Return true for process node, false to skip and move to next sibling
virtual bool Start(PVXMLSession & /*session*/, PXMLElement & /*node*/) const { return true; }
// Return true to move to next sibling, false to stay at this node.
virtual bool Finish(PVXMLSession & /*session*/, PXMLElement & /*node*/) const { return true; }
};
typedef PFactory<PVXMLNodeHandler, PCaselessString> PVXMLNodeFactory;
#endif // P_VXML
#endif // PTLIB_VXML_H
// End of file ////////////////////////////////////////////////////////////////
PVXMLSession::m_defaultMenuDTMF
char m_defaultMenuDTMF
Definition: vxml.h:315
PVXMLDigitsGrammar::m_maxDigits
PINDEX m_maxDigits
Definition: vxml.h:129
PVXMLGrammar::SetTimeout
void SetTimeout(const PTimeInterval &timeout)
PVXMLGrammar::Process
virtual bool Process()
PVXMLGrammar::Help
help keyword
Definition: vxml.h:79
PVXMLSession::m_xml
PXML m_xml
Definition: vxml.h:300
PVXMLPlayableTone::m_tones
PTones m_tones
Definition: vxml.h:476
PVXMLSession
Definition: vxml.h:171
PVXMLChannel::m_currentPlayItem
PVXMLPlayable * m_currentPlayItem
Definition: vxml.h:608
PVXMLSession::m_xmlChanged
bool m_xmlChanged
Definition: vxml.h:309
PVXMLNodeHandler::Finish
virtual bool Finish(PVXMLSession &, PXMLElement &) const
Definition: vxml.h:623
PTimeInterval
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
PVXMLSession::RecordingInProgress
Definition: vxml.h:325
PVXMLRecordable
Definition: vxml.h:342
PQUEUE
PQUEUE(PVXMLQueue, PVXMLPlayable)
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PVXMLPlayableTone
Definition: vxml.h:470
PVXMLSession::m_currentNode
PXMLObject * m_currentNode
Definition: vxml.h:308
pfactory.h
PVXMLGrammar::m_timer
PTimer m_timer
Definition: vxml.h:94
PVXMLPlayable::m_sampleFrequency
unsigned m_sampleFrequency
Definition: vxml.h:426
PVXMLSession::TransferType
TransferType
Definition: vxml.h:229
PTime
This class defines an absolute time and date.
Definition: ptime.h:53
PVXMLPlayable::SetFormat
void SetFormat(const PString &fmt)
Definition: vxml.h:412
PWAVFile
A class representing a WAV audio file.
Definition: pwavfile.h:172
PVXMLChannel::m_silenceRun
unsigned m_silenceRun
Definition: vxml.h:604
PVXMLSession::IsLoaded
virtual PBoolean IsLoaded() const
Definition: vxml.h:187
PTones
This class can be used to generate PCM data for tones (such as telephone calling tones and DTMF) at a...
Definition: dtmf.h:102
PVXMLPlayableFileList
Definition: vxml.h:509
PStringToString
This is a dictionary collection class of PString objects, keyed by another string.
Definition: pstring.h:2784
PFilePath
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
PVXMLSession::NotRecording
Definition: vxml.h:324
PIndirectChannel
This is a channel that operates indirectly through another channel(s).
Definition: indchan.h:49
PVXMLGrammar::m_timeout
PTimeInterval m_timeout
Definition: vxml.h:93
PVXMLGrammar::Filled
got something that matched the grammar
Definition: vxml.h:76
PCaselessString
This class is a variation of a string that ignores case.
Definition: pstring.h:1708
PVXMLChannel::GetSampleFrequency
unsigned GetSampleFrequency() const
Definition: vxml.h:584
PVXMLPlayableCommand::m_command
PString m_command
Definition: vxml.h:490
PVXMLGrammar::GrammarState
GrammarState
Definition: vxml.h:73
PVXMLRecordable::m_maxDuration
unsigned m_maxDuration
Definition: vxml.h:371
PVXMLChannel::m_sampleFrequency
unsigned m_sampleFrequency
Definition: vxml.h:591
PVXMLChannel::IsMediaPCM
PBoolean IsMediaPCM() const
Definition: vxml.h:549
PStringArray
This is an array collection class of PString objects.
Definition: pstring.h:2024
PVXMLCache::directory
PDirectory directory
Definition: vxml.h:164
PVXMLChannel::GetMediaFormat
const PString & GetMediaFormat() const
Definition: vxml.h:548
PVXMLRecordable::SetMaxDuration
void SetMaxDuration(unsigned v)
Definition: vxml.h:361
PVXMLChannel::m_playQueue
PVXMLQueue m_playQueue
Definition: vxml.h:607
PVXMLPlayable::m_autoDelete
bool m_autoDelete
Definition: vxml.h:427
PVXMLPlayable::m_delay
PINDEX m_delay
Definition: vxml.h:424
PVXMLChannel::IsPlaying
virtual PBoolean IsPlaying() const
Definition: vxml.h:580
pipechan.h
PXML
Definition: pxml.h:114
PVXMLSession::m_recordStopOnDTMF
bool m_recordStopOnDTMF
Definition: vxml.h:328
PVXMLChannel::mediaFormat
PString mediaFormat
Definition: vxml.h:592
PVXMLRecordable::SetFinalSilence
void SetFinalSilence(unsigned v)
Definition: vxml.h:355
PTimer
A class representing a system timer.
Definition: timer.h:181
PVXMLChannel::m_channelWriteMutex
PMutex m_channelWriteMutex
Definition: vxml.h:595
PBoolean
BOOL PBoolean
Definition: object.h:102
PDirectory
Class to represent a directory in the operating system file system.
Definition: pdirect.h:182
PVXMLPlayable::m_format
PString m_format
Definition: vxml.h:425
PVXMLSession::TransferFailed
Definition: vxml.h:333
PVXMLSession::m_vxmlThread
PThread * m_vxmlThread
Definition: vxml.h:305
PVXMLChannel::m_finalSilence
unsigned m_finalSilence
Definition: vxml.h:603
PVXMLRecordable::GetFinalSilence
unsigned GetFinalSilence()
Definition: vxml.h:358
PVXMLPlayable::m_subChannel
PChannel * m_subChannel
Definition: vxml.h:422
pwavfile.h
PVXMLNodeHandler::Start
virtual bool Start(PVXMLSession &, PXMLElement &) const
Definition: vxml.h:620
PVXMLSession::GetVariables
const PStringToString & GetVariables()
Definition: vxml.h:237
PVXMLPlayableURL
Definition: vxml.h:442
PBYTEArray
Array of unsigned characters.
Definition: array.h:670
PVXMLSession::GetVXMLChannel
__inline PVXMLChannel * GetVXMLChannel() const
Definition: vxml.h:282
PVXMLGrammar::m_session
PVXMLSession & m_session
Definition: vxml.h:89
PDelayChannel
Class for implementing a "delay line" channel.
Definition: delaychan.h:134
PVXMLSession::m_textToSpeech
PTextToSpeech * m_textToSpeech
Definition: vxml.h:302
PVXMLChannel::SetPause
void SetPause(PBoolean pause)
Definition: vxml.h:582
PVXMLGrammar::m_field
PXMLElement & m_field
Definition: vxml.h:90
PVXMLCache::GetCacheDir
PFilePath GetCacheDir() const
Definition: vxml.h:156
PVXMLPlayable::GetDelay
virtual PINDEX GetDelay() const
Definition: vxml.h:409
PVXMLPlayable
Definition: vxml.h:390
PVXMLGrammar::m_state
GrammarState m_state
Definition: vxml.h:92
PVXMLRecordable::GetMaxDuration
unsigned GetMaxDuration()
Definition: vxml.h:364
PVXMLGrammar::NoInput
timeout or still waiting to match
Definition: vxml.h:77
PVXMLChannel::m_closed
bool m_closed
Definition: vxml.h:597
PVXMLGrammar::m_mutex
PMutex m_mutex
Definition: vxml.h:95
PVXMLPlayable::m_vxmlChannel
PVXMLChannel * m_vxmlChannel
Definition: vxml.h:421
PVXMLSession::NotTransfering
Definition: vxml.h:331
PVXMLSession::m_userInputMutex
PMutex m_userInputMutex
Definition: vxml.h:321
PVXMLSession::UnLockVXMLChannel
void UnLockVXMLChannel()
Definition: vxml.h:195
PVXMLGrammar::m_value
PString m_value
Definition: vxml.h:91
PVXMLSession::TransferInProgress
Definition: vxml.h:332
PChannel
Abstract class defining I/O channel semantics.
Definition: channel.h:107
PVXMLDigitsGrammar
Definition: vxml.h:113
PVXMLChannel::m_totalData
PINDEX m_totalData
Definition: vxml.h:599
PVXMLChannel::QueueCommand
virtual PBoolean QueueCommand(const PString &cmd, PINDEX repeat=1, PINDEX delay=0)
Definition: vxml.h:576
PVXMLPlayableFile
Definition: vxml.h:495
PVXMLRecordableFilename::m_fileName
PFilePath m_fileName
Definition: vxml.h:385
PVXMLSession::m_autoDeleteTextToSpeech
bool m_autoDeleteTextToSpeech
Definition: vxml.h:303
PVXMLSession::m_sessionMutex
PMutex m_sessionMutex
Definition: vxml.h:297
PString
The character string class.
Definition: pstring.h:108
PVXMLSession::m_bargingIn
bool m_bargingIn
Definition: vxml.h:312
PVXMLPlayable::GetRepeat
virtual PINDEX GetRepeat() const
Definition: vxml.h:406
PVXMLSession::m_variables
PStringToString m_variables
Definition: vxml.h:317
PVXMLSession::GetSessionMutex
PMutex & GetSessionMutex()
Definition: vxml.h:196
PVXMLGrammar::Idle
Not yet started.
Definition: vxml.h:74
PVXMLRecordableFilename
Definition: vxml.h:376
PXMLElement
Definition: pxml.h:353
PString::Empty
static PString Empty()
Return an empty string.
PVXMLPlayable::SetSampleFrequency
void SetSampleFrequency(unsigned rate)
Definition: vxml.h:415
PVXMLSession::OnTransfer
virtual bool OnTransfer(const PString &, TransferType)
Definition: vxml.h:234
PVXMLPlayableCommand
Definition: vxml.h:481
dtmf.h
PVXMLSession::m_userInputQueue
std::queue< char > m_userInputQueue
Definition: vxml.h:320
PVXMLChannel::wavFilePrefix
PString wavFilePrefix
Definition: vxml.h:593
PVXMLGrammar::NoMatch
recognized something but didn&#39;t match the grammar
Definition: vxml.h:78
PVXMLChannel::m_recordable
PVXMLRecordable * m_recordable
Definition: vxml.h:602
PVXMLNodeHandler
Definition: vxml.h:615
PVXMLSession::m_rootURL
PURL m_rootURL
Definition: vxml.h:299
PThread
This class defines a thread of execution in the system.
Definition: thread.h:66
PVXMLSession::GetTextToSpeech
PTextToSpeech * GetTextToSpeech() const
Definition: vxml.h:181
PVXMLCache
Definition: vxml.h:136
PVXMLGrammar::OnUserInput
virtual void OnUserInput(const char ch)=0
PVXMLRecordable::OnStop
virtual void OnStop()
Definition: vxml.h:351
PVXMLPlayableData
Definition: vxml.h:454
PVXMLGrammar::Start
virtual void Start()
PVXMLGrammar::PDECLARE_NOTIFIER
PDECLARE_NOTIFIER(PTimer, PVXMLGrammar, OnTimeout)
PVXMLRecordable::m_finalSilence
unsigned m_finalSilence
Definition: vxml.h:370
PVXMLGrammar::Started
Grammar awaiting input.
Definition: vxml.h:75
PFactory
Template class for generic factories of an abstract class.
Definition: pfactory.h:144
PVXMLChannel
Definition: vxml.h:530
PVXMLGrammar::PVXMLGrammar
PVXMLGrammar(PVXMLSession &session, PXMLElement &field)
PVXMLPlayableFileList::m_fileNames
PStringArray m_fileNames
Definition: vxml.h:520
PVXMLRecordable::m_silenceTimer
PSimpleTimer m_silenceTimer
Definition: vxml.h:368
PVXMLSession::m_bargeIn
bool m_bargeIn
Definition: vxml.h:311
PVXMLChannel::GetBeepData
virtual void GetBeepData(PBYTEArray &, unsigned)
Definition: vxml.h:565
PVXMLSession::m_waitForEvent
PSyncPoint m_waitForEvent
Definition: vxml.h:307
PVXMLNodeFactory
PFactory< PVXMLNodeHandler, PCaselessString > PVXMLNodeFactory
Definition: vxml.h:627
pxml.h
PVXMLChannel::m_channelReadMutex
PMutex m_channelReadMutex
Definition: vxml.h:596
PVXMLSession::BlindTransfer
Definition: vxml.h:231
PSimpleTimer
A class represeting a simple timer.
Definition: timer.h:58
PVXMLPlayableData::m_data
PBYTEArray m_data
Definition: vxml.h:463
PVXMLPlayableFileList::m_currentIndex
PINDEX m_currentIndex
Definition: vxml.h:521
PMutex
Synonym for PTimedMutex.
PVXMLChannel::m_silenceTimer
PSimpleTimer m_silenceTimer
Definition: vxml.h:609
PVXMLGrammar
Definition: vxml.h:63
PVXMLSession::m_abortVXML
bool m_abortVXML
Definition: vxml.h:306
PVXMLDigitsGrammar::m_minDigits
PINDEX m_minDigits
Definition: vxml.h:128
PVXMLPlayable::m_delayDone
bool m_delayDone
Definition: vxml.h:428
PVXMLSession::m_transferStartTime
PTime m_transferStartTime
Definition: vxml.h:336
PVXMLSession::m_grammar
PVXMLGrammar * m_grammar
Definition: vxml.h:314
PVXMLChannel::QueueFile
virtual PBoolean QueueFile(const PString &fn, PINDEX repeat=1, PINDEX delay=0, PBoolean autoDelete=false)
Definition: vxml.h:573
PVXMLPlayableStop
Definition: vxml.h:433
PVXMLPlayable::m_repeat
PINDEX m_repeat
Definition: vxml.h:423
PVXMLPlayableFile::m_filePath
PFilePath m_filePath
Definition: vxml.h:504
PVXMLChannel::IsRecording
PBoolean IsRecording() const
Definition: vxml.h:560
delaychan.h
url.h
PObject
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PSyncPoint
This class defines a thread synchronisation object.
Definition: syncpoint.h:67
PVXMLRecordable::OnFrame
virtual PBoolean OnFrame(PBoolean)
Definition: vxml.h:353
PVXMLChannel::m_vxmlSession
PVXMLSession * m_vxmlSession
Definition: vxml.h:589
PURL
This class describes a Universal Resource Locator.
Definition: url.h:54
PVXMLSession::m_speakNodeData
bool m_speakNodeData
Definition: vxml.h:310
PVXMLGrammar::GetState
GrammarState GetState() const
Definition: vxml.h:82
PXMLObject
Definition: pxml.h:296
PVXMLRecordable::m_recordTimer
PSimpleTimer m_recordTimer
Definition: vxml.h:369
PVXMLSession::BridgedTransfer
Definition: vxml.h:230
PVXMLPlayableURL::m_url
PURL m_url
Definition: vxml.h:449
PVXMLPlayable::SetRepeat
virtual void SetRepeat(PINDEX v)
Definition: vxml.h:403
ptts.h
PVXMLSession::m_variableScope
PString m_variableScope
Definition: vxml.h:318
PVXMLChannel::m_paused
bool m_paused
Definition: vxml.h:598
PVXMLDigitsGrammar::m_terminators
PString m_terminators
Definition: vxml.h:130