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 have auto hangup after repeating <noinput> 3 times?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sasa
Posts: 8
Joined: Mon Dec 27, 2010 5:36 am

How to have auto hangup after repeating <noinput> 3 times?

Post by sasa »

Hi,

I am trying to make the call hang up by itself if there is no response from caller after repeating <noinput> 3 times.

Have anyone able to do this yet? I've tried the timeout options but didnt seem to work, i'm sending the following xml upon answering a call.

$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$xml .= "<vxml version = \"2.0\" >";
$xml .= "<property name=\"inputmodes\" value=\"dtmf\"/><property name=\"interdigittimeout\" value=\"5s\"/>";
$xml .= "<form id=\"getInput\"><field name=\"$name\" type=\"$type\"><prompt>$message</prompt></field><noinput>$noinput<reprompt/></noinput>";
$xml .= "<block><submit namelist=\"session.telephone.ani $name session.telephone.dnis session.id\" next=\"vxml_plum.pl\"/></block></form></vxml>";

Advise much appreciated!
rgds
sasa

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

Re: How to have auto hangup after repeating <noinput> 3 time

Post by support »

Hi sasa,

To have a call disconnect after 3 <noinput> events, you'll want to use the <noinput> tags with the "count" attribute, as well as the <disconnect> tag. A simple example of this is illustrated in the following code:

disconnect.php

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
  <form>
      <field name="id" type="digits?length=7">
      <prompt>
        Enter your customer identification number.
      </prompt>
      <filled>
        <assign name="customerid" expr="id"/>
        You entered <value expr="id"/>.
        <!-- transfer to premium support -->
      </filled>
      <noinput>
        Sorry, I didn't hear you.
        <reprompt/>
      </noinput>
      <noinput count="3">
        Sorry, I can't hear you, please try you call again later. Goodbye.
        <disconnect/>
      </noinput>
      <nomatch>
        Sorry, I didn't understand.
        <reprompt/>
      </nomatch>
    </field>
  </form>
</vxml>
Notice the <noinput> tags with the count="3" attribute...

Code: Select all

<noinput count="3">
  Sorry, I can't hear you, please try you call again later. Goodbye.
  <disconnect/>
</noinput>
Here, after the first 2 noinput events, the application will say, "Sorry, I didn't hear you," and then reprompt the user. After the third noinput event, the application will say, "Sorry, I can't hear you, please try your call again later. Goodbye." The application will then hang up on the user.

Regards,
Plum Support

sasa
Posts: 8
Joined: Mon Dec 27, 2010 5:36 am

Re: How to have auto hangup after repeating <noinput> 3 time

Post by sasa »

oh great! thanks! exactly what i'm looking for!

Post Reply