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

Limit Voice Input to 4 Chars

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Limit Voice Input to 4 Chars

Post by headpill »

Hello Support,

I am trying to take a long voice input of 11 chars in 4 broken forms and later contacting these 4 fields into one and playing back to the user. All that is working fine, but here is the issue, Like in digit i can limit user to speak or enter only 3 digit using this condition in field node type="digits?length=3", if doesn't match it will throw No Match error.

But for Voice Input if caller speaks 4 chars, where i have put in type="digits?length=3", No Match event is not thrown.
Is there anyway that i can limit the length of Voice Inputs. Out of the Box or JavaScript, How to throw No Match error in this scenario.

Please let me know.

Thanks.

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

Re: Limit Voice Input to 4 Chars

Post by support »

Hello headpill,

Can you please post your current code so that we may further assist you better.

Regards,
Plum Support

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: Limit Voice Input to 4 Chars

Post by headpill »

Here you go, First Form is Asking to input Char in voice mode, Menu form is for Confirmation what Machine heard and plays back for confirmation, 3rd form is to keep counter of Retries upto 3 and throws to Operator, 4th form is for next set of chars to accept in voice mode and then Menu form and then Counter form... same thing for 4 forms and later concatenate those fields into one.

Issue is limiting voice input to 1 or 3 or 4 and if not matches, throw NoMatch.

Thanks.

Code: Select all

  <form id="en_Ask_First_Character_of_Certificate">
    
    <property name="grammarmaxage" value="60s"/>
    <property name="grammarmaxstale" value="25s"/>
    <property name="sensitivity" value="0.3"/>
    <property name="confidencelevel" value="0.2"/>
    <property name="interdigittimeout" value="7s"/>
    <property name="speedvsaccuracy" value="0.9"/>
    <property name="incompletetimeout" value="3s"/>

    <field name="FirstCharField" type="digits?length=1">

      <prompt bargein="false">
        <audio src="our server path.FirstChar.wav">
          <voice name="Crystal">
             Please speak the first character of Certificate Number, now.
          </voice>
        </audio>
      </prompt>

      <grammar type="application/srgs+xml" mode="voice" root="ROOT1">
        <rule id="ROOT1" scope="public">
          <one-of>
            <item repeat="1-1">
              <ruleref uri="#chars1"/>
            </item>
          </one-of>
        </rule>

        <rule id="chars1" scope="public">
          <one-of>
            <item>a</item>
            <item>b</item>
            <item>c</item>
            <item>d</item>
            <item>e</item>
            <item>f</item>
            <item>g</item>
            <item>h</item>
            <item>i</item>
            <item>j</item>
            <item>k</item>
            <item>l</item>
            <item>m</item>
            <item>n</item>
            <item>o</item>
            <item>p</item>
            <item>q</item>
            <item>r</item>
            <item>s</item>
            <item>t</item>
            <item>u</item>
            <item>v</item>
            <item>w</item>
            <item>x</item>
            <item>y</item>
            <item>z</item>
            <item>zero</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>
        <assign name="CertFirstChar" expr="FirstCharField"/>
        <goto next="#en_verify_FirstChar" />
      </filled>
      
      <noinput>
        <prompt bargein="true">
          <audio src="NoInput.wav">
            <voice name="Crystal">
              You did not enter anything.
            </voice>
          </audio>
        </prompt>
        <goto next="#en_incorrect_First_Character_of_Cert" />
      </noinput>

      <property name="timeout" value="5s"/>

      <nomatch>
        <prompt bargein="true">
          <audio src="AbsoultePathOfOurServer/NoMatcha.wav">
            <voice name="Crystal">
              Sorry, I did not catch that.
            </voice>
          </audio>
        </prompt>

        <goto next="#en_incorrect_First_Character_of_Cert" />
      </nomatch>

    </field>
  </form>
  
  <menu id="en_verify_FirstChar">

    <property name="sensitivity" value="0.3"/>
    <property name="confidencelevel" value="0.2"/>

     <prompt bargein="true">
        <audio src="AbsoultePathOfOurServer/IHeard.wav">
          <voice name="crystal">
            I heard
          </voice>
        </audio>
      </prompt>

     <prompt bargein="false">
      <voice name="Mike">
        <say-as type="acronym">
             <value expr="CertFirstChar"/>
        </say-as>
      </voice>
     </prompt>

    <prompt bargein="true">
      <audio src="AbsoultePathOfOurServerCorrectYesOrNo.wav">
        <voice name="crystal">
          Is that correct?
          If yes, press or say 1, If no, press or say 2.
        </voice>
      </audio>
    </prompt>

	 <property name="timeout" value="5s"/>
	
     <noinput>
        <prompt bargein="true">
          <audio src="NoInput.wav">
            <voice name="Crystal">
              You did not enter anything.
            </voice>
          </audio>
        </prompt>
        <goto next="#en_incorrect_First_Character_of_Cert" />
      </noinput>

      <property name="timeout" value="5s"/>

      <nomatch>
        <prompt bargein="true">
          <audio src="AbsoultePathOfOurServer/NoMatcha.wav">
            <voice name="Crystal">
              Sorry, I did not catch that.
            </voice>
          </audio>
        </prompt>

        <goto next="#en_incorrect_First_Character_of_Cert" />
      </nomatch>
    
	<choice dtmf="1" next="#en_Ask_Eight_Character_of_ECheck_Certificate">One</choice>
    <choice dtmf="2" next="#en_incorrect_First_Character_of_Cert">Two</choice>
    <choice dtmf="0" next="#en_help">Help</choice>
  </menu>
  
   <!-- Counter of No Input, No Match or Callers Declines what he heard - Any Combination of retry sums to 3 will send Caller to Operator -->
  <form id="en_incorrect_First_Character_of_Cert">
    <block>
      <assign name="First_Character_of_Cert_Counter" expr="++First_Character_of_Cert_Counter"/>
      <if cond="First_Character_of_Cert_Counter < replay_max">
	  
		<prompt bargein="true">
          <audio src="AbsoultePathOfOurServerPlsTryAgain.wav">
            <voice name="Crystal">
              Please try again.
            </voice>
          </audio>
        </prompt>
			
        <goto next="#en_Ask_First_Character_of_Certificate"/>
        <else/>
        <prompt bargein="true">
          <audio src="AbsoultePathOfOurServerFirst_Character_of_ECheck_Counter.wav">
            <voice name="crystal"> 
              It seems you are having difficulty entering the First Character of Certificate.
            </voice>
          </audio>
        </prompt>
        <goto next="#en_help"/> <!-- Sent to Operator-->
      </if>
    </block>
  </form> 
  
  
  <form id="en_Ask_Eight_Character_of_ECheck_Certificate">
    
    <property name="grammarmaxage" value="60s"/>
    <property name="grammarmaxstale" value="25s"/>
    <property name="sensitivity" value="0.3"/>
    <property name="confidencelevel" value="0.2"/>
    <property name="interdigittimeout" value="7s"/>
    <property name="speedvsaccuracy" value="0.9"/>
    <property name="incompletetimeout" value="3s"/>

    <field name="FourCharField" type="digits?length=4">
	
      <property name="timeout" value="10s"/>
        
      <prompt bargein="false">
        <audio src="AbsoultePathOfOurServerSpeakECheckLastFour.wav">
          <voice name="Crystal">
             Please speak the last four characters of Certificate Number, now.
          </voice>
        </audio>
      </prompt>

      <grammar type="application/srgs+xml" mode="voice" root="ROOT2">
        <rule id="ROOT2" scope="public">
          <one-of>
            <item repeat="1-4">
              <ruleref uri="#chars2"/>
            </item>
          </one-of>
        </rule>

        <rule id="chars2" scope="public">
          <one-of>
            <item>a</item>
            <item>b</item>
            <item>c</item>
            <item>d</item>
            <item>e</item>
            <item>f</item>
            <item>g</item>
            <item>h</item>
            <item>i</item>
            <item>j</item>
            <item>k</item>
            <item>l</item>
            <item>m</item>
            <item>n</item>
            <item>o</item>
            <item>p</item>
            <item>q</item>
            <item>r</item>
            <item>s</item>
            <item>t</item>
            <item>u</item>
            <item>v</item>
            <item>w</item>
            <item>x</item>
            <item>y</item>
            <item>z</item>
            <item>zero</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>
        <assign name="CertFourChar" expr="FourCharField"/>
        <goto next="#en_verify_CertFourChar" />
      </filled>

	  <property name="timeout" value="5s"/>
	  
	 <noinput>
        <prompt bargein="true">
          <audio src="AbsoultePathOfOurServerNoInput.wav">
            <voice name="Crystal">
              You did not enter anything.
            </voice>
          </audio>
        </prompt>
        <goto next="#en_incorrect_Four_Character_of_Cert" />
      </noinput>

      <property name="timeout" value="5s"/>

      <nomatch>
        <prompt bargein="true">
          <audio src="AbsoultePathOfOurServerNoMatcha.wav">
            <voice name="Crystal">
              Sorry, I did not catch that.
            </voice>
          </audio>
        </prompt>

        <goto next="#en_incorrect_Four_Character_of_Cert" />
      </nomatch>
    
    </field>
  </form>

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

Re: Limit Voice Input to 4 Chars

Post by support »

Hi,

At this point, we will need to refer you to your sales representative due to the extensive amount of code we've written up for your account thus far. You will require additional resources for this work. Your sales representative been updated on the matter.

Regards,
Plum Support

Post Reply