| CallXML 3.0 Development Guide | Home | Frameset Home |
|
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do choices="choice1 (1, one),choice2 (2, two)">
<prompt value="helloworld"/>
<wait value="5s"/>
<on event="choice:choice1">
<goto value="#one"/>
</on>
<on event="choice:choice2">
<goto value="#two"/>
</on>
<on event="choice:nomatch">
<say>this is not a valid choice. try again.</say>
<goto value="#hello"/>
</on>
</do>
<do label="noinput">
<say>you didn't press, or say anything. Try again.</say>
<goto value="#hello"/>
</do>
<do label="one">
<say>you pressed D T M F one.</say>
<exit/>
</do>
<do label="two">
<say>you pressed D T M F two.</say>
<exit/>
</do>
<on event="error">
<sendemail from="MyApp@here.com"
to="YourEmail@there.net" type="debug">
We caught an error in our application. Details follow...
</sendemail>
</on>
</callxml>
<goto> element, but there is more that we can accomplish using <goto>. Using the <goto> element we can link external callxml files together in much the same way that you can link HTML files using the anchor (<a>) element. In order to do that we will need to first modify our existing <goto> elements to route the execution to another callxml file when a user input is recognized successfully:
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do label="hello" choices="choice1 (1, one),choice2 (2, two)">
<prompt value="helloworld"/>
<wait value="5s"/>
<on event="choice:choice1">
<goto value="helloworld-one.xml"
method="get"/>
</on>
<on event="choice:choice2">
<goto value="helloworld-two.xml"
method="get"/>
</on>
<on event="choice:nomatch">
<say>this is not a valid choice. Try again.</say>
<goto value="#hello"/>
</on>
</do>
<do label="noinput">
<say>you didn't press, or say anything. Try again.</say>
<goto value="#hello"/>
</do>
<on event="error">
<sendemail from="MyApp@here.com"
to="YourEmail@there.net" type="debug">
We caught an error in our application. Details follow...
</sendemail>
</on>
</callxml>
<goto> elements that link to other callxml documents. Notice that we have also modified the 'value' attribute to point to a relative URL, as opposed to a container element label that resides within our original file. We could link to any other callxml file, even one on a different web server, but for this example we are linking to callxml files located at the same webserver and directory as our original "helloworld.xml" file.
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do label="one">
<say>you chose option one.</say>
<exit/>
</do>
<on event="error">
<sendemail from="MyApp@here.com" to="YourEmail@there.net" type="debug">
We caught an error in our application. Details follow...
</sendemail>
</on>
</callxml>
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do label="two">
<say>you chose option two.</say>
<exit/>
</do>
<on event="error">
<sendemail from="MyApp@here.com" to="YourEmail@there.net" type="debug">
We caught an error in our application. Details follow...
</sendemail>
</on>
</callxml>
<goto>targets are quite obviously self-contained external files. Note also that if we wanted to get frisky, we could also specify a target with more granularity by specifying a container name preceding by the "pound" sign along with the actual relative, or fully qualified URL. To clarify, the following syntax applies:
<goto value="[URL]#[container name]"/>
<goto> statements are equivalent:
<goto value="helloworld-one.xml"/>
<goto value="helloworld-one.xml#one"/>
<goto value="http://myserver.com/helloworld-one.xml"/>
<goto value="http://myserver.com/helloworld-one.xml#one"/>
| ANNOTATIONS: EXISTING POSTS |
lambchops7
|
|
| I just started to program in callxml. When I "do" and press any number, the flow seems to be fine, but when I "do" and press the # key, the stream seems to terminate. It doesn't seem to recognize the # event and hangs up.
In the log viewer, it states: SRE::PR: The current input doesn't match any in-grammar expression. SRE stopped GOT RECO EVENT - NO MATCH event: unknown "nomatch" parser event = 12, par = "nomatch", var = "(NULL)", val = "(NULL)" Hangup() Can someone elucidate? Thanks. |
|
VoxeoDante
|
|
| Hello,
I can understand this behavior may seem strange. The truth is, there is a very good explanation for the described behavior. In CALLXML, the # key is designated as a terminating character. If this key is pressed in a call it will end the current state the call is in. This is why when you press the # key the application seems to end. I hope this answers your question. If not, please let me know. All the Best, Dante Vitulano |
| login |
|