Hi all,

I have a problem with my script:

The intention of this script is to welcome any incomming call with an welcome msg (if in working hours) and then forward the call to an extension. On the non working hours play a close msg and redial to an voice mail extension. simple has that!
The problem is that afther download the scripts and the voice files, when dialling an incomming call the script answer the call and finish immediately without playing any mesage.
The script is:

<vxml version="2.0">
<var name="working_hours" expr="'0'"/>
<var name="working_days" expr="'0'"/>
<var name="lunch" expr="'0'"/>
<form id="datetimeform">
<object name="field1" classid="datetime">
<filled>
<if cond="datetime_wday > '1'">
<if cond="datetime_wday < '8'">
<assign name="working_days" expr="'1'"/>
</if>
</if>
<if cond="working_days == '1'">
<assign name="working_hours" expr="'1'"/>
<if cond="datetime_wday > '1'">
<if cond="datetime_wday < '7'">
<if cond="datetime_hour < '9'">
<assign name="working_hours" expr="'0'"/>
</if>
<if cond="datetime_hour > '18'">
<assign name="working_hours" expr="'0'"/>
</if>
<if cond="datetime_hour < '14'">
<if cond="datetime_hour > '12'">
<assign name="lunch" expr="'1'"/>
</if>
</if>
</if>
</if>
<if cond="datetime_wday == '7'">
<if cond="datetime_hour < '11'">
<assign name="working_hours" expr="'0'"/>
</if>
<if cond="datetime_hour > '13'">
<assign name="working_hours" expr="'0'"/>
</if>
<if cond="datetime_hour == '13'">
<if cond="datetime_min > '30'">
<assign name="working_hours" expr="'0'"/>
</if>
</if>
</if>
</if>
<if cond="lunch == '0'">
<if cond="working_hours == '1'">
<prompt>
<audio src="ENOVAWELCOME.wav"/>
</prompt>
<goto nextitem="inHours"/>
<exit/>
<else/>
<prompt>
<audio src="ENOVACLOSE.wav"/>
</prompt>
<goto nextitem="afterHours"/>
<exit/>
</if>
</if>
<if cond="lunch == '1'">
<prompt>
<audio src="ENOVACLOSE.wav"/>
</prompt>
<goto nextitem="lunchtime"/>
<exit/>
</if>
</filled>
</object>
<object name="afterHours" classid="connect">
<param name="extension" value="143"/>
</object>
<object name="inHours" classid="connect">
<param name="extension" value="127"/>
</object>
<object name="lunchtime" classid="connect">
<param name="extension" value="143"/>
</object>
</form>
</vxml>

Can someone help me on that? I have reach a point that my brain stoped....

Thanks to all,

PCastanho