Page 1 of 1

Posting Voice recording to url if system doesn't recognize

Posted: Thu Nov 12, 2009 2:31 pm
by cpe966
the reply.

I'm looking to post the users recorded voice, capture the response, if the IVR voice recognition system doesn't understand the response, to a url. That is, after three failed attempts, I'm looking to take the last failed attempt (or even the first or second attempts) and post that to a website where we'd be able to do some human interaction to it.

Let me know if this is clear.

c

IVR example to capture user's response

Posted: Fri Nov 13, 2009 11:04 am
by support
Hi,

Here is an IVR example that should help you achieve this:

captureresponse.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
  <property name="recordutterance" value="true"/>
  <form id="getfirstname">
    <field name="first_name">
     <grammar src="http://vxml.plumgroup.com/grammars/firstname.php" root="firstname" type="application/srgs+xml" mode="voice"/>
      <prompt bargein="false">
          Please say your first name and spell it.
      </prompt>
      <filled>
        Your recording is <value expr="first_name$.recording"/>.
      </filled>

      <nomatch count="1">
        I'm sorry, I didn't get that.
        <reprompt/>
      </nomatch>

      <nomatch count="2">
        I'm sorry, I still didn't get that.
        <reprompt/>
      </nomatch>

      <nomatch count="3">
        I still don't understand.
        <goto next="#getrecording"/>
      </nomatch>
    </field>
  </form>

  <form id="getrecording">
    <record name="userrecording">
      <prompt>
        Please say your first name and spell it one last time.
      </prompt>
      <filled>
        <submit next="playuserrecording.php" method="post" namelist="userrecording" enctype="multipart/form-data"/>
      </filled>
    </record>
  </form>
</vxml>
From this IVR example, if the IVR fails to recognize the user's response (meaning the user's response did not match the grammar) after three tries, the third nomatch handler (<nomatch count="3"> ) goes to a new <form> that records what the user is saying and submits the recording to the file script, playuserrecording.php. If the user's response matches the IVR grammar, then the IVR property, recordutterance, allows us to use the shadow variable, recording (first_name$.recording), to capture what the user had said exactly.

Hope this helps.

Regards,
Plum Support

Still confused

Posted: Tue Nov 24, 2009 7:49 pm
by cpe966
Hi,

So I am confused: I used the code verbatim in
http://support.plumgroup.com/viewtopic.php?t=1333 but can't seem to do
the lookup against the grammar tags

example:

grammar
item
christmas is coming
tag
type=holiday
result=gifts

then I want

2 tries - reprompt on nomatch (field)
the third match I record as you described AND I then want the matching
grammar tags type and result in the post -- but they are empty.

what am i missing?

IVR code records what user is saying

Posted: Wed Nov 25, 2009 11:25 am
by support
Hi,

There seems to be a misunderstanding here.

For clarification:

When you have a <nomatch> event, that means that the user's input did not match with the IVR grammar. In the IVR code, from that third nomatch event, it goes to a <record>, which just records what the user is saying to try and match your earlier IVR grammar.

This <record> does not have an IVR grammar that needs to be matched; it just records what the user is saying.

So, once you reach this <record> part of the IVR code:

Code: Select all

  <form id="getrecording">
    <record name="userrecording">
      <prompt>
        Please say your first name and spell it one last time.
      </prompt>
      <filled>
        <submit next="playuserrecording.php" method="post" namelist="userrecording" enctype="multipart/form-data"/>
      </filled>
    </record>
  </form> 
there is no longer a grammar there to match.

In short, when you have that third nomatch event that eventually records what the user is saying, you are not able to get the matching grammar tags type and result along with it because there was no grammar match to begin with.

Regards,
Plum Support

to clarify

Posted: Wed Nov 25, 2009 3:20 pm
by cpe966
Hi thanks for the reply.

I am clear on what you say, but in this scenario I get 2 tries and even if my last try is discernible, there is not auto matching. For some reason I thought <record> could be checking against grammar.

In the documentation <record> is listed as parent tag for grammar -- are you saying that <record> is simply NOT doing any comparison? Or can I add the same grammar to the record tag?

Thanks

IVR doesn't support speech recognition for speech grammars

Posted: Mon Nov 30, 2009 11:33 am
by support
Hi,

To clarify, when you use the IVR tag, <record>, you record everything that the user is saying. The reason why we suggested the use of the IVR tag, <record>, is so you at least have a recording of what the user is saying to try and match your IVR grammar (remember, you're only reaching this point because the user was not able to match your grammar on 2 tries).

As for setting up an IVR grammar within your <record> tag, you are only able to setup DTMF grammars for DTMF matching, as the IVR platform does not support speech recognition for speech grammars during <record>s.

For more information, please see the VoiceXML 2.0 Specification: http://www.w3.org/TR/voicexml20/#dml2.3.6

Regards,
Plum Support