cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1003
Views
0
Helpful
6
Replies

VoiceElementUtil class methods.

sreekanth47
Level 4
Level 4

Hi all, I didn't find any description for this class in either cvp 9.5 java cod or cvp 11.5 java doc.  I want to know whats the purpose of this class. I want to know whats the purpose of below methods.

MiscVoiceElementUtil.setBrowserProperties((String)pref.getBrowserType(), (VProperty)prop);

MiscVoiceElementUtil.setFoundationFormBuiltInFieldSlot(.....).

When I use dtmfInlineGrammar() method in VField class , callstudio debugger interprets this code into

<grammar mode="dtmf" type="application/grammar+regex" xml:lang="en-US">\*</grammar>

when I use MiscVoiceElementUtil.setFoundationFormBuiltInFieldSlot(.....). before dtmfInlineGrammar()  it interprets like this.

<grammar mode="dtmf" version="1.0" root="ROOTDTMF">

       <rule id="ROOTDTMF" scope="public">

         <one-of>

           <item>

             8

             <tag><![CDATA[<Mfield "8">]]></tag>

           </item>

           <item>

             *

             <tag><![CDATA[<Mfield "*">]]></tag>

           </item>

           <item>

             7

             <tag><![CDATA[<Mfield "7">]]></tag>

           </item>

         </one-of>

       </rule>

     </grammar>

I wonder why this happens. Is the both grammar are similar?  Can any one help me to understand this.

6 Replies 6

ewindgat
Level 5
Level 5

There are often undocumented APIs. Is there some specific functionality you are looking for?

I'm writing a custom menu using vfc, where I'm using VMenuFiled.setGrammar(***) method to validate caller inputs. It is working fine while running call studio debugger. When I want to deploy this in vxml server 10.5 I'm getting error.badfetch error. Interestingly when I compare vxml pages return by voice browser, in debugger and vxml debugging logs ,I found that the above method interpret differently for the same code.

here is the code snippet

VGrammar dtmfGrammar = VGrammar.getNew(sessionAPI.getPreference());

dtmfGrammar.setDtmfInline(new String[] {,"8","9"});

menufield.setGrammar( dtmfGrammar );

When I run my custom element through debugger , it return vxml page like this,

<grammar mode="dtmf" version="1.0" root="ROOTDTMF">

       <rule id="ROOTDTMF" scope="public">

         <one-of>

           <item>

             8

             <tag><![CDATA[<Mfield "8">]]></tag>

           </item>

           <item>

             9

             <tag><![CDATA[<Mfield "7">]]></tag>

           </item>

         </one-of>

       </rule>

     </grammar>

and its running fine in debugger.  when I deploy the same code in vxml server, I'm getting error.badfetch and I heard "I'm sorry" message when I call to this application. Vxml server interprets the same code like below.

<grammar mode="dtmf" type="application/grammar+regex" xml:lang="en-US">7 8</grammar>

except this change the entire voice xml response is same in both places.

My question is , is this causes error.badfetch in vxml server? .  I solve this issue with out using VMenuFiled.setGrammar(***) , I used VMenuFiled.setChoice(***) instead and it is working fine. But why VMenuFiled.setGrammar(***) is not working in vxml server?.If you want I'll post my code. Thank you

With the cisco vxml gateway, when you use the setGrammar, it is using

regular expressions (regex) where * indicates a repetition operator, not

a DTMF.

You have to use \* to indicate that it's the DTMF * (not an operator).

It's different when you use the setChoice method - there the gateway is

NOT using regular expressions, so using * means DTMF *.

Thanks Janine, but I didn't used * . I set DTMF grammar like below.

VGrammar dtmfGrammar = VGrammar.getNew(sessionAPI.getPreference());

dtmfGrammar.setDtmfInline(new String[] {,"8","9"});

menufield.setGrammar( dtmfGrammar );

This code causes error.batfectch in vxml server.,to skip this issue, what I did is , I used

menufield.setChoice(new VoiceInput("8","eitht"),null,VoiceInput.DTMF);

menufield.setChoice(new VoiceInput("9","nine"),null,VoiceInput.DTMF);

then this method able to validate caller input. But I really have no idea why the  menufield.setGrammar() method throwing error.badfetch in vxml server ?

There are 3 different types of Fields you can create -

VMenuField (present caller with a menu, each possible option is

specified by the VMenuField.Choice class),

VBuiltinField - where you specify one of the builtin grammars

(digits,number, boolean, date, time, currency, phone)

VField - allows inline grammars.

You've created a VMenuField - so you're *only *allowed to specify the

Choices the caller can enter and what it represents.

I think you want the VField - where you can define your own inline grammars.

Please read about the VField and the VMenuField in the Javadocs.*

*

thanks janine. I'll give a try with VField.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: