PDA

View Full Version : VXML script not working,



ibisadmin
01-24-2007, 11:29 PM
Hi, we want to choose an extension before the prompt ends but it doesn't read the digits keyed in and starts back again.

Somehow when it jumps to the field1 or field3 segment it does not read the digits correctly.

Any idea?

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<noinput count="1">
<assign name="field1" expr="'61'"/>
<goto nextitem="field2" />
</noinput>

<form id="mainform">
<object name="dtfield" classid="datetime">
<filled>
<if cond="datetime_wday == '1'">
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field3"/>

</if>
<if cond="datetime_wday == '7'">
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field3"/>
</if>
<if cond="datetime_hour &amp;gt; '7'">
<if cond="datetime_hour &amp;lt; '17'">
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field1" />
<elseif cond="datetime_hour == '17'"/>
<if cond="datetime_min &amp;lt; '31'">
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field1" />
<elseif cond="datetime_min &amp;gt; '30'" />
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field3"/>
</if>
<elseif cond="datetime_hour == '7'"/>
<if cond="datetime_min &amp;lt; '31'">
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field3" />
<elseif cond="datetime_min &amp;gt; '30'" />
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field1"/>
</if>
<elseif cond="datetime_hour gt; '17'"/>
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field3"/>
</if>
<else/>
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field3"/>
</if>
</filled>
</object>

<field name="field1" type="digits?length=1" modal="false">
<link dtmf="#" next="#dirspell"/>
<prompt bargein="true" timeout="5s">
<audio src="recurring.wav" />
</prompt>
<option dtmf="1" value="44" />
<option dtmf="2" value="30" />
<option dtmf="0" value="61"/>
<filled>
<goto nextitem="field2"/>
</filled>
</field>
<object name="field2" classid="connect">
<param name="extension" expr="field1"/>
<filled>
<prompt> <audio src="timeover.wav" /> </prompt>
<exit/>
</filled>
<nomatch>
<goto nextitem="field1"/>
</nomatch>
</object>
<field name="field3" type="digits?length=1" modal="false">
<prompt timeout="5s">
<audio src="closed.wav" />
</prompt>
<option dtmf="1" value="44" />
<option dtmf="2" value="30" />

<filled>
<goto nextitem="field4"/>
</filled>
</field>
<object name="field4" classid="connect">
<param name="extension" expr="field3"/>
<filled>
<noinput count="1">
<assign name="field1" expr="'61'"/>
<goto nextitem="field2" />
</noinput>
</filled>
<nomatch>
<goto nextitem="field3"/>
</nomatch>
</object>
</form>
<var name="varExtension"/>
<var name="varFilename"/>
<var name="varRoll" expr="'true'"/>
<form id="dirspell">
<link dtmf="*" next="#mainform"/>
<object name="field5" classid="directory">
<param name="roll" expr="varRoll"/>
<prompt> <audio src="pubdirspell.wav" /> </prompt>
<nomatch>
<prompt> <audio src="nomatch.wav" /> </prompt>
<reprompt/>
</nomatch>
<filled>
<assign name="varExtension" expr="_extension" />
<assign name="varFilename" expr="_filename" />
<assign name="varRoll" expr="'false'" />
<goto next="#diraccept"/>
</filled>
</object>
</form>
<!-- accept menu, plays file attached to spelled extension -->
<!-- and offers three choices to input -->
<menu id="diraccept">
<prompt> <audio expr="varFilename" /> </prompt>
<prompt> <audio src="pubdiraccept.wav" /> </prompt>
<choice dtmf="1" next="#dirroll"/>
<choice dtmf="*" next="#dirspell"/>
<choice dtmf="#" next="#dirmainform"/>
</menu>
<!-- roll form, sets varRoll to true to perform roll over the spelled entries -->
<form id="dirroll">
<block>
<assign name="varRoll" expr="'true'" />
<goto next="#dirspell"/>
</block>
</form>
<!-- main form, dials to already spelled and accepted extension -->
<form id="dirmainform">
<object name="field2" classid="connect">
<param name="extension" expr="varExtension"/>
<filled>
<prompt> <audio src="timeover.wav" /> </prompt>
<exit/>
</filled>
<nomatch>
<goto next="#dirspell"/>
</nomatch>
</object>
</form>


</vxml>

arsen
01-25-2007, 08:45 PM
I'll try to interpret your script.
At the first, script invokes "datetime" object and according to current time jumps to "field1" or "field3".
Then interpreter waits for input.

<field name="field1" type="digits?length=1" modal="false">
This means that digit length is 1 in another words no more than one digit is acceptable here.
I believe it should be
<field name="field1" type="digits?length=2" modal="false">

However you still can define options with one digit
<option dtmf="1" value="44" />
<option dtmf="2" value="30" />
<option dtmf="0" value="61"/>


Hope it'll help.

________
M5 (http://www.bmw-tech.org/wiki/BMW_M5)
________
Vaporizers (http://vaporizers.tv/)