The DTMFAttributes class

The DTMFAttributes class determines the number of dual tone multi-frequency (DTMF) keys the application expects in response to a prompt played using the Call.playAndGetInput() method, and also the keys the caller can use to indicate that they have finished their input. The class contains two properties, each with get and set methods:
  • maximumKeys: the maximum number of DTMF keys that the caller can enter. Specify -1 to indicate no limit.
  • delimiterKeys: a list of DTMF keys that the caller can use to indicate that they have finished entering data.
Note: If a delimiter key is specified, the maximum number of keys is ignored.

If the input should be fixed length (for example a six-digit product code), set the maximumKeys property to the number of keys you expect. The caller then simply has to key that number of digits.

If the input length can vary, set the maximumKeys property to -1, meaning “any number of keys”. Specify one or more “enter” keys by setting the delimiterKeys property to a string representing the keys that the caller can press to indicate that they have finished. As soon as the caller presses one of these keys, they are assumed to have finished. The “enter” key is not considered to be part of the input, but its value is placed in the terminationKey property of the InputResult class. To find out which key was pressed, use the InputResult.getTerminationKey() method.

The constructor methods for this class are:
DTMFAttributes()
Constructs a DTMFAttributes object with default properties maximumKeys=-1, delimiterKeys="#".
DTMFAttributes(int maximumKeys, java.lang.String delimiterKeys)
Constructs a DTMFAttributes object with the specified maximum keys value and delimiter keys string.
For example:
public class myVoiceApp extends WVRApplication {
  .
  .
  .
  // Create the attributes object - use empty constructors so that attributes have
  // default values
  public DTMFAttributes myDTMFAtts = new DTMFAttributes();
  // Then change the attributes you need
  myDTMFAtts.setMaximumKeys(6);
  myDTMFAtts.setDelimiterKeys("#");
  .
  .
  .
}