|
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
On Wednesday, 26 October 2016 18:46:23 UTC+5:45, Ben Klang wrote: If you tried to copy/paste directly from the email, you may have been bitten by the unicode quotation marks. Try this gist instead: <a href="https://gist.github.com/bklang/f581cd4422431c9abe62b8a10410404b" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fbklang%2Ff581cd4422431c9abe62b8a10410404b\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHEVet4dsaoxoCVOQL15P9FPGQVKQ';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fbklang%2Ff581cd4422431c9abe62b8a10410404b\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHEVet4dsaoxoCVOQL15P9FPGQVKQ';return true;">https://gist.github. com/bklang/f581cd4422431c9abe62b8a10410404b
/BAK/
-- Ben Klang Principal/Technology Strategist, Mojo Lingo <a href="javascript:" target="_blank" gdf-obfuscated-mailto="0xorErdIBwAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">bkl...@... +1.404.475.4841
Mojo Lingo -- Voice applications that work like magic <a href="http://mojolingo.com/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog';return true;">http://mojolingo.com Twitter: @MojoLingo
Il giorno 26 ott 2016, alle ore 01:18, Manjil shrestha <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="0xorErdIBwAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">shrestha...@...> ha scritto:
When I tried the above thing, I get the following error when starting adhearsion:
<NoMethodError> undefined method `&' for :pre_join:Symbol On Tuesday, 25 October 2016 20:32:12 UTC+5:45, Ben Klang wrote: Since this is Ruby, and a whole framework for building apps, it doesn’t work the same way Asterisk does. You need to think about the call in terms of events: what do you want to happen when? In this case, you want to start a recording when the call is connected (bridged). You’re using `dial` to connect the call, so you want to use one of the hooks provided by that method:
<a href="http://www.rubydoc.info/gems/adhearsion/Adhearsion/CallController/Dial" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.rubydoc.info%2Fgems%2Fadhearsion%2FAdhearsion%2FCallController%2FDial\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG-OUQSsq0xu8qaybfg4YgbS7KMzQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.rubydoc.info%2Fgems%2Fadhearsion%2FAdhearsion%2FCallController%2FDial\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG-OUQSsq0xu8qaybfg4YgbS7KMzQ';return true;">http://www.rubydoc.info/gems/adhearsion/Adhearsion/CallController/Dial
Specifically, this:
- :pre_join (#<a href="http://www.rubydoc.info/gems/adhearsion/Adhearsion/CallController#call-instance_method" title="Adhearsion::CallController#call (method)" rel="nofollow" style="text-decoration:none;color:rgb(0,85,170)" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.rubydoc.info%2Fgems%2Fadhearsion%2FAdhearsion%2FCallController%23call-instance_method\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE4EFVSZAeQkvfeT3DsSXfcF5HJeQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.rubydoc.info%2Fgems%2Fadhearsion%2FAdhearsion%2FCallController%23call-instance_method\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE4EFVSZAeQkvfeT3DsSXfcF5HJeQ';return true;">call) —
A callback to be executed immediately prior to answering and joining a successful call. Is called with a single parameter which is the outbound call being joined.
Your code might look something like this:
def start_recording(call) call.record :async => true do |event| # This code will execute when the recording is complete (when the call ends) <a href="http://logger.info/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Flogger.info%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFdDAv9pN9xxAuZivrUOpFt6Ilx5Q';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Flogger.info%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFdDAv9pN9xxAuZivrUOpFt6Ilx5Q';return true;">logger.info “Your recording is at #{event.recording,uri}” end end
def run dial “SIP/#{@dial_num}”, pre_join: &:start_recording end
Note that, per the documentation, this will start the recording on the outbound call, but it should capture both channels so will do what you want.
/BAK/ -- Ben Klang Principal/Technology Strategist, Mojo Lingo bkl...@<a href="http://mojolingo.com/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog';return true;">mojolingo.com +1.404.475.4841
Mojo Lingo -- Voice applications that work like magic <a href="http://mojolingo.com/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog';return true;">http://mojolingo.com Twitter: @MojoLingo Il giorno 24 ott 2016, alle ore 23:47, Manjil shrestha < shrestha...@<a href="http://gmail.com/" target="_blank" rel="nofollow" onmousedown="this.href='http://gmail.com/';return true;" onclick="this.href='http://gmail.com/';return true;">gmail.com> ha scritto:
How do the same exact thing in adhearsion?
While the 'b' parameter in MixMonitor records the call only after it is bridged, I want to achieve the same thing in adhearsion?
How could I do that?
exten=>3001,1,Answer() │ same=>n,MixMonitor(/tmp/mixmonitor/test.wav,b) │ same=>n,Dial(SIP/3003) │ same=>n,Dial(SIP/3001) │ same=>n,Hangup()
-- You received this message because you are subscribed to the Google Groups "Adhearsion" group. To unsubscribe from this group and stop receiving emails from it, send an email to adhearsion+...@<a href="http://googlegroups.com/" target="_blank" rel="nofollow" onmousedown="this.href='http://googlegroups.com/';return true;" onclick="this.href='http://googlegroups.com/';return true;">googlegroups .com. For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.
-- You received this message because you are subscribed to the Google Groups "Adhearsion" group.To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" gdf-obfuscated-mailto="0xorErdIBwAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">adhearsion+...@ googlegroups.com. For more options, visit <a href="https://groups.google.com/d/optout" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
|