We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Report Server Time to Caller

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
hecleal
Posts: 9
Joined: Fri Jul 15, 2011 1:41 pm

Report Server Time to Caller

Post 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

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Report Server Time to Caller

Post 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

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Report Server Time to Caller

Post 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

Post Reply