# PVXMLSession Class Reference

`#include <vxml.h>`

Inheritance diagram for PVXMLSession:

List of all members.

## Public Types

| BridgedTransfer
| BlindTransfer
| ConsultationTransfer
enum | TransferType { BridgedTransfer, BlindTransfer, ConsultationTransfer }

## Public Member Functions

| PVXMLSession (PTextToSpeech *tts=NULL, PBoolean autoDelete=false)
virtual | ~PVXMLSession ()
PTextToSpeech * | SetTextToSpeech (PTextToSpeech *tts, PBoolean autoDelete=false)
PTextToSpeech * | SetTextToSpeech (const PString &ttsName)
PTextToSpeech * | GetTextToSpeech () const
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
virtual PBoolean | Open (const PString &mediaFormat)
virtual PBoolean | Close ()
| Close the channel.
virtual PBoolean | Execute ()
PVXMLChannel * | GetAndLockVXMLChannel ()
void | UnLockVXMLChannel ()
PMutex & | GetSessionMutex ()
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 | 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 ()
virtual bool | OnTransfer (const PString &, TransferType)
void | SetTransferComplete (bool state)
const PStringToString & | GetVariables ()
virtual PCaselessString | GetVar (const PString &str) const
virtual void | SetVar (const PString &ostr, const PString &val)
virtual PString | EvaluateExpr (const PString &oexpr)
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)
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

## Static Public Member Functions

static PTimeInterval | StringToTime (const PString &str, int dflt=0)

## Protected Types

| NotRecording
| RecordingInProgress
| RecordingComplete
| NotTransfering
| TransferInProgress
| TransferFailed
| TransferSuccessful
enum | { NotRecording, RecordingInProgress, RecordingComplete }
enum | { NotTransfering, TransferInProgress, TransferFailed, TransferSuccessful }

## Protected Member Functions

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)

## Protected Attributes

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 PVXMLSession:: { ... } | m_recordingStatus
bool | m_recordStopOnDTMF
enum PVXMLSession:: { ... } | m_transferStatus
PTime | m_transferStartTime

## Member Enumeration Documentation

anonymous enum`[protected]`

Enumerator:

  NotRecording |
  RecordingInProgress |
  RecordingComplete |

anonymous enum`[protected]`

Enumerator:

  NotTransfering |
  TransferInProgress |
  TransferFailed |
  TransferSuccessful |

enum PVXMLSession::TransferType

Enumerator:

  BridgedTransfer |
  BlindTransfer |
  ConsultationTransfer |

## Constructor & Destructor Documentation

PVXMLSession::PVXMLSession | ( | PTextToSpeech * | tts = `NULL`,
|  | PBoolean | autoDelete = `false` |
| ) |  |  |

virtual PVXMLSession::~PVXMLSession | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual PBoolean PVXMLSession::Close | ( |  | ) | `[virtual]`

Close the channel.

This will detach itself from the read and write channels and delete both of them if they are auto delete.

Returns:
  true if the channel is closed.

Reimplemented from PIndirectChannel.

PBoolean PVXMLSession::ConvertTextToFilenameList | ( | const PString & | text,
|  | PTextToSpeech::TextType | type,
|  | PStringArray & | list,
|  | PBoolean | useCacheing |
| ) |  |  |

virtual PBoolean PVXMLSession::EndRecording | ( |  | ) | `[virtual]`

virtual PString PVXMLSession::EvaluateExpr | ( | const PString & | oexpr | ) | `[virtual]`

virtual PBoolean PVXMLSession::Execute | ( |  | ) | `[virtual]`

PVXMLChannel* PVXMLSession::GetAndLockVXMLChannel | ( |  | ) |

virtual void PVXMLSession::GetBeepData | ( | PBYTEArray & | data,
|  | unsigned | ms |
| ) |  |  | `[virtual]`

PMutex& PVXMLSession::GetSessionMutex | ( |  | ) | `[inline]`

PTextToSpeech* PVXMLSession::GetTextToSpeech | ( |  | ) | const`[inline]`

virtual PCaselessString PVXMLSession::GetVar | ( | const PString & | str | ) | const`[virtual]`

const PStringToString& PVXMLSession::GetVariables | ( |  | ) | `[inline]`

__inline PVXMLChannel* PVXMLSession::GetVXMLChannel | ( |  | ) | const`[inline]`

PString PVXMLSession::GetXMLError | ( |  | ) | const

bool PVXMLSession::GoToEventHandler | ( | PXMLElement & | element,
|  | const PString & | eventName |
| ) |  |  |

virtual bool PVXMLSession::InternalLoadVXML | ( | const PString & | xml,
|  | const PString & | firstForm |
| ) |  |  | `[protected, virtual]`

virtual PBoolean PVXMLSession::IsLoaded | ( |  | ) | const`[inline, virtual]`

virtual PBoolean PVXMLSession::Load | ( | const PString & | source | ) | `[virtual]`

virtual PBoolean PVXMLSession::LoadFile | ( | const PFilePath & | file,
|  | const PString & | firstForm = `PString::Empty()` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLSession::LoadGrammar | ( | PVXMLGrammar * | grammar | ) | `[virtual]`

virtual PBoolean PVXMLSession::LoadURL | ( | const PURL & | url | ) | `[virtual]`

virtual PBoolean PVXMLSession::LoadVXML | ( | const PString & | xml,
|  | const PString & | firstForm = `PString::Empty()` |
| ) |  |  | `[virtual]`

virtual bool PVXMLSession::NextNode | ( | bool | processChildren | ) | `[protected, virtual]`

PURL PVXMLSession::NormaliseResourceName | ( | const PString & | src | ) | `[protected]`

virtual void PVXMLSession::OnEndDialog | ( |  | ) | `[virtual]`

virtual void PVXMLSession::OnEndRecording | ( |  | ) | `[virtual]`

virtual void PVXMLSession::OnEndSession | ( |  | ) | `[virtual]`

virtual bool PVXMLSession::OnTransfer | ( | const PString & | ,
|  | TransferType |  |
| ) |  |  | `[inline, virtual]`

virtual void PVXMLSession::OnUserInput | ( | const PString & | str | ) | `[virtual]`

virtual PBoolean PVXMLSession::Open | ( | const PString & | mediaFormat | ) | `[virtual]`

PVXMLSession::PDECLARE_NOTIFIER | ( | PThread | ,
|  | PVXMLSession | ,
|  | VXMLExecute |  |
| ) |  |  |

virtual PBoolean PVXMLSession::PlayCommand | ( | const PString & | data,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLSession::PlayData | ( | const PBYTEArray & | data,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLSession::PlayElement | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::PlayFile | ( | const PString & | fn,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0`,
|  | PBoolean | autoDelete = `false` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLSession::PlayResource | ( | const PURL & | url,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLSession::PlaySilence | ( | const PTimeInterval & | timeout | ) | `[virtual]`

virtual PBoolean PVXMLSession::PlaySilence | ( | PINDEX | msecs = `0` | ) | `[virtual]`

virtual PBoolean PVXMLSession::PlayStop | ( |  | ) | `[virtual]`

virtual PBoolean PVXMLSession::PlayText | ( | const PString & | text,
|  | PTextToSpeech::TextType | type = `PTextToSpeech::Default`,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLSession::PlayTone | ( | const PString & | toneSpec,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0` |
| ) |  |  | `[virtual]`

virtual bool PVXMLSession::ProcessEvents | ( |  | ) | `[protected, virtual]`

virtual bool PVXMLSession::ProcessGrammar | ( |  | ) | `[protected, virtual]`

virtual bool PVXMLSession::ProcessNode | ( |  | ) | `[protected, virtual]`

virtual PBoolean PVXMLSession::RetreiveResource | ( | const PURL & | url,
|  | PString & | contentType,
|  | PFilePath & | fn,
|  | PBoolean | useCache = `true` |
| ) |  |  | `[virtual]`

void PVXMLSession::SayAs | ( | const PString & | className,
|  | const PString & | text,
|  | const PString & | voice |
| ) |  |  | `[protected]`

void PVXMLSession::SayAs | ( | const PString & | className,
|  | const PString & | text |
| ) |  |  | `[protected]`

bool PVXMLSession::SetCurrentForm | ( | const PString & | id,
|  | bool | fullURI |
| ) |  |  |

virtual void PVXMLSession::SetPause | ( | PBoolean | pause | ) | `[virtual]`

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

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

void PVXMLSession::SetTransferComplete | ( | bool | state | ) |

virtual void PVXMLSession::SetVar | ( | const PString & | ostr,
|  | const PString & | val |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLSession::StartRecording | ( | const PFilePath & | fn,
|  | PBoolean | recordDTMFTerm,
|  | const PTimeInterval & | recordMaxTime,
|  | const PTimeInterval & | recordFinalSilence |
| ) |  |  | `[virtual]`

static PTimeInterval PVXMLSession::StringToTime | ( | const PString & | str,
|  | int | dflt = `0` |
| ) |  |  | `[static]`

virtual PBoolean PVXMLSession::TraverseAudio | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseBreak | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseChoice | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraversedField | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraversedForm | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseDisconnect | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraversedMenu | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraversedPrompt | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraversedRecord | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraversedTransfer | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseExit | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseField | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseForm | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseGoto | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseGrammar | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseIf | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseMenu | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraversePrompt | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseProperty | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseRecord | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseSayAs | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseSubmit | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseTransfer | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseValue | ( | PXMLElement & | element | ) | `[virtual]`

virtual PBoolean PVXMLSession::TraverseVar | ( | PXMLElement & | element | ) | `[virtual]`

virtual void PVXMLSession::Trigger | ( |  | ) | `[virtual]`

void PVXMLSession::UnLockVXMLChannel | ( |  | ) | `[inline]`

## Member Data Documentation

bool PVXMLSession::m_abortVXML `[protected]`

bool PVXMLSession::m_autoDeleteTextToSpeech `[protected]`

bool PVXMLSession::m_bargeIn `[protected]`

bool PVXMLSession::m_bargingIn `[protected]`

PXMLObject* PVXMLSession::m_currentNode `[protected]`

char PVXMLSession::m_defaultMenuDTMF `[protected]`

PVXMLGrammar* PVXMLSession::m_grammar `[protected]`

enum { ... } PVXMLSession::m_recordingStatus `[protected]`

bool PVXMLSession::m_recordStopOnDTMF `[protected]`

PURL PVXMLSession::m_rootURL `[protected]`

PMutex PVXMLSession::m_sessionMutex `[protected]`

bool PVXMLSession::m_speakNodeData `[protected]`

PTextToSpeech* PVXMLSession::m_textToSpeech `[protected]`

PTime PVXMLSession::m_transferStartTime `[protected]`

enum { ... } PVXMLSession::m_transferStatus `[protected]`

PMutex PVXMLSession::m_userInputMutex `[protected]`

std::queue<char> PVXMLSession::m_userInputQueue `[protected]`

PStringToString PVXMLSession::m_variables `[protected]`

PString PVXMLSession::m_variableScope `[protected]`

PThread* PVXMLSession::m_vxmlThread `[protected]`

PSyncPoint PVXMLSession::m_waitForEvent `[protected]`

PXML PVXMLSession::m_xml `[protected]`

bool PVXMLSession::m_xmlChanged `[protected]`

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

- vxml.h