Call conversation recording

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Call conversation recording

Manjil shrestha
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Call conversation recording

Ben Klang-2
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:


Specifically, this:

  • :pre_join (#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)
    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
+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno 24 ott 2016, alle ore 23:47, Manjil shrestha <[hidden email]> 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 [hidden email].
For more options, visit 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.
Reply | Threaded
Open this post in threaded view
|

Re: Call conversation recording

Manjil shrestha
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" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.rubydoc.info%2Fgems%2Fadhearsion%2FAdhearsion%2FCallController%2FDial\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG-OUQSsq0xu8qaybfg4YgbS7KMzQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.rubydoc.info%2Fgems%2Fadhearsion%2FAdhearsion%2FCallController%2FDial\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG-OUQSsq0xu8qaybfg4YgbS7KMzQ&#39;;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)" style="text-decoration:none;color:rgb(0,85,170)" target="_blank" rel="nofollow" onmousedown="this.href=&#39;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&#39;;return true;" onclick="this.href=&#39;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&#39;;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" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flogger.info\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGOfWV_MqSEYOUyz77vBSYyM6smOg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flogger.info\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGOfWV_MqSEYOUyz77vBSYyM6smOg&#39;;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
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3wP5ruj_BgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;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=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;return true;">http://mojolingo.com
Twitter: @MojoLingo

Il giorno 24 ott 2016, alle ore 23:47, Manjil shrestha <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3wP5ruj_BgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">shrestha...@...> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3wP5ruj_BgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">adhearsion+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;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.
Reply | Threaded
Open this post in threaded view
|

Re: Call conversation recording

Ben Klang-2
If you tried to copy/paste directly from the email, you may have been bitten by the unicode quotation marks.  Try this gist instead: https://gist.github.com/bklang/f581cd4422431c9abe62b8a10410404b


/BAK/

-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno 26 ott 2016, alle ore 01:18, Manjil shrestha <[hidden email]> 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:


Specifically, this:

  • :pre_join (#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)
    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
+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno 24 ott 2016, alle ore 23:47, Manjil shrestha <shrestha...@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+...@googlegroups.com.
For more options, visit 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.

--
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.
Reply | Threaded
Open this post in threaded view
|

Re: Call conversation recording

Manjil shrestha
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=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fbklang%2Ff581cd4422431c9abe62b8a10410404b\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHEVet4dsaoxoCVOQL15P9FPGQVKQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fbklang%2Ff581cd4422431c9abe62b8a10410404b\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHEVet4dsaoxoCVOQL15P9FPGQVKQ&#39;;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=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;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=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;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=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;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=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.rubydoc.info%2Fgems%2Fadhearsion%2FAdhearsion%2FCallController%2FDial\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG-OUQSsq0xu8qaybfg4YgbS7KMzQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.rubydoc.info%2Fgems%2Fadhearsion%2FAdhearsion%2FCallController%2FDial\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG-OUQSsq0xu8qaybfg4YgbS7KMzQ&#39;;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=&#39;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&#39;;return true;" onclick="this.href=&#39;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&#39;;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=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flogger.info%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFdDAv9pN9xxAuZivrUOpFt6Ilx5Q&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flogger.info%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFdDAv9pN9xxAuZivrUOpFt6Ilx5Q&#39;;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=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;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=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmojolingo.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;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=&#39;http://gmail.com/&#39;;return true;" onclick="this.href=&#39;http://gmail.com/&#39;;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=&#39;http://googlegroups.com/&#39;;return true;" onclick="this.href=&#39;http://googlegroups.com/&#39;;return true;">googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;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=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;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=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;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.