Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t override server-supplied timeouts #19

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/adhearsion-asr/prompt_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ def initialize(output_document, grammars, options)
input_options = {
mode: options[:mode] || :dtmf,
initial_timeout: (options[:timeout] || Plugin.config.timeout) * 1000,
inter_digit_timeout: (options[:timeout] || Plugin.config.timeout) * 1000,
max_silence: (options[:timeout] || Plugin.config.timeout) * 1000,
min_confidence: Plugin.config.min_confidence,
grammars: grammars,
recognizer: Plugin.config.recognizer,
Expand Down
18 changes: 4 additions & 14 deletions spec/adhearsion-asr/controller_methods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ def self.temp_config_value(key, value, namespace = Plugin.config)
{
mode: :dtmf,
initial_timeout: 5000,
inter_digit_timeout: 5000,
max_silence: 5000,
min_confidence: 0.5,
recognizer: nil,
language: 'en-US',
Expand Down Expand Up @@ -305,9 +303,7 @@ def self.temp_config_value(key, value, namespace = Plugin.config)
let(:expected_grxml) { digit_limit_grammar }

before do
expected_input_options.merge! initial_timeout: 10000,
inter_digit_timeout: 10000,
max_silence: 10000
expected_input_options.merge! initial_timeout: 10000
end

it "executes a Prompt with correct timeout (initial, inter-digit & max-silence)" do
Expand All @@ -321,9 +317,7 @@ def self.temp_config_value(key, value, namespace = Plugin.config)
let(:expected_grxml) { digit_limit_grammar }

before do
expected_input_options.merge! initial_timeout: 10000,
inter_digit_timeout: 10000,
max_silence: 10000
expected_input_options.merge! initial_timeout: 10000
end

temp_config_value :timeout, 10
Expand Down Expand Up @@ -708,9 +702,7 @@ def self.temp_config_value(key, value, namespace = Plugin.config)

context "with a timeout specified" do
before do
expected_input_options.merge! initial_timeout: 10000,
inter_digit_timeout: 10000,
max_silence: 10000
expected_input_options.merge! initial_timeout: 10000
end

it "executes a Prompt with correct timeout (initial, inter-digit & max-silence)" do
Expand All @@ -724,9 +716,7 @@ def self.temp_config_value(key, value, namespace = Plugin.config)

context "with a different default timeout" do
before do
expected_input_options.merge! initial_timeout: 10000,
inter_digit_timeout: 10000,
max_silence: 10000
expected_input_options.merge! initial_timeout: 10000
end

temp_config_value :timeout, 10
Expand Down