PDA

View Full Version : Time based branching.



threebit
06-18-2006, 09:25 AM
Hi, I have been trying to create VXML document which plays a different greeting message based on the time of the day.
Also, outside of office hours I want to play an appropriate message informing the caller that they have called outside of business hours.
I am struggling with the new datetime object. Here is what I have so far.

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<form id="mainform">
<noinput>
<assign name="field1" expr="'21'"/>
<goto nextitem="field2" />
</noinput>

<block>
<object name="objDate" classid="datetime">
</object>

<if cond="datetime_hour&amp;gt;17">
<prompt>
<audio src="goodevening.wav"/>
</prompt>
<elseif cond="datetime_hour&amp;gt;12"/>
<prompt>
<audio src="goodafternoon.wav"/>
</prompt>&nb sp;
<else/>
<prompt>
<audio src="goodmorning.wav"/>
</prompt>
</if>

<goto nextitem="field1"/>
</block>

<field name="field1" type="digits?length=1" modal="false">
<prompt timeout="2s">
<audio src="holdforteammember.wav" />
</prompt>
<option dtmf="1" value="50" />
<option dtmf="2" value="51" />
<option dtmf="3" value="52" />
<filled>
<goto nextitem="field2"/>
</filled>
</field>

<object name="field2" classid="connect">
<param name="extension" expr="field1"/>
<filled>
<prompt>
<audio src="blank.wav" />
</prompt>
<exit/>
</filled>
<nomatch>
<goto nextitem="field1"/>
</nomatch>
</object>

</form>
</vxml>

arsen
06-20-2006, 05:55 PM
Hi, find below
correctusage of datetime object for your case

<?xml version="1.0" encoding="UTF-8"?>
<vxml
version="2.0">
<form id="mainform">

<noinput>
<assign name="field1" expr="'21'"/>

<goto nextitem="field2" />
</noinput>

<object name="objDate" classid="datetime">

<filled>
<if
cond="datetime_hour&amp;gt;17">
<prompt>

<audio src="goodevening.wav"/>

</prompt>
<elseif
cond="datetime_hour&amp;gt;12"/>
<prompt>

<audio src="goodafternoon.wav"/>

</prompt>& amp;nb sp;
<else/>

<prompt>
<audio
src="goodmorning.wav"/>
</prompt>

</if>
</filled>

</object>

--- your code goes here ---

</form>

</vxml>


Please consider, that vxmlobject is form item.It means that vxml object can bedeclared
onlyas child element of form (not block), while block is just another type of
form item.
________
Vaporizer Bulb (http://vaporizer.org/reviews)
________
HotStella cam (http://camslivesexy.com/cam/HotStella)

threebit
06-21-2006, 01:35 PM
Great, that makes more sense.

Ok I'll try this out.
Thanks.