Page 1 of 1

Reinit form without reinit count for nomatch or noinput

Posted: Tue Feb 24, 2009 6:25 am
by soso
Hi,

I've another problem with nomatch or noinput events.

On a field, when this events are called, i want to use the <reprompt> and <clear> method to reinit the form.

But, when I use the <clear>, is clear also the count for nomatch and noinput events.

And my problem is that I want to use the count to exit after 3 retry (<nomatch count="3">).

How can I clear the form without clear the count for noinput and nomatch events?

Very thanks by advance.

IVR code to replace use of <clear> tag

Posted: Tue Feb 24, 2009 10:19 am
by support
Hi,

As a suggestion, we recommend that you not use the IVR tag, <clear>, when the noinput and nomatch events are called so that you avoid this IVR problem. For example use this IVR code:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="input">
<grammar type="application/srgs+xml" root="ROOT" mode="dtmf">
  <rule id="ROOT">
    <one-of>
      <item>
        1
      </item>
    </one-of>
  </rule>
</grammar>

<prompt>
Please enter something.
</prompt>

<filled>
<prompt>
  You entered <value expr="input"/>.
</prompt>
</filled>

<noinput count="1">
I'm sorry, I didn't hear you.
<reprompt/>
</noinput>

<noinput count="2">
I'm sorry, I didn't hear you.
<reprompt/>
</noinput>

<noinput count="3">
I'm sorry, I didn't hear you. Good bye.
<disconnect/>
</noinput>

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

<nomatch count="2">
I'm sorry, I didn't understand you.
<reprompt/>
</nomatch>

<nomatch count="3">
I'm sorry, I didn't understand you. Good bye.
<disconnect/>
</nomatch>

</field>
</form>
</vxml>
We recommend that you only use the IVR tag, <clear>, when you are absolutely sure that you want to clear everything from the field (field variables, noinput and nomatch counts, the field shadow variables, etc.).

Hope this helps.

Regards,
Plum Support

Posted: Tue Feb 24, 2009 10:37 am
by soso
Ok, thansk.

If I want to clear only the variable on the form, how can I do?

Code: Select all

<var name="firstname" expr="''" />
?

IVR code to prevent the use of <clear> tag

Posted: Tue Feb 24, 2009 10:54 am
by support
Hi,

Could you provide us with more context of your IVR code? Perhaps we could make a suggestion to your IVR code that would help prevent the use of the IVR tag, <clear>.

Regards,
Plum Support

Posted: Tue Feb 24, 2009 10:59 am
by soso
Ok, I this code:

Code: Select all

<form id="saisie">
    
        <var name="input_are" />
        
        <field name="are">
        
            <grammar root="are" type="application/srgs+xml" mode="dtmf"> 
            
                <rule id="are" scope="public">
                    <one-of> 
                        <item repeat="0-255"> 
                            <ruleref uri="#digit"/> 
                        </item>
                    </one-of>
                </rule>

                <rule id="digit" scope="public">
                    <one-of> 
                        <item> 0 </item> 
                        <item> 1 </item> 
                        <item> 2 </item> 
                        <item> 3 </item> 
                        <item> 4 </item> 
                        <item> 5 </item> 
                        <item> 6 </item> 
                        <item> 7 </item> 
                        <item> 8 </item> 
                        <item> 9 </item>    
                    </one-of>
                </rule>
            </grammar>        
        
            <filled>            
                <if cond="are$.utterance==''">
                    <throw event="nomatch" />
                <elseif cond="are$.utterance.length > 10" />
                    <assign name="essai" expr="essai+1" />
                    
                    <if cond="essai==3" >                        
                        <goto next="#fin" />
                    <else />
                        <assign name="result" expr="false" />
                    
                        <clear namelist="are" />
                        <reprompt />
                    </if>
                <else />
                    <assign name="result" expr="true" />
                </if>
            </filled>
        
            <noinput>
                <assign name="essai" expr="essai+1" />
                
                <if cond="essai==3">                    
                    <goto next="#fin" />                
                <else />
                    <clear namelist="are" />
                    <reprompt />
                </if>
            </noinput>

            <noinput count="3">                
                <goto next="#fin" />
            </noinput>
            
            <nomatch>
                <assign name="essai" expr="essai+1" />
                
                <if cond="essai==3">                    
                    <goto next="#fin" />                
                <else />
                    <clear namelist="are" />
                    <reprompt />
                </if>                
            </nomatch>
        
            <nomatch count="2">
                <clear namelist="are" />
                <reprompt />        
            </nomatch>
            
            <nomatch count="3">                
                <goto next="#fin" />
            </nomatch>
        </field>
    </form>
Actually, I use the variable "essai" to make this function.

IVR grammar solution for not using <clear> tag

Posted: Tue Feb 24, 2009 3:27 pm
by support
Hi,

Looking through your IVR code, since your IVR grammar is dtmf-only and only consists of digits, you should rearrange your field to just have this IVR grammar:

<grammar src="builtin:dtmf/digits?maxlength=10"/>

For an IVR example:

Code: Select all

<vxml version="2.0">
<form id="saisie">

        <field name="are">
            <grammar src="builtin:dtmf/digits?maxlength=10"/>

            <prompt>
              Please enter some digits.
            </prompt>

            <filled>
              <prompt>
                You entered <value expr="are"/>. You entered less than 11 digits.
              </prompt>
            </filled>

            <catch event="noinput">
            <prompt>I'm sorry, I didn't hear you.</prompt>
            <reprompt/>
            </catch>

            <catch event="noinput" count='3'>
            <prompt>I'm sorry, I didn't hear you. Good bye.</prompt>
            </catch>

            <catch event="nomatch">
            <prompt>I'm sorry, I didn't understand you.</prompt>
            <reprompt/>
            </catch>

            <catch event="nomatch" count='3'>
            <prompt>I'm sorry, I didn't understand you. Good bye.</prompt>
            </catch>
        </field>
</form>
</vxml>
From this change in IVR code, you would not have to use the voiceXML <clear>tag.

Regards,
Plum Support

Posted: Wed Feb 25, 2009 6:33 am
by soso
Hi,

Very thanks, that's ok.

What is the difference between <nomatch> tag and <catch event="nomatch"> ?

Thanks.

IVR language clarification

Posted: Wed Feb 25, 2009 9:38 am
by support
Hi,

There's actually no difference between the two in IVR applications. Sorry for any confusion.

Regards,
Plum Support