megatron
09-22-2006, 03:17 PM
Below is my script for a nightswitch!!!
This will route calls on TIME of DAY and Day of Week
Have fun
------------------------------------------------------------ --------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<!-- Written by Martin Brien of Megatron Pty Ltd&nb sp;&nb sp; -->
<!-- martin@megatron.com.au (martin@megatron.com.au) http://www.megatron.com.au (http://www.megatron.com.au) -->
<!-- Freeware on the condition that this copyright statement remains -->
<!-- (c) Copyright 2006&n bsp; VoIP: 30630600@epygi.com -->
<!-- ### REQUIRES VERSION 3.1.xx or higher of Quadro firmware ### -->
<!-- Limitation in this Version 1.00 is the START and END TIMES can -->
<!-- only be set to closest HOUR not minutes e.g. 5.00 pm NOT 5:30pm -->
<form id="datetimeform">
<object name="field1" classid="datetime">
<filled>
<!-- THIS IS WHERE YOU SET THE TIME AND DAYS OF THE WEEK -->
<!-- THIS WORKS ON GREATER THAN OR LESS THAN, NOT EQUAL TO -->
<!-- 8 = 8am and 18 = 6pm 1 is Sunday and 7 is Saturday -->
<!-- To set 8am to 5pm set datetime_hour = 7-17 NOT 8-17 -->
<!-- To set eveyday datetime_wday = 0-8 or weekdays 1-7 -->
<!-- START TIME -->
<if cond="datetime_hour &gt; '7'">
<!-- END TIME -->
<if cond="datetime_hour &lt; '17'">
<!-- DAYS OF THE WEEK -->
<if cond="datetime_wday &gt; '1'">
<if cond="datetime_wday &lt; '7'">
<goto next="#menu_business_hours"/>
</if>
</if>
</if>
</if>
<goto next="#menu_after_hours"/>
</filled>
</object>
</form>
<!-- -->
<!-- Business Hours Menu -->
<!-- -->
<form id="menu_business_hours">
<noinput count="2">
<!-- expr="'##'" where ## = extension number for NO INPUT -->
<assign name="field1" expr="'31'"/>
<goto nextitem="field2" />
</noinput>
<block>
<!-- welcome.wav is the first greeting audio file in Business Hours -->
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field1"/>
</block>
<field name="field1" type="digits?length=1" modal="false">
<!-- INPUT OPTION(S) with audio file played after input, -->
<!-- Pass to subroutine "option?", -->
<link dtmf="1" next="#option1"/>
<link dtmf="2" next="#option2"/>
<!-- repeat_welcome.wav is the REPEAT of just the available options with intial greeting -->
<prompt timeout="5s"> <audio src="repeat_welcome.wav" /> </prompt>
<!-- INPUT OPTION(S) where value="##" is the extension to transferred to -->
<option dtmf="3" value="33" />
<filled>
<goto nextitem="field2"/>
</filled>
</field>
<object name="field2" classid="connect">
<param name="extension" expr="field1"/>
<filled>
<!-- blank.wav to give delay between welcome message and repeat_welcome -->
<prompt> <audio src="blank.wav" /> </prompt>
<exit/>
</filled>
<nomatch>
<goto nextitem="field1"/>
</nomatch>
</object>
</form>
<!-- -->
<!-- After Hours Menu -->
<!-- -->
<form id="menu_after_hours">
<!-- expr="'##'" where ## = extension number for extension for AFTER HOURS VOICE MAIL -->
<!-- Setup virtual extension with voice mail/after hours greeting and option to leave message --> -->
<object name="tranfer" classid="connect">
<param name="extension" expr="'60'"/>
</object>
<exit/>
</form>
<!---->
<!-- Menu Options routines -->
<!---->
<form id="option1">
<noinput count="1">
<goto nextitem="option11" />
</noinput>
<block>
<prompt bargein="true">
<!-- option1.wav is play before being transfered to defined extension -->
<audio src="option1.wav" />
</prompt>
</block>
<goto nextitem="option11"/>
<object name="option11" classid="connect">
<!-- expr="'##'" is the extension to transferred to -->
<param name="extension" expr="'31'"/>
</object>
<exit/>
</form>
<form id="option2">
<noinput count="1">
<goto nextitem="option21" />
</noinput>
<block>
<prompt bargein="true">
<!-- option2.wav is play before being transfered to defined extension -->
<audio src="option2.wav" />
</prompt>
</block>
<goto nextitem="option21"/>
<object name="option21" classid="connect">
<!-- expr="'##'" is the extension to transferred to -->
<param name="extension" expr="'32'"/>
</object>
<exit/>
</form>
</vxml>
------------------------------------------------------------ --------------------------------------------
This will route calls on TIME of DAY and Day of Week
Have fun
------------------------------------------------------------ --------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<!-- Written by Martin Brien of Megatron Pty Ltd&nb sp;&nb sp; -->
<!-- martin@megatron.com.au (martin@megatron.com.au) http://www.megatron.com.au (http://www.megatron.com.au) -->
<!-- Freeware on the condition that this copyright statement remains -->
<!-- (c) Copyright 2006&n bsp; VoIP: 30630600@epygi.com -->
<!-- ### REQUIRES VERSION 3.1.xx or higher of Quadro firmware ### -->
<!-- Limitation in this Version 1.00 is the START and END TIMES can -->
<!-- only be set to closest HOUR not minutes e.g. 5.00 pm NOT 5:30pm -->
<form id="datetimeform">
<object name="field1" classid="datetime">
<filled>
<!-- THIS IS WHERE YOU SET THE TIME AND DAYS OF THE WEEK -->
<!-- THIS WORKS ON GREATER THAN OR LESS THAN, NOT EQUAL TO -->
<!-- 8 = 8am and 18 = 6pm 1 is Sunday and 7 is Saturday -->
<!-- To set 8am to 5pm set datetime_hour = 7-17 NOT 8-17 -->
<!-- To set eveyday datetime_wday = 0-8 or weekdays 1-7 -->
<!-- START TIME -->
<if cond="datetime_hour &gt; '7'">
<!-- END TIME -->
<if cond="datetime_hour &lt; '17'">
<!-- DAYS OF THE WEEK -->
<if cond="datetime_wday &gt; '1'">
<if cond="datetime_wday &lt; '7'">
<goto next="#menu_business_hours"/>
</if>
</if>
</if>
</if>
<goto next="#menu_after_hours"/>
</filled>
</object>
</form>
<!-- -->
<!-- Business Hours Menu -->
<!-- -->
<form id="menu_business_hours">
<noinput count="2">
<!-- expr="'##'" where ## = extension number for NO INPUT -->
<assign name="field1" expr="'31'"/>
<goto nextitem="field2" />
</noinput>
<block>
<!-- welcome.wav is the first greeting audio file in Business Hours -->
<prompt bargein="true"> <audio src="welcome.wav" /> </prompt>
<goto nextitem="field1"/>
</block>
<field name="field1" type="digits?length=1" modal="false">
<!-- INPUT OPTION(S) with audio file played after input, -->
<!-- Pass to subroutine "option?", -->
<link dtmf="1" next="#option1"/>
<link dtmf="2" next="#option2"/>
<!-- repeat_welcome.wav is the REPEAT of just the available options with intial greeting -->
<prompt timeout="5s"> <audio src="repeat_welcome.wav" /> </prompt>
<!-- INPUT OPTION(S) where value="##" is the extension to transferred to -->
<option dtmf="3" value="33" />
<filled>
<goto nextitem="field2"/>
</filled>
</field>
<object name="field2" classid="connect">
<param name="extension" expr="field1"/>
<filled>
<!-- blank.wav to give delay between welcome message and repeat_welcome -->
<prompt> <audio src="blank.wav" /> </prompt>
<exit/>
</filled>
<nomatch>
<goto nextitem="field1"/>
</nomatch>
</object>
</form>
<!-- -->
<!-- After Hours Menu -->
<!-- -->
<form id="menu_after_hours">
<!-- expr="'##'" where ## = extension number for extension for AFTER HOURS VOICE MAIL -->
<!-- Setup virtual extension with voice mail/after hours greeting and option to leave message --> -->
<object name="tranfer" classid="connect">
<param name="extension" expr="'60'"/>
</object>
<exit/>
</form>
<!---->
<!-- Menu Options routines -->
<!---->
<form id="option1">
<noinput count="1">
<goto nextitem="option11" />
</noinput>
<block>
<prompt bargein="true">
<!-- option1.wav is play before being transfered to defined extension -->
<audio src="option1.wav" />
</prompt>
</block>
<goto nextitem="option11"/>
<object name="option11" classid="connect">
<!-- expr="'##'" is the extension to transferred to -->
<param name="extension" expr="'31'"/>
</object>
<exit/>
</form>
<form id="option2">
<noinput count="1">
<goto nextitem="option21" />
</noinput>
<block>
<prompt bargein="true">
<!-- option2.wav is play before being transfered to defined extension -->
<audio src="option2.wav" />
</prompt>
</block>
<goto nextitem="option21"/>
<object name="option21" classid="connect">
<!-- expr="'##'" is the extension to transferred to -->
<param name="extension" expr="'32'"/>
</object>
<exit/>
</form>
</vxml>
------------------------------------------------------------ --------------------------------------------