def play_and_get_digits file, invalid_file, args={}, &block
      min         = args[:min]          || 1
      max         = args[:max]          || 2
      tries       = args[:tries]        || 3
      terminators = args[:terminators]  || "#"
      timeout     = args[:timeout]      || 5000
      variable    = args[:variable]     || "read_digits_var"
      regexp      = args[:regexp]       || "\\d+"

      args = [min, max, tries, timeout, terminators, file, invalid_file,
        variable, regexp].join " "

      params = {:variable => variable}

      application "play_and_get_digits", args, params, &block
    end
def play_and_get_digits file, invalid_file, args={}, &block
      min         = args[:min]          || 1
      max         = args[:max]          || 2
      tries       = args[:tries]        || 3
      terminators = args[:terminators]  || "#"
      timeout     = args[:timeout]      || 5000
      variable    = args[:variable]     || "read_digits_var"
      regexp      = args[:regexp]       || "\\d+"

      args = [min, max, tries, timeout, terminators, file, invalid_file,
        variable, regexp].join " "

      params = {:variable => variable}

      application "play_and_get_digits", args, params, &block
    end
Plays a sound file and reads DTMF presses.
 @example
   play_and_get_digits "please-enter.wav", "wrong-choice.wav",
     :min          => 1,
     :max          => 2,
     :tries        => 3,
     :terminators  => "#",
     :timeout      => 5000,
     :regexp       => '\d+'
 @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits