Folks,
This is my first trip into the world of XML so naturally i thought changing some existing scripts would be the easiest way to go until i'm more familiar. So i created the script below from some others i found posted her. My needs are extremely simple, all calls come into virtual extension 200, here the time of day and the day of the week is checked, if it is Monday to Friday, between 8am and 5pm, then this is classed as working hours and the call is routed to extension 201 as normal. If the time and day is outside the above parameters then the call is forwarded to extension 202 for further processing (this processing is working). However when i dial extension 200, it rings once and disconnects.
So to summarise:
call comes in to virtual extension 200
if working hours, call sent to extension 201
if not working hours, call sent to extension 202
That's it, but my hacked script does not work, anybody that could take a look and see what i've cocked up, i would be very appreciative. Maybe this script could also be shortened or cleaned up quite a bit? Script below
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<!-- determine if call is received during business hours: M-F:8-5, Sat:Closed, Sun:closed -->
<form id="datetimeform">
<var name="business_hours" expr="'0'"/>
<object name="field1" classid="datetime">
<filled>
<!-- M-F:8-5 -->
<if cond="datetime_wday > '1'">
<if cond="datetime_wday < '7'">
<if cond="datetime_hour > '8'">
<if cond="datetime_hour < '17'">
<assign name="business_hours" expr="'1'"/>
</if>
</if>
</if>
</if>
<!-- during business hours, route to Ext 201 (reception) -->
<if cond="business_hours == '1'">
<goto next="#businesshoursform" />
<else/>
<!-- not during business hours, route to Ext 202 (night reception) -->
<goto next="#afterhoursform" />
</if>
</filled>
</object>
</form>
<!-- business hours attendant -->
<form id="businesshoursform">
<block>
<object name="field2" classid="connect">
<param name="extension" value="201"/> </object>
</block>
</form>
<!-- after hours attendant -->
<form id="afterhoursform">
<block>
<object name="field2" classid="connect">
<param name="extension" value="202"/> </object>
</block>
</form>
</vxml>
Regards,