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

Voicemail

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
RandyINSite
Posts: 11
Joined: Wed Aug 13, 2008 3:25 pm

Voicemail

Post by RandyINSite »

I have read through this post: http://support.plumgroup.com/viewtopic. ... =voicemail
but still have a question.

I need to have a short message played if an answering machine or voicemail system answers, and give a list of menu choices if a person answers.
I also understand that callee_type detection is not perfect, but that's not an issue.

With the voiceXML below, the menu choices always play even when the callee_type is correctly detected as answering machine.

I've x'd out the real names including our URL, but the call is made correctly; I just need to fix the conditional portion.
Please tell me where I went wrong:

Code: Select all

1 <?xml version="1.0" ?>
2 <!DOCTYPE vxml PUBLIC "-//The Plum Group//DTD VOICEXML 2.1//EN" "/usr/local/plumvp/vxml.dtd">
3 <vxml version="2.0">
4 <property name="inputmodes" value="dtmf"/>
5 <form id="mainmenu">
6 <var name="callee_type" expr="'answeringmachine'"/>
7 <record cond="callee_type=='answeringmachine'" finalsilence="2000ms">
8 <noinput>
9 <prompt>
10 <voice name="Diane">
11   (patient name fills in here)
12 This is Dr. xxxxx's office.
13 </voice>
14 </prompt>
15 <disconnect/>
16 </noinput>
17 </record>
18 <field name="menuchoice">
19 <grammar type="application/x-jsgf" mode="dtmf">
20 1|2|3|4
21 </grammar>
22 <prompt>
23 <voice name="Diane">
24   (patient name fills in here)
25 This is Dr. xxxxx's office.
26 To confirm your appointment, press 1.
27 To cancel your appointment, press 2.
28 To speak to an operator, press 3.
29 To repeat these options, press 4.
30 </voice>
31 </prompt>
32 <filled>
33 <if cond="menuchoice==1">
34 <prompt bargein="false">
35 <voice name="Diane">
36 Your appointment is confirmed.</voice>
37 </prompt>
38 <submit next="http://xxxxxx/PhoneReminderProcessCall.aspx?message_reference=&call_parameters=&call_id=0" method="get" namelist="menuchoice"/>
39 <elseif cond="menuchoice==2"/>
40 <prompt bargein="false">
41 <voice name="Diane">
42 Connecting to an attendant to re-schedule.</voice>
43 </prompt>
44 <submit next="http://xxxxxx/PhoneReminderProcessCall.aspx?message_reference=&call_parameters=&call_id=0" method="get" namelist="menuchoice"/>
45 <elseif cond="menuchoice==3"/>
46 <prompt bargein="false">
47 <voice name="Diane">
48 Transferring to the operator.</voice>
49 </prompt>
50 <submit next="http://xxxxxx/PhoneReminderProcessCall.aspx?message_reference=&call_parameters=&call_id=0" method="get" namelist="menuchoice"/>
51 <elseif cond="menuchoice==4"/>
52 <clear namelist="menuchoice"/>
53 <reprompt/>
54 </if>
55 </filled>
56 <noinput>
57 <reprompt/>
58 </noinput>
59 <nomatch>
60 <prompt>Input not recognized</prompt>
61 <reprompt/>
62 </nomatch>
63 </field>
64 <catch event="connection.disconnect">
65 <submit next="http://xxxxxx/PhoneReminderProcessCall.aspx?hangup=true&message_reference=&call_parameters=&call_id=0" method="get" namelist="menuchoice"/>
66 </catch>
67 </form>
68 </vxml>

Thank you.

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

IVR code works with the conditional portion of vm

Post by support »

Hi,

What seems to be wrong with the <if> conditional portion? We've made 4 IVR outbound calls with a slight variation of your IVR code and it seems to work fine:

test.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<property name="inputmodes" value="dtmf"/>
<form id="mainmenu">
<var name="callee_type" expr="'answeringmachine'"/>

<record cond="callee_type=='answeringmachine'" finalsilence="2000ms">
<noinput>
<prompt>
<voice name="Diane">
  Little Timmy, this is Dr. Styles's office.
</voice>
</prompt>
<disconnect/>
</noinput>
</record>

<field name="menuchoice">
  <grammar type="application/x-jsgf" mode="dtmf">
    1|2|3|4
  </grammar>
  <prompt>
    <voice name="Diane">
      Little Timmy, this is Dr. Styles's office.
      To confirm your appointment, press 1.
      To cancel your appointment, press 2.
      To speak to an operator, press 3.
      To repeat these options, press 4.
    </voice>
  </prompt>
  <filled>
    <if cond="menuchoice==1">
      <prompt bargein="false">
        <voice name="Diane">
          Your appointment is confirmed.
        </voice>
      </prompt>
      <submit next="test2.php" method="get" namelist="menuchoice"/>
    <elseif cond="menuchoice==2"/>
      <prompt bargein="false">
        <voice name="Diane">
          Connecting to an attendant to re-schedule.
        </voice>
      </prompt>
      <submit next="test2.php" method="get" namelist="menuchoice"/>
    <elseif cond="menuchoice==3"/>
      <prompt bargein="false">
        <voice name="Diane">
          Transferring to the operator.
        </voice>
      </prompt>
      <submit next="test2.php" method="get" namelist="menuchoice"/>
    <elseif cond="menuchoice==4"/>
      <clear namelist="menuchoice"/>
      <reprompt/>
    </if>
  </filled>

  <noinput>
    <reprompt/>
  </noinput>

  <nomatch>
    <prompt>
      Input not recognized.
    </prompt>
    <reprompt/>
  </nomatch>
</field>

<catch event="connection.disconnect">
  <submit next="test2.php" method="get" namelist="menuchoice"/>
</catch>

</form>
</vxml>
Regards,
Plum Support
Last edited by support on Thu Feb 18, 2010 3:52 pm, edited 4 times in total.

RandyINSite
Posts: 11
Joined: Wed Aug 13, 2008 3:25 pm

Post by RandyINSite »

Never mind; I figured it out.

Mostly what I needed was an <exit/> tag after the disconnect, to prevent it from playing the menu options even when it detected an answering machine.

Post Reply