cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
78
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Sreeram Judala on 08-02-2010 05:38:53 PM
Hi,
 
I have a call flow with an initial Audio element(Welcome Message) followed by a "Form element" by name MAINMENU_DM(Menu with two options 1 & 2). (Refer attached image)
The exist state 1 is pointed back to the same Form elment i.e. MAINMENU_DM.
The exist state 2 is pointed to Subdialog return.

I am trying to caputure the DTMF input in call end as below:

String strDtmf = callEndAPI.getElementData(strCurElementName, "value");

When I press 2, I am able to caputure the DTMF input and I am able to print in the CallEnd
But when I am pressing 1 (Which is pointed back to the same Form element), I am getting java.lang.NullPointerException

Please let me know, whether we can capture the DTMF input if one of our exist states from the Form element is pointing to the same Form element?
 
If its not possible to caputure, please let me know why and is there any alternative?

Subject: RE: Capturing DTMF Input from a Form element
Replied by: Janine Graves on 08-02-2010 09:49:40 PM
Hi,
 
I just tried this. Interestingly, if you were using the 2_Option_Menu element, then your java code would work. When I press 1, then loop back into a Menu element, then hangup, the call end action has access to the 2_Option_Manu.value variable!
 
But, with a Form element, if I execute the Form, press 1, then loop back into the form, then hangup, the call end action shows the element data value as null. The Form element's java code must be deleting any old value that exists.
 
One thing you could do is connect the Form element's done path to an element that copies the MAINMENU_DM.value into its own Element (or session) variable. And on the CallEnd, retrieve this new element's variable.
 
For example, use the ApplicationModified element (rename it MAINMENU_DM_VALUE) and use its Data tab to create Element data named 'value' with the value {Data.Element.MAINMENU_DM.value}.  Then in your Call End class, get the element data as follows:  ElementData("MAINMENU_DM_VALUE","value");
 
Regards, Janine
 
 

Subject: RE: Capturing DTMF Input from a Form element
Replied by: Sreeram Judala on 09-02-2010 07:20:45 AM
Thank you Janine,
 
As per your suggestion, I am able to capture the DTMF input from the form element as a Element Data or Session Data in the same element or its subsequent element.  But I have hundreds of such elements in my application. I need to do the same thing in all places which is tiresome and also not a good practice.
 
Is there any alternative?
 
 
Thanks,
Sreeram.

Subject: Re: New Message from Sreeram Judala in Customer Voice Portal (CVP) - Genera
Replied by: Janine Graves on 09-02-2010 01:40:11 PM
Here are some options that come to mind, none are perfect:

1. Ask Cisco nicely to change the way the element is written
2. Use the menu element instead of the form element (not always possible)
3. Write your own custom Form element that extends the existing Form
element. In your extended element's runtime method (addXmlBody) you
invoke the super.addXmlBody and if that returns  the 'done'  exit state,
then get its element data and store it into another variable for
safe-keeping. It's basically what I suggested previously, but it
automates the process.
4. Within each Form element, use its Data tab to copy that element's
'value' variable into a Session variable, AFTER the element executes.
It's basically what I suggested previously, but you do it within the
element.
5. Ask Cisco VERY, VERY nicely to change the way the Form element is written

-Janine
www.TrainingTheExperts.com


Cisco Developer Community Forums wrote:
> Sreeram Judala has created a new message in the forum "General
> Discussion - All Versions":
>
> --------------------------------------------------------------
> Thank you Janine,
> Â
> As per your suggestion, I am able to capture the DTMF input from the
> form element as a Element Data or Session Data in the same element or
> its subsequent element.  But I have hundreds of such elements in my
> application. I need to do the same thing in all places which is
> tiresome and also not a good practice.
> Â
> Is there any alternative?
> Â
> Â
> Thanks,
> Sreeram.
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1955546>
>
> or simply reply to this email.
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:

Quick Links