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

Reinit form without reinit count for nomatch or noinput

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

Reinit form without reinit count for nomatch or noinput

Post 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.

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

IVR code to replace use of <clear> tag

Post 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
Last edited by support on Wed Feb 24, 2010 2:36 pm, edited 5 times in total.

soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

Post 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="''" />
?

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

IVR code to prevent the use of <clear> tag

Post 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
Last edited by support on Wed Feb 24, 2010 2:37 pm, edited 4 times in total.

soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

Post 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.

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

IVR grammar solution for not using <clear> tag

Post 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
Last edited by support on Wed Feb 24, 2010 2:40 pm, edited 4 times in total.

soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

Post by soso »

Hi,

Very thanks, that's ok.

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

Thanks.

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

IVR language clarification

Post by support »

Hi,

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

Regards,
Plum Support

Post Reply