threebit
06-18-2006, 10: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&gt;17">
<prompt>
<audio src="goodevening.wav"/>
</prompt>
<elseif cond="datetime_hour&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>
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&gt;17">
<prompt>
<audio src="goodevening.wav"/>
</prompt>
<elseif cond="datetime_hour&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>