Voice Application Response
Join our Discord community - we're here to help.
The Voice Application response is a CXML document with the document element <Response>
(the document element in XML
is the one XML element that contains the entire document - similar to how all HTML documents are contains in a
single <html>
) element. This is considered a Voice Application stage. A Voice Application is composed from one or
more stages that can invoke each other.
Inside the <Response>
element, the Voice Application puts a set of verbs that instruct the runtime which actions to
take. Such verbs may contain nouns to give inputs for the runtime to operate on. Verbs may also define action
attributes that will instruct the runtime which stage to run when that verb completes successfully - a stage execution
terminates when the runtime runs an action
and the runtime will execute the Voice Application response returned from
the action
request as the next stage.
CXML Document Example
<Response>
<Gather action="https://example.com/submitActionGathger.php" input="dtmf speech">
<Say loop="3">
Please select one of the following options. For sales press 1 or say sales,
for support press 2 or say support, for the office press 3 or hold.
</Say>
</Gather>
</Response>
The above CXML document will instruct Cloudonix to generate a Text-To-Speech message, using the text provided in
the <SAY>
verb, while waiting for input from the caller, which may either be a DTMF (keypress) or a verbal word.
Once the input is received, it will be submitted to the URL indicated in the action
parameter.
CXML Verbs
The following list contains CXML verbs that are fully supported, and for each - documentation on additional Cloudonix features - where such exists - and how to use them on the CXML runtime.
Verb | Description |
---|---|
<Coach> | Attach to another sessions audio paths and provide coaching to either of both parties on the call. |
<Dial> | Dial to another location and patch the call through to the other side. The application will suspend until the call ends. |
<Gather> | Gather input from the caller, using the DTMF keypad or speech. |
<Hangup> | Ends the current call by hanging up the caller. |
<Pause> | Wait silently for some time to pass. |
<Play> | Plays an audio file back to the caller. |
<Record> | Record the caller's voice. |
<Redirect> | Transfers control of a call to a new CXML application at a different URL. |
<Reject> | Rejects an incoming call. |
<Say> | Convert text to speech that is read back to the caller. |
<Start> | Connect an asynchronous uni-directional audio stream to the session. |