Set Default Language unless Switch Language

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

  • Author
  • Message
Offline

headpill

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

Set Default Language unless Switch Language

PostMon Feb 01, 2016 10:25 am

Hello,

We have a requirement which looks very ordinary/Simple. Here is how the Greeting (Prompt) looks like -
"Thanks for calling XYZ company, For Spanish Press 2."
Means, If user do not press 2, start playing prompts in English (Technically, do not go to Spanish Branch of the VXML).

The challenge is - The VXML should have a Language default to English unless Caller Presses 2 to select language.

If i have an option where i can prompt caller for language selection in the greeting like Press 1 for English or Press 2 for Spanish, i would have used the below code.

But how to achieve the requirement where i can keep English Language as Default and Wait if user do not press 2 in few seconds go to English Intro Menu. Can you please review the below code and guide me how to modify the language selection code.

Code: Select all
<form id="languageselection">
<property name="sensitivity" value="0.2"/>
<property name="confidencelevel" value="0.75"/>
    <field name="lang">
       <grammar>1{English}|2{Spanish}</grammar>
          <prompt bargein="false">
             <voice name="Crystal">
                For English, press 1.
             </voice>
          </prompt>
         
          <prompt bargein="false">
             <voice name="Rosa" xml:lang="es-MX">
                Para espanol, marque dos.
             </voice>
          </prompt>
         
       <filled>
          <if cond="lang =='English'">
             <goto next="en_intromenu"/>
          <else/>
             <goto next="sp_intromenu"/>
          </if>
       </filled>
   </field>
</form>


Please guide.
Offline

support

  • Posts: 3628
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

Re: Set Default Language unless Switch Language

PostMon Feb 01, 2016 12:20 pm

Hi headpill,

If you would like your English menu to be the default one and start a few seconds after the initial prompt without any user input you would use the <noinput> tag with a <goto next=""/> tag. Below is an example of code to show how this is done :
Code: Select all
<form id="mainmenu">
 <field name="lang">
  <prompt>
   Thanks for calling XYZ company. For Spanish press 2.
  </prompt>

<grammar type="application/srgs+xml" root="DTMF" mode="dtmf">
 <rule id="DTMF">
  <one-of>
    <item>2</item>
  </one-of>
 </rule>
</grammar>

<!-- Goes to english menu after a few seconds of no input -->
<noinput>
 <goto next="#en_intromenu"/>
</noinput>

 <filled>
  <if cond="lang=='2'">
   <goto next="#sp_intromenu"/>
  </if>
 </filled>
</field>
</form>

<form id="sp_intromenu">
 <block>
  <prompt>
   This is the Spanish Menu.
  </prompt>
 </block>
</form>

<form id="en_intromenu">
 <block>
  <prompt>
   This is the English menu.
  </prompt>
 </block>
</form>


Hope this helps!

Regards,
Plum Support
Offline

headpill

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

Re: Set Default Language unless Switch Language

PostMon Feb 01, 2016 11:47 pm

Thanks, it was a great logic, works perfect.

However, is there anyway to control the wait time and then go to No Input Tag,
How to delay before code goes to NoInput Tag. I do not see a delay kind of property available for Noinput tag.
What is the default wait time in seconds before code goes to noinput if user didn't press anything.
Pleas let Me know.
Offline

support

  • Posts: 3628
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

Re: Set Default Language unless Switch Language

PostTue Feb 02, 2016 9:02 am

Hello headpill,

Yes it is possible to extend the wait time to any value you wish. Please find a small snippet below of how to achieve this.
Code: Select all
<property name="timeout" value="6s"/>
  <noinput>
   <goto next="#en_intromenu"/>
  </noinput>


Simply change the value of 6 to your liking.
Hope this helps!

Regards,
Plum Support
Offline

headpill

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

Re: Set Default Language unless Switch Language

PostTue Feb 02, 2016 11:15 am

So i just do like this in the below code. That's it. Code for your review.

I know it will work, but out of curiousity, wanted to know how the Property Tag is associated to NoInput.
Or the Code goes line by line and waits for timeout and then goes to NoInput Tag?

Code: Select all
<form id="mainmenu">
 <field name="lang">
  <prompt>
   Thanks for calling XYZ company. For Spanish press 2.
  </prompt>

<grammar type="application/srgs+xml" root="DTMF" mode="dtmf">
 <rule id="DTMF">
  <one-of>
    <item>2</item>
  </one-of>
 </rule>
</grammar>

<!-- Goes to english menu after a few seconds of no input -->
<property name="timeout" value="5s"/>
  <noinput>
   <goto next="#en_intromenu"/>
  </noinput>

 <filled>
  <if cond="lang=='2'">
   <goto next="#sp_intromenu"/>
  </if>
 </filled>
</field>
</form>

<form id="sp_intromenu">
 <block>
  <prompt>
   This is the Spanish Menu.
  </prompt>
 </block>
</form>

<form id="en_intromenu">
 <block>
  <prompt>
   This is the English menu.
  </prompt>
 </block>
</form>
Offline

support

  • Posts: 3628
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

Re: Set Default Language unless Switch Language

PostTue Feb 02, 2016 11:20 am

Hi,

The timeout property dictates the interval where the caller has to begin entering input before a nomatch event occurs. Setting this property to 5s gives the caller 5 seconds to start entering input before the nomatch even is thrown. So if a caller enters nothing for 5 seconds, that nomatch event will occur and the <nomatch> block of code will execute.
Regards,
Plum Support
Offline

Robo

  • Posts: 1
  • Joined: Mon Oct 24, 2016 7:48 am

Re: Set Default Language unless Switch Language

PostWed Oct 26, 2016 1:57 am

support wrote:Hi,

The timeout property dictates the interval where the caller has to begin entering input before a nomatch event occurs. Setting this property to 5s gives the caller 5 seconds to start entering input before the nomatch even is thrown. So if a caller enters nothing for 5 seconds, that nomatch event will occur and the <nomatch> block of code will execute.
Regards,
Plum Support


Awesome, if nothing is pressed in x amount of time can they be sent to a real person?
Offline

support

  • Posts: 3628
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

Re: Set Default Language unless Switch Language

PostThu Oct 27, 2016 2:28 pm

Hello Robo,
In the code below we can show on the final nomatch the user is being transferred to a premium support line.(Also a deeper explanation can be found at our Dev docs located here: http://www.plumvoice.com/docs/dev/developer_reference:tutorial )


Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <field name="id" type="digits?length=7">
      <prompt count="1">
        Enter your customer identification number.
      </prompt>
      <prompt count="2">
        Enter your seven digit customer identification
        number.
      </prompt>
      <prompt count="3">
        Your customer identification number can be
        found on the front of your membership card.
        Enter your seven digit customer identification
        number.
      </prompt>
      <filled>
        <assign name="customerid" expr="id"/>
        <prompt>
          You entered <value expr="customerid"/>.
        </prompt>
        <!-- transfer to premium support -->
      </filled>
      <catch event="nomatch noinput" count="1">
       <!-- this code executes for count 1 and 2, the FIA looks at all of the matching <catch> elements and finds the highest count value that is <= the current count-->
         <prompt>
          Your input was not valid.
        </prompt>
        <reprompt/>
      </catch>
      <catch event="nomatch noinput" count="3">
        <prompt>
          It seems you are having difficulty with your identification number, we will transfer you to customer service.
        </prompt>
        <!-- transfer caller to customer service -->
      </catch>
    </field>
  </form>
</vxml>




To transfer use this VoiceXML Tag:
Code: Select all
<transfer dest="+11234567890" connecttimeout="20s" bridge="true"/>



Also you can add the special property of timeout to change how long the user has to input an appropriate response. For example:
Code: Select all
<property name="timeout" value="7s"/>


Regards,
Plum Support
Offline

EugeneRice

  • Posts: 1
  • Joined: Wed Jun 13, 2018 11:51 pm

Re: Set Default Language unless Switch Language

PostWed Jun 13, 2018 11:56 pm

support wrote:Also you can add the special property of timeout to change how long the user has to input an appropriate response. For example:
Code: Select all
<property name="timeout" value="7s"/>


Regards,
Plum Support


I was looking for a solution for some other problem regarding timeout and while searching google landed on this page.
Code: Select all
<property name="timeout" value="7s"/>


The above instruction solved my problem. Thank for helping me out (unknowingly).
Offline

lexenluis

  • Posts: 1
  • Joined: Mon Jun 25, 2018 6:07 am

Re: Set Default Language unless Switch Language

PostMon Jun 25, 2018 6:21 am

EugeneRice wrote:
support wrote:Also you can add the special property of timeout to change how long the user has to input an appropriate response. For example:
Code: Select all
<property name="timeout" value="7s"/>


Regards,
Plum Support


I was looking for a solution for some other problem regarding timeout and while searching google landed on this page.
Code: Select all
<property name="timeout" value="7s"/>


The above instruction solved my problem. Thank for helping me out (unknowingly).

Yes I think this code
Code: Select all
<property name="timeout" value="7s"/>
definitely solved the problem. Thanks, But,
I also want to know How much we extend the timeout. Is there any limit?
Offline

support

  • Posts: 3628
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

Re: Set Default Language unless Switch Language

PostMon Jun 25, 2018 1:08 pm

Hello,

There is a timeout limit of 60 seconds.

Regards,
Plum Support
Offline

NathanielIngram

  • Posts: 1
  • Joined: Fri Dec 21, 2018 7:42 am

Re: Set Default Language unless Switch Language

PostFri Dec 21, 2018 7:45 am

support wrote:Hello,

There is a timeout limit of 60 seconds here.

Regards,
Plum Support


Is there any way to extend the timeout limit to say, 90 or 120 seconds?
Last edited by NathanielIngram on Wed Mar 06, 2019 1:53 pm, edited 2 times in total.
Offline

support

  • Posts: 3628
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

Re: Set Default Language unless Switch Language

PostFri Dec 21, 2018 1:58 pm

Hi,

The 60 second limit on the timeout property is hardcoded into our platform, and currently cannot be extended. We can add this to our list of feature requests to evaluate but there is currently no plan to increase this limit.

Regards,
Plum Support
Offline

RobertRamirez

  • Posts: 2
  • Joined: Thu Jan 31, 2019 7:17 am

Re: Set Default Language unless Switch Language

PostMon Feb 04, 2019 7:51 am

how to extend the https://arynews.tv/en/tag/asif-ali-zardari/ hardcore timeout.
Last edited by RobertRamirez on Tue Feb 12, 2019 5:14 am, edited 2 times in total.
Offline

RobertRamirez

  • Posts: 2
  • Joined: Thu Jan 31, 2019 7:17 am

Re: Set Default Language unless Switch Language

PostMon Feb 04, 2019 7:58 am

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

<form id="name">
<field name="getuserlastname" type="lastname">
<prompt bargein="false">
Say your last name and spell it.
</prompt>
</field>

<field name=" https://arynews.tv/en/ getuserfirstname" type="firstname">
<prompt bargein="false">
Say your first name and spell it.
</prompt>
</field>

<block>
<prompt bargein="false">
Your first name is <value expr="getuserfirstname"/>
and your last name is <value expr="getuserlastname"/>.
</prompt>
</block>
Last edited by RobertRamirez on Tue Feb 12, 2019 5:14 am, edited 2 times in total.
Next

Return to Plum DEV Q&A

Who is online

Users browsing this forum: No registered users and 1 guest

cron