Skip to content

Instantly share code, notes, and snippets.

@bklang
Created October 26, 2016 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bklang/f581cd4422431c9abe62b8a10410404b to your computer and use it in GitHub Desktop.
Save bklang/f581cd4422431c9abe62b8a10410404b to your computer and use it in GitHub Desktop.
class ExampleController < Adhearsion::CallController
def start_recording(call)
call.record :async => true do |event|
# This code will execute when the recording is complete (when the call ends)
logger.info "Your recording is at #{event.recording,uri}"
end
end
def run
dial "SIP/#{@dial_num}", pre_join: &:start_recording
end
end
@smanjil
Copy link

smanjil commented Oct 27, 2016

The error is still present although I do it from the gist or I type it all instead of copy paste:

WARNING: Nokogiri was built against LibXML version 2.9.1, but has dynamically loaded 2.8.0
Starting Adhearsion server at /home/ano/myapp
script/ahn: /home/ano/myapp/lib/example_controller.rb:15: syntax error, unexpected & (SyntaxError)
dial "SIP/3001", pre_join: &:start_recording

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment