PDA

View Full Version : IVR Menu Problem



asantos
08-21-2008, 04:19 AM
Hi, i have read this forum related to IVR, but still can not make my IVR menu to work.
If it is Saturday or Sunday i want it to play weekend.wav, if it is weekday in time betwenn 18h00 and 8h59 and 12h30 to 14h00 e should play closed.wav, else it should play welcome message and go to the IVR menu.
Can anyone tell what is wrong?
Thank a lot

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<noinput count="3">
<assign name="field1" expr="'10'"/>
<goto nextitem="field2"/>
</noinput>
<form id="mainform">
<object name="dtfield" classid="datetime">
<filled>
<!-- CONDICOES DE FIM DE SEMANA -->
<if cond="datetime_wday == '1'">
<prompt><audio src="weekend.wav" /></prompt>
<exit/>
</if>
<if cond="datetime_wday == '7'">
<prompt><audio src="weekend.wav" /></prompt>
<exit/>
</if>

<!-- HORARIO -->
<if cond="datetime_hour &amp;gt; '8'">
<if cond="datetime_hour &amp;lt; '18'">
<if cond="datetime_hour == '12'">
<if cond="datetime_min &amp;gt; '30'">
<prompt><audio src="closed.wav" /></prompt>
<exit/>
</if>
</if>
<if cond="datetime_hour == '13'">
<prompt><audio src="closed.wav" /></prompt>
<exit/>
</if>
<if cond="datetime_hour == '14'">
<if cond="datetime_min &amp;lt; '30'">
<prompt><audio src="closed.wav" /></prompt>
<exit/>
</if>
</if>
<assign name="field1" expr="'10'"/>
<goto nextitem="field2" />
</if>
<else/>
<prompt> <audio src="closed.wav" /></prompt>
<exit/>
</if>
</filled>
</object>
<field name="field1" type="digits?length=1" modal="false">
<block>
<prompt bargein="true"> <audio src="welcome.wav"/> </prompt>
<goto nextitem="field1"/>
</block>
<prompt timeout="5s">
<audio src="options.wav" />
</prompt>
<option dtmf="1" value="10" />
<option dtmf="2" value="14" />
<option dtmf="3" value="10" />
<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>
</form>
</vxml>

arsen
08-22-2008, 01:17 AM
Please use the vxml scenario below. I've not got chance to test it much, but believe it should work fine for you. I have also attached the original vxml file to thread.

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<noinput count="3">
<prompt> <audio src="timeover.wav" /> </prompt>
<exit/>
</noinput>
<var name="working_hours" expr="'0'"/>
<var name="working_days" expr="'0'"/>
<form id="datetimeform">
<object name="field1" classid="datetime">
<filled>
<!-- IDENTIFY WORKING DAYS -->
<if cond="datetime_wday &gt; '1'">
<if cond="datetime_wday &lt; '7'">
<!-- It's working days now as wday is greater
than '1'(Sunday) and less than '7'(Saturday) -->
<assign name="working_days" expr="'1'"/>
</if>
</if>

<if cond="working_days == '1'">
<!-- IDENTIFY WORKING HOURS -->
<if cond="datetime_hour &lt; '9'">
<!-- [0-9) non-working -->
<elseif cond="datetime_hour &lt; '12'"/>
<!-- [9-12) working -->
<assign name="working_hours" expr="'1'"/>
<elseif cond="datetime_hour &lt; '13'"/>
<!-- [12-13) -->
<if cond="datetime_min &lt; '30'">
<!-- [12.00-12.30) working -->
<assign name="working_hours" expr="'1'"/>
</if>
<elseif cond="datetime_hour &lt; '14'"/>
<!-- [13-14) non-working -->
<elseif cond="datetime_hour &lt; '18'"/>
<!-- [14-18) working -->
<assign name="working_hours" expr="'1'"/>
<else/>
<!-- [18-24) non-working -->
</if>

<if cond="working_hours == '1'">
<!-- PLAY PROMPT CORRESPONDING TO WORKING HOURS -->
<prompt> <audio src="welcome.wav" /> </prompt>
<else/>
<!-- PLAY PROMPT CORRESPONDING TO NON-WORKING HOURS -->
<prompt> <audio src="closed.wav" /> </prompt>
</if>
<else/>
<!-- PLAY PROMPT CORRESPONDING TO NON-WORKING DAYS -->
<prompt> <audio src="weekend.wav" /> </prompt>
</if>

<exit/>
</filled>
</object>
</form>
</vxml>
________
Colorado Medical Marijuana Dispensaries (http://colorado.dispensaries.org/)
________
Live Sex (http://livesexwebshows.com/)