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

how to log the dtmf input given by user

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
nrk1981
Posts: 4
Joined: Mon Oct 05, 2009 3:29 am

how to log the dtmf input given by user

Post by nrk1981 »

Hi,
we had developed an IVR application which accepts DTMF input from the user.
problem we are facing is as our application is payment making application,
we need to log the input of the customer like payment confirmations, payment amount customer is inputting.

if it is a voice input we can record the customer input, but as it is DTMf we do not have any choice to log this.
could any one of you please help us if you worked on this .

thanks
Rajkumar

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

IVR code suggestion for logging DTMF inputs

Post by support »

Hi Rajkumar,

You can do a <submit> within your IVR code to log the DTMF inputs that you get.

IVR example:

logdtmfentry.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form id="mainmenu">
  <field name="dtmfchoice">
    <grammar type="application/x-jsgf" mode="dtmf">
      1|2|3
    </grammar>
      <prompt>
        For sales, press 1.
        For tech support, press 2.
        For company directory, press 3.
      </prompt>
      <filled>
        <submit next="storeresults1.php" method="post" namelist="dtmfchoice"/>
      </filled>
  </field>
</form>
</vxml>
storeresults1.php:

Code: Select all

<?php
$File = "storeresults1.txt";
$Handle = fopen($File, 'a+');
$Date = date("r");
$Result = $_POST[dtmfchoice];
$Data = "$Date $Result\n";
fwrite($Handle, $Data);
fclose($Handle);
?>
<vxml version="2.0">
    <form>
        <block>
          <exit/>
        </block>
    </form>
</vxml> 
From this IVR example, the user enters a DTMF input (either 1, 2, or 3). Once the user has entered this in, it gets submitted to "storeresults1.php", which creates a text file that stores the DTMF entry that was inputted.

Hope this helps.

Regards,
Plum Support

Post Reply