Results 1 to 3 of 3

Thread: Time based branching.

  1. #1

    Default

    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&amp;gt;17">
    <prompt>
    <audio src="goodevening.wav"/>
    </prompt>
    <elseif cond="datetime_hour&amp;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>



  2. #2

    Default

    Hi, find below
    correctusage of datetime object for your case

    <?xml version="1.0" encoding="UTF-8"?>
    <vxml
    version="2.0">
    <form id="mainform">

    <noinput>
    <assign name="field1" expr="'21'"/>

    <goto nextitem="field2" />
    </noinput>

    <object name="objDate" classid="datetime">

    <filled>
    <if
    cond="datetime_hour&amp;gt;17">
    <prompt>

    <audio src="goodevening.wav"/>

    </prompt>
    <elseif
    cond="datetime_hour&amp;gt;12"/>
    <prompt>

    <audio src="goodafternoon.wav"/>

    </prompt>& amp;nb sp;
    <else/>

    <prompt>
    <audio
    src="goodmorning.wav"/>
    </prompt>

    </if>
    </filled>

    </object>

    --- your code goes here ---

    </form>

    </vxml>


    Please consider, that vxmlobject is form item.It means that vxml object can bedeclared
    onlyas child element of form (not block), while block is just another type of
    form item.
    ________
    Vaporizer Bulb
    ________
    HotStella cam
    Last edited by arsen; 08-20-2011 at 12:42 PM.

  3. #3

    Default

    Great, that makes more sense.

    Ok I'll try this out.
    Thanks.


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. AJAX Based UI
    By greenbox in forum Suggestions and Feedback
    Replies: 0
    Last Post: 07-25-2007, 05:46 PM
  2. To much time in the ringing between ext
    By mexel in forum Troubleshooting and Problems
    Replies: 4
    Last Post: 04-27-2007, 02:13 PM
  3. lan based QOS
    By matkinson in forum 'How Do I' Questions
    Replies: 6
    Last Post: 02-13-2007, 11:31 PM
  4. Call routing based on incoming DID
    By wesleyit in forum 'How Do I' Questions
    Replies: 3
    Last Post: 12-03-2006, 03:15 PM
  5. Support for Internet based voice services
    By mauriceatkinson in forum Suggestions and Feedback
    Replies: 0
    Last Post: 11-09-2006, 07:49 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
  •