Page 1 of 1

Report Server Time to Caller

Posted: Tue Sep 06, 2011 12:07 pm
by hecleal
We are currently woking on a project that allows users to call in and use phone to clock in and clock out. The code we have in scratchpad is the following:

<?xml version="1.0"?>
<vxml version="2.0">
<var name="CallerID" expr="session.telephone.ani" />
<form>
<block>
<prompt>
Welcome to Visit Clock.
</prompt>
</block>
<field name="ProviderID" type="digits">
<prompt>
Please enter your employee identification number using your keypad.
</prompt>
</field>
<field name="ClientID" type="digits">
<prompt>
Please enter your client identification number using your keypad.
</prompt>
</field>
<filled>
<submit namelist="CallerID ProviderID ClientID" next="http://67.78.126.234/VisitClock.Service ... dCall.aspx" />
</filled>
</form>
</vxml>

The code on our server is the following:

<vxml version=""2.0""><form><block><prompt>Thank you for using Visit Clock. Goodbye.</prompt></block></form></vxml>

How can we include code to tell the caller the call time? Can we send back the time from our server?

Please help.
Thanks
Hector Leal

Re: Report Server Time to Caller

Posted: Tue Sep 06, 2011 3:27 pm
by support
Hi hecleal,

Here is a short example that demonstrates how you can say the call time to the caller:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
?>
<vxml version="2.0">

<script>
     var calltime=new Date();
</script>

<form id="intro">
     <block>
          <prompt>
               The call time is <value expr="calltime.toLocaleTimeString()"/>.
          </prompt>
     </block>

</form>
</vxml>
Please note that from this example, the time would be said as Eastern Daylight Time.

It is possible for you to state the time from your server, but you would need to return this value within your application script to state back to the user.

Regards,
Plum Support

Re: Report Server Time to Caller

Posted: Fri Feb 24, 2012 1:59 pm
by support
Hi Rakesh,

You could set up a scratchpad that does a <goto> to your IVR application script on your web server. Within that scratchpad, you could set up a <catch> tag to handle if an error.badfetch occurs and play a prompt such as, "Currently, we are experiencing technical difficulties. Please try your call again later."

Regards,
Plum Support