| CallXML 3.0 Development Guide | Home | Frameset Home |
<prompt> element is a new addition to the CallXML3.0 markup that serves as a replacement for the <menu> element...but comes with much, much more in the way of features. Using the <prompt> element allows you to queue up a series of comma-delimited wav files and/or TTS strings, ("prompt lists"), to play to the caller. This differs from the <menu> tag in that we specify a singular value for both the .wav file, and the TTS string within the value and choices attributes:
<prompt value="hello, say the name of the person you want to punch in the face"
choices="Tyler Durden, Cornelius, Robert Paulson">
| cache | Data Type: (yes|no) | Default: none - attribute is optional |
| Allows manual override over the caching mechanism. If this attribute is empty the default system caching is used. "yes" should force the system to use the cache all the time, "no" means that no cache should be used at all. | ||
| choices | Data Type: (grammar value) | Default: Optional |
The 'choices' attribute defines a list of comma delimited voice recognition utterances that will be active for the container element. Alternatively, the attribute can contain a choice followed parantheses containing different words which equate to that choice. Note that both dtmf grammars, and spoken word grammar utterances can be defined; digit values always indicate dtmf input, whereas spelled 'literals' for numbers imply that the grammar must be spoken:One can also define multiple matches to return the same value to the application by specifying the values in the following format: <ContainerElementName choices="ReturnValue (subchoice1, subchoice2)">As such, either of the 'subchoice' utterances will be interpreted as 'ReturnValue'. To illustrate in greater detail: <say choices="Beatles (john, paul, ringo, george), Lastly, developers can also make use of a builtin number grammar for capturing a string of digit values by specifying [x DIGITS], where 'x' is the length of the string that you wish to collect: <block choices="[5 DIGITS]"> This can also be modified to accept input of varying lengths by specifying [x-y DIGITS], where 'x' and 'y' are the minimum and maximum values for the length of the string being collected: <block choices="[5-8 DIGITS]"> | ||
| cleardigits | Data Type: (true|false) | Default: none - attribute is optional |
| This attribute's value is a Boolean, indicating whether the queued digits buffer should be cleared when this action starts. "true" clears the digits buffer; "false" leaves the contents of the digit buffer alone. | ||
| format | Data Type: URI | Default: none - attribute is optional |
| The 'format' attribute defines the string formatting to use for the element. If the value is undefined, the audio file format should be determined from the file name extension, if possible, and, if necessary, override the default format. | ||
| id | Data Type: (element id) | Default: none - attribute is optional |
The new 'id' attribute in CallXML3.0 is applicable to all container and action elements. Specifying this attribute allows yet another level of control and event handling when events occur and are caught by the <on> element. When an event occurs, the handler will first check the event, and then verify that the handler has a handler specific to the 'id' attribute to execute. This allows the developer to plan a specific course of action for events based on where in the application that they occur. | ||
| maxtime | Data Type: (m|s|ms) | Default: 30s |
| The maxtime attribute indicates the maximum time that the CallXML browser should wait for digits before executing any repeat instances, if present. | ||
| repeat | Data Type: (numeric value) | Default: 1 |
| The value for the repeat attribute indicates the number of times to execute the content contained by the parent element. If this attribute is explicitly specified, this must be a valid number, or an error will result. Also note that if the value is zero the content will be skipped. | ||
| termdigits | Data Type: (123456789*#|ABCD) | Default: none - attribute is optional |
| This attribute holds the list of touch-tone digits which can terminate the current caller action. Note that for each termdigit specified, there should be an <ontermdigit> handler in the code to catch the event. Allowable values are any one of "012356789*#", the ordinary DTMF (Touch-Tone) keypad possibilities, plus the special keypad tones found on some telephones "ABCD". | ||
| test | Data Type: CDATA | Default: Optional |
| The 'test' attribute is a new supplement to the CallXML markup that permits the developer to execute the contents of a container element, or action element, based on whether or not the specified condition is met. If the defined condition is met, then the code contained within the element is then executed. If the condition is not met, then the application resumes execution with the next sequential container container element in the document. | ||
| value | Data Type: STRING | Default: none - attribute is required |
The 'value' attribute specifies a comma-delimited "prompt list" to be output to the caller. If the audio file referenced is not found, then the string value will be output via TTS. The queuing and playback of the audio/TTS strings specified is entirely inherent, and no additional <say> elements are necessary. For instance, both of the snippets below are equivalent:Also, we can consider these next two snippets to be identical as well: | ||
| value-is | Data Type: STRING | Default: none - attribute is optional |
| Another new attribute, 'value-is', grants the developer with the ability to perform conditional logic upon container elements, or action elements for the first time within the CallXML markup. The value specified in the 'value-is' attribute specifies a string to compare against any 'value' attributes. If the 'value' and 'value-is' equate to 'true', then the element specified will execute. If the value equates to 'false' then the element will be skipped during document execution. | ||
| value-is-not | Data Type: STRING | Default: none - attribute is optional |
| Another new attribute, 'value-is-not', grants the developer with the ability to perform conditional logic upon container elements, or action elements, for the first time within the CallXML markup. The value specified in the 'value-is-not' attribute specifies a string to compare against any 'value' attributes. If the 'value' and 'value-is-not' equate to 'false', then the element specified will execute. If the value equates to 'true' then the element will be skipped during document execution. | ||
| <?xml version="1.0" encoding="UTF-8"?> <callxml version="3.0"> <do label="B1"> <prompt repeat="3" value="billy have you ever been in a turkish prison" choices="no, yes" maxtime="5s"> <on event="maxtime"> <prompt value="you didnt answer the question."/> </on> <on event="choice"> <prompt value="you said, $session.lastchoice;"/> <goto value="#B2"/> </on> </prompt> </do> <do label="B2"> <prompt value="goodbye"/> </do> </callxml> |
| <?xml version="1.0" encoding="UTF-8"?> <callxml version="3.0"> <do label="D1"> <!-- this will not execute, as '1' is not equal to '2' --> <prompt repeat="1" value="billy have you ever been in a turkish prison" choices="no, yes" test="1=2"> </prompt> <!-- this will not execute, as '1' is equal to '1' --> <prompt repeat="1" value="billy have you ever been in a turkish prison" choices="no, yes" test="1!=1"> </prompt> <!-- this will execute, as '1' is equal to '1' --> <prompt repeat="1" value="billy have you ever been in a turkish prison" choices="no, yes" test="1=1"> <on event="maxtime"> <prompt value="you didnt answer the question."/> </on> <on event="choice"> <prompt value="you said, $session.lastchoice;"/> <goto value="#B2"/> </on> </prompt> </do> <do label="B2"> <prompt value="goodbye"/> </do> </callxml> |
| <?xml version="1.0" encoding="UTF-8"?> <callxml version="3.0"> <do label="B1" value="airplane"> <prompt repeat="3" value="billy have you ever been in a turkish prison" choices="no, yes" value-is="biplane"> </prompt> <prompt repeat="3" value="bobby have you ever been in a turkish prison" choices="no, yes" value-is-not="airplane"> </prompt> <prompt repeat="3" value="billy have you ever been in a turkish prison" choices="no, yes" value-is="airplane"> <on event="maxtime"> <prompt value="you didnt answer the question."/> </on> <on event="choice"> <prompt value="you said, $session.lastchoice;"/> <goto value="#B4"/> </on> </prompt> </do> <do label="B4"> <prompt value="goodbye"/> </do> </callxml> |
| ANNOTATIONS: EXISTING POSTS |
| login |