Results 1 to 5 of 5

Thread: XML Newbie Help Needed Urgently.

  1. #1

    Default XML Newbie Help Needed Urgently.

    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 &gt; '1'">
    <if cond="datetime_wday &lt; '7'">
    <if cond="datetime_hour &gt; '8'">
    <if cond="datetime_hour &lt; '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,
    Attached Files Attached Files
    Last edited by Leeinsa; 04-25-2010 at 02:33 PM.

  2. #2

    Default Try this

    Why not use the standard call routing schedule to accomplish the same thing. Much easier.
    mail me on oloff@xone.co.za

    Regards

  3. #3

    Default

    Lee I think your VAR ( Variable commands ) might be a little out of sorts..

    According to my white paper ... it should look like and start with

    <?xml version="1.0" encoding="UTF-8"?>
    <vxml version="2.0">
    <var name="working_hours" expr="'0'"/>
    <var name="working_days" expr="'0'"/>
    <form id="datetimeform">
    <object name="field1" classid="datetime">

    Notice the VARiable commands are outside of the form and also Working days is missing ...

    So it might need to look like something like the following :


    <?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'" />
    <var name="working_days" expr="'0'" />
    <object name="field1" classid="datetime">
    <filled>
    <!-- M-F:8-5 --><if cond="datetime_wday &gt; '1'">
    <if cond="datetime_wday &lt; '7'">
    <if cond="datetime_hour &gt; '8'">
    <if cond="datetime_hour &lt; '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">
    <noinput count="1">
    <goto nextitem="businesshoursform" />
    </noinput>
    <block>
    <prompt bargein="true">
    <audio src="daygreeting.wav" />
    </prompt>
    </block>
    <goto nextitem="businesshoursform" />
    <object name="businesshoursform" classid="connect">
    <param name="extension" expr="'201'" />
    </object>
    <exit />
    </form>
    <!-- after hours attendant -->
    <form id="afterhoursform">
    <noinput count="1">
    <goto nextitem="afterhoursform" />
    </noinput>
    <block>
    <prompt bargein="true">
    <audio src="nightmessage.wav" />
    </prompt>
    </block>
    <goto nextitem="afterhoursform" />
    <object name="afterhoursform" classid="connect">
    <param name="extension" expr="'202'" />
    </object>
    <exit />
    </form>
    </vxml>


    Dont forget to record 2 x messages - 1 = daygreeting.wav and the 2nd nightmessage.wav

    I have made a clean copy of the xml for you lee.. see attached.

    Hopefully that will resolve it.

    Kev
    Attached Files Attached Files
    Last edited by KSComs; 05-26-2010 at 10:44 AM.

  4. #4

    Default

    Thanks Kev, Will give this some time over the weekend and try to learn the correct way of doing things for a change.

    Regards,

  5. #5

    Default

    You could also remove the audio by just changing it to blank.wav
    That way it will just divert to your extensions as required

    Re = <prompt bargein="true">

    This means the user can dial digits through the message, if you just want them to listen and not interact with your attendant then change <prompt bargein="true"> to <prompt bargein="false">

    I was going to write some fancy dial mechanism as well.. but you have seen enough to wet your appetite .. and I have tested the above

    Regards

    Kev
    Last edited by KSComs; 05-26-2010 at 07:23 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sample Inbound Call Route Rule Needed
    By BreeSoft in forum 'How Do I' Questions
    Replies: 1
    Last Post: 04-02-2010, 09:04 PM
  2. Replies: 3
    Last Post: 12-25-2009, 01:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •