Sha256: aabe7474b5db9863dff8eb6d82b5c7a68eaf77c3c8696f0f9745ba279958a0d4

Contents?: true

Size: 960 Bytes

Versions: 7

Compression:

Stored size: 960 Bytes

Contents

require "fsr/app"
module FSR
  #http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits
  module App
    class PlayAndGetDigits < Application
      def initialize(sound_file, invalid_file, min = 0, max = 10, tries = 3, timeout = 7000, terminators = ["#"], chan_var = "fsr_read_dtmf", regexp = "\d")
        @sound_file = sound_file
        @invalid_file = invalid_file
        @min = min
        @max = max
        @tries = tries
        @timeout = timeout
        @chan_var = chan_var
        @terminators = terminators
        @regexp = regexp
      end

      def arguments
        [@min, @max, @tries, @timeout, @terminators.join(","), @sound_file, @invalid_file, @chan_var, @regexp]
      end

      def sendmsg
        "call-command: execute\nexecute-app-name: %s\nexecute-app-arg: %s\nevent-lock:true\n\n" % ["play_and_get_digits", arguments.join(" ")]
      end

    end

    register(:play_and_get_digits, PlayAndGetDigits)
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
bougyman-freeswitcher-0.1.0 lib/fsr/app/play_and_get_digits.rb
bougyman-freeswitcher-0.1.1 lib/fsr/app/play_and_get_digits.rb
bougyman-freeswitcher-0.1.2 lib/fsr/app/play_and_get_digits.rb
bougyman-freeswitcher-0.1.3 lib/fsr/app/play_and_get_digits.rb
bougyman-freeswitcher-0.1.4 lib/fsr/app/play_and_get_digits.rb
freeswitcher-0.1.4 lib/fsr/app/play_and_get_digits.rb
freeswitcher-0.1.3 lib/fsr/app/play_and_get_digits.rb