Cisco Unified Application Environment Developer Forums

« Back to Developers

RE: Gather Digits error

Combination View Flat View Tree View
Threads [ Previous | Next ]
the commandtimeout for GatherDigitOptions is declared as nullable long but it seems internally, it's treated as an int. I received the following error in the app server log when i tried to assign long.maxValue the CommandTimeout property:
MEP Parameter 'CommandTimeout' is not of expected type 'System.Int32' in action 'Metreos.MediaControl.GatherDigits'
 
The application server did not throw any exceptions except it failed to receive any DTMF inputs.

Hi Chris,
 
Sorry for the delayed response.
 
The TermCondMaxTime for the GatherzDigit action is System.Int32. You can take help from the API reference guide at
 
http://developer.cisco.com/static/cuae/2.5/2.5.1SR1/Designer/Metreos.MediaControl.GatherDigits.html
 
Regards,
Rakesh.

Yes, my point was that the app server, documentation, and generated code says different things.  The constructor for GatherDigitsOptions looks like this:
public GatherDigitsOptions
                (
                    long? termCondInterDigitDelay
                    , long? termCondMaxTime
                    , string termCondDigitPattern
                    , long? termCondMaxDigits
                    , string termCondDigit
                    , string termCondDigitList
                    , string state8
                    , long? commandTimeout
                    , int? timeout
                )

 
As you can see commandTimeout and TermCondMaxTime are both nullable long but appserver sees them as int.

Hi Chris,
 
For populating the GatherDigitsOptions, we use set methods for each GatherDigit option. These set methods set the options as expected by the App-Server.
 
You can take some help from the example application at
 
http://developer.cisco.com/web/cuae/wikidocs?src=/wiki/display/CUAE/GatherDigitsTortureChamber+-+Java+Version#http://developer.cisco.com/wiki/display/CUAE/GatherDigitsTortureChamber%20-%20Java%20Version?
 
Regards,
Rakesh.

Hi Rakesh,
This is no longer an issue for me but it may be something to look into for the next release. From the GatherDigitsTortureChamber example if instead of this:
 
GatherDigitsOptions gdOptions = new GatherDigitsOptions();
gdOptions.setTermCondDigitPattern("#");
gdOptions.setTermCondMaxDigits(6l);
gdOptions.setTermCondMaxTime(6000l);


You do this:

GatherDigitsOptions gdOptions = new GatherDigitsOptions();
gdOptions.setTermCondDigitPattern("#");
gdOptions.setTermCondMaxDigits(Long.MAX_VALUE);
gdOptions.setTermCondMaxTime(Long.MAX_VALUE);


The appserver will throw an exception (at least on .NET-C#) because internally, it expected an integer, not a long.

Hi Chris,
 
Thank you for the input, we will definitely keep this in our agenda for the next release.
 
Thanks,
Nagendra