example for capturing AMI events from a controller

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

example for capturing AMI events from a controller

KC
hello, looking for some guidance on this subject.  

Apologize in advance if there are etiquette that i'm not following. 

Background: 
I`m working on outbound dialer using Adh and Asterisk 13.

-I made an outbound call via Adhearsion::OutboundCall.new

-Upon connecting to a caller, I`m executing AMD to find out if i`m talking to a human or machine before administering a series of questions.

So i would like to capture all the possible outcome of the OutboundCall and AMD. 

For the OutboundCall, I am able to do capture events by
     theCall.on_end do |end_event|
          xxxxxx
     end

For the AMI events, based on 
The http://adhearsion.com/docs/events#per-call-events page, I have been able to capture them by adding adhearsion.rb blocks such as
     ami name: 'OriginateResponse' do |event|
          xxxxxx
     end

My question is: would I be able to capture these AMI events at the controller level?

thank you for any help.

KC

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

Re: example for capturing AMI events from a controller

KC
hi, it looks like I was just having problems with how the Punchblock Events are related to the AMI Events.

I was able to do what I want by specifying something like this in the Outbound controller,

      before_call do
           call.register_event_handler do |event|
                 if event.is_a? Punchblock::Event::Asterisk::AMI::Event
                         do_something_here
                 end
           end
      end

thanks



On Friday, October 16, 2015 at 11:45:50 AM UTC-4, KC wrote:
hello, looking for some guidance on this subject.  

Apologize in advance if there are etiquette that i'm not following. 

Background: 
I`m working on outbound dialer using Adh and Asterisk 13.

-I made an outbound call via Adhearsion::OutboundCall.new

-Upon connecting to a caller, I`m executing AMD to find out if i`m talking to a human or machine before administering a series of questions.

So i would like to capture all the possible outcome of the OutboundCall and AMD. 

For the OutboundCall, I am able to do capture events by
     theCall.on_end do |end_event|
          xxxxxx
     end

For the AMI events, based on 
The <a href="http://adhearsion.com/docs/events#per-call-events" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fadhearsion.com%2Fdocs%2Fevents%23per-call-events\46sa\75D\46sntz\0751\46usg\75AFQjCNFIjbqrpkrvfopZiuWl0jn0mR62EA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fadhearsion.com%2Fdocs%2Fevents%23per-call-events\46sa\75D\46sntz\0751\46usg\75AFQjCNFIjbqrpkrvfopZiuWl0jn0mR62EA&#39;;return true;">http://adhearsion.com/docs/events#per-call-events page, I have been able to capture them by adding adhearsion.rb blocks such as
     ami name: 'OriginateResponse' do |event|
          xxxxxx
     end

My question is: would I be able to capture these AMI events at the controller level?

thank you for any help.

KC

--
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: example for capturing AMI events from a controller

Ben Klang-2

On Oct 19, 2015, at 1:03 PM, KC <[hidden email]> wrote:

hi, it looks like I was just having problems with how the Punchblock Events are related to the AMI Events.

I was able to do what I want by specifying something like this in the Outbound controller,

      before_call do
           call.register_event_handler do |event|
                 if event.is_a? Punchblock::Event::Asterisk::AMI::Event
                         do_something_here
                 end
           end
      end


Sorry that we didn’t get back to you more quickly, but glad that you found a solution. Does that get you everything you need?

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

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


thanks



On Friday, October 16, 2015 at 11:45:50 AM UTC-4, KC wrote:
hello, looking for some guidance on this subject.  

Apologize in advance if there are etiquette that i'm not following. 

Background: 
I`m working on outbound dialer using Adh and Asterisk 13.

-I made an outbound call via Adhearsion::OutboundCall.new

-Upon connecting to a caller, I`m executing AMD to find out if i`m talking to a human or machine before administering a series of questions.

So i would like to capture all the possible outcome of the OutboundCall and AMD. 

For the OutboundCall, I am able to do capture events by
     theCall.on_end do |end_event|
          xxxxxx
     end

For the AMI events, based on 
The <a href="http://adhearsion.com/docs/events#per-call-events" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fadhearsion.com%2Fdocs%2Fevents%23per-call-events\46sa\75D\46sntz\0751\46usg\75AFQjCNFIjbqrpkrvfopZiuWl0jn0mR62EA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fadhearsion.com%2Fdocs%2Fevents%23per-call-events\46sa\75D\46sntz\0751\46usg\75AFQjCNFIjbqrpkrvfopZiuWl0jn0mR62EA';return true;" class="">http://adhearsion.com/docs/events#per-call-events page, I have been able to capture them by adding adhearsion.rb blocks such as
     ami name: 'OriginateResponse' do |event|
          xxxxxx
     end

My question is: would I be able to capture these AMI events at the controller level?

thank you for any help.

KC


--
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.

signature.asc (858 bytes) Download Attachment
KC
Reply | Threaded
Open this post in threaded view
|

Re: example for capturing AMI events from a controller

KC
no worries. yup. so far so good. thanks Ben.  


On Monday, October 19, 2015 at 1:23:12 PM UTC-4, Ben Klang wrote:

On Oct 19, 2015, at 1:03 PM, KC <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="UiYClOJUAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kaiyu...@...> wrote:

hi, it looks like I was just having problems with how the Punchblock Events are related to the AMI Events.

I was able to do what I want by specifying something like this in the Outbound controller,

      before_call do
           call.register_event_handler do |event|
                 if <a href="http://event.is" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fevent.is\46sa\75D\46sntz\0751\46usg\75AFQjCNGxhOyivPfFwsaJuiZvEFxbbRJ2aA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fevent.is\46sa\75D\46sntz\0751\46usg\75AFQjCNGxhOyivPfFwsaJuiZvEFxbbRJ2aA&#39;;return true;">event.is_a? Punchblock::Event::Asterisk::AMI::Event
                         do_something_here
                 end
           end
      end


Sorry that we didn’t get back to you more quickly, but glad that you found a solution. Does that get you everything you need?

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="UiYClOJUAQAJ" 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\75http%3A%2F%2Fmojolingo.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fmojolingo.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEdz1VI9Wu7PPmqtzifmF6XsODIog&#39;;return true;">http://mojolingo.com
Twitter: @MojoLingo


thanks



On Friday, October 16, 2015 at 11:45:50 AM UTC-4, KC wrote:
hello, looking for some guidance on this subject.  

Apologize in advance if there are etiquette that i'm not following. 

Background: 
I`m working on outbound dialer using Adh and Asterisk 13.

-I made an outbound call via Adhearsion::OutboundCall.new

-Upon connecting to a caller, I`m executing AMD to find out if i`m talking to a human or machine before administering a series of questions.

So i would like to capture all the possible outcome of the OutboundCall and AMD. 

For the OutboundCall, I am able to do capture events by
     theCall.on_end do |end_event|
          xxxxxx
     end

For the AMI events, based on 
The <a href="http://adhearsion.com/docs/events#per-call-events" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fadhearsion.com%2Fdocs%2Fevents%23per-call-events\46sa\75D\46sntz\0751\46usg\75AFQjCNFIjbqrpkrvfopZiuWl0jn0mR62EA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fadhearsion.com%2Fdocs%2Fevents%23per-call-events\46sa\75D\46sntz\0751\46usg\75AFQjCNFIjbqrpkrvfopZiuWl0jn0mR62EA&#39;;return true;">http://adhearsion.com/docs/events#per-call-events page, I have been able to capture them by adding adhearsion.rb blocks such as
     ami name: 'OriginateResponse' do |event|
          xxxxxx
     end

My question is: would I be able to capture these AMI events at the controller level?

thank you for any help.

KC


--
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="UiYClOJUAQAJ" 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.