Questions and answers about IVR programming for Plum DEV
Moderators: admin , support
brent.russell
Posts: 50 Joined: Wed Oct 04, 2006 1:34 pm
Location: SOCAL
Contact:
Post
by brent.russell » Tue Feb 06, 2007 1:05 pm
I am trying to specify the pound key. How am I supposed to specify special characters in and out of quotes?
Code: Select all
<if cond="confirmMenuChoice==#">
<goto next="#hangUp"/>
<elseif cond="confirmMenuChoice==2"/>
<goto next="#moreinfo"/>
<elseif cond="confirmMenuChoice==3"/>
<goto next="main_menu.vxml"/>
</if>
Thank you,
Brent
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Tue Feb 06, 2007 2:57 pm
Brent,
The IVR code you write inside of the cond attribute is Javascript and will be evaluated. That being the case # is neither a valid variable name nor a number so you need to place it in single quotes to assure that it is evaluated and compared as a string:
Code: Select all
<if cond="confirmMenuChoice=='#'">
<goto next="#hangUp"/>
<elseif cond="confirmMenuChoice==2"/>
<goto next="#moreinfo"/>
<elseif cond="confirmMenuChoice==3"/>
<goto next="main_menu.vxml"/>
</if>
Regards,
Plum Support
Last edited by
support on Fri Jan 01, 2010 12:45 pm, edited 1 time in total.
brent.russell
Posts: 50 Joined: Wed Oct 04, 2006 1:34 pm
Location: SOCAL
Contact:
Post
by brent.russell » Tue Feb 06, 2007 4:06 pm
After adding the quotes around the pound key...
I get "you have entered an invalid option" which is a prompt set in my nomatch.
Any idea?
Thank you
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Tue Feb 06, 2007 4:22 pm
Brent,
What IVR
grammar are you using to specify the allowed inputs? You need to make sure that you tell the IVR platform that # is an allowed input.
Regards,
Plum Support
Last edited by
support on Sat Feb 20, 2010 3:35 pm, edited 3 times in total.
brent.russell
Posts: 50 Joined: Wed Oct 04, 2006 1:34 pm
Location: SOCAL
Contact:
Post
by brent.russell » Tue Feb 06, 2007 4:51 pm
your right... I had 1|2 for the grammar.
Thanks for pointing that out. My mistake!
But now that raises a different issue:
here is my grammar:
Code: Select all
<grammar type="application/x-jsgf">2|3|'#'</grammar>
I also tried
Code: Select all
<grammar type="application/x-jsgf">2|3|#</grammar>
But I get errors with both. Is there a way to specify the pound key?
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Tue Feb 06, 2007 5:18 pm
Brent,
According to the
JSGF specification only double quotes can be used to express strings. The IVR format you are looking for is as follows:
Code: Select all
<grammar type="application/x-jsgf">2|3|"#"</grammar>
The Javascript code inside the cond block supports both single or double quotes and so we defaulted to using single quotes to avoid having to escape double quotes.
Regards,
Plum Support