Skip to content

Commit

Permalink
Scratch pad
Browse files Browse the repository at this point in the history
See #593
  • Loading branch information
benlangfeld committed Dec 7, 2015
1 parent cf861e3 commit c893ee8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adhearsion.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'rake'
s.add_runtime_dependency 'reel', ["~> 0.5.0"]
s.add_runtime_dependency 'reel-rack', ["~> 0.2.0"]
s.add_runtime_dependency 'ruby_ami', ["~> 2.2"]
s.add_runtime_dependency 'ruby_ami', ["~> 2.4"]
s.add_runtime_dependency 'ruby_jid', ["~> 1.0"]
s.add_runtime_dependency 'ruby_speech', ["~> 2.3"]
s.add_runtime_dependency 'state_machine', ["~> 1.0"]
Expand Down
4 changes: 4 additions & 0 deletions lib/adhearsion/translator/asterisk/call.rb
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ def after(*args, &block)
translator.after(*args, &block)
end

def stop_playback
send_ami_action 'ControlPlayback', 'Control' => 'stop', 'Channel' => channel
end

private

def fetch_channel_var(variable)
Expand Down
9 changes: 7 additions & 2 deletions lib/adhearsion/translator/asterisk/component/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ def execute
with_error 'option error', e.message
end

def stop_by_redirect(*args)
def stop_by_redirect(complete_reason)
@stopped = true
super
if ami_version >= "2.0.0"
@call.stop_playback
send_complete_event complete_reason
else
super
end
end

private
Expand Down

0 comments on commit c893ee8

Please sign in to comment.