foreach problem
Posted: Tue Nov 04, 2008 1:13 am
Hi, I am trying to implement a better way to read a confirmation number back (using prosody -25% now and its not that clear).
So i came up with the bright? idea of using a foreach loop. Code is below:
This works but the problem is that after it has finished saying the last digit (5) it does not play the remainder of the prompt. Any ideas?
Also, as a side note, if i don't do the assignment in the script tag (e.g. do a var tag) it won't read anything back. How odd is that?
So i came up with the bright? idea of using a foreach loop. Code is below:
Code: Select all
<script>
<![CDATA[
var confirmnumber = "12345";
]]>
</script>
<field name="ConfCode">
<grammar type="application/srgs+xml" root="OOConf" mode="dtmf" version = "1.0">
<rule id="OOConf" scope="private">
<one-of>
<item>1</item>
<item>2</item>
<item>*</item>
</one-of>
</rule>
</grammar>
<prompt>
Your confirmation number is:
<foreach array="confirmnumber" item="digit">
<value expr="digit"/>
</foreach>
<break/>
To repeat press 1, to continue press 2, to exit the system press the star key.
</prompt>
<filled>
<if cond="ConfCode=='1'">
<clear namelist="ConfCode"/>
<reprompt/>
<elseif cond="ConfCode=='2'"/>
<goto next="#Menu"/>
<else/>
<disconnect />
</if>
</filled>
</field>
Also, as a side note, if i don't do the assignment in the script tag (e.g. do a var tag) it won't read anything back. How odd is that?