hangup from Simon

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

hangup from Simon

David L-2

Hello,
Playing around with the new version 0.8.1. I am testing with simon
game, and wants to capture the hangup events. Hanging up in the middle
of the game results in the error below
---
ERROR agi: #<Errno::EPIPE: Broken pipe>
ERROR agi:      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/
adhearsion/voip/asterisk/commands.rb:46:in `write'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/commands.rb:46:in `print'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/commands.rb:46:in `write'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/commands.rb:63:in `raw_response'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/commands.rb:97:in `execute'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/commands.rb:846:in `play_string'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/commands.rb:129:in `play'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/commands.rb:128:in `each'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/commands.rb:128:in `play'
     /opt/ahnsrv/test/components/simon_game/simon_game.rb:44:in
`verify_attempt'
     /opt/ahnsrv/test/components/simon_game/simon_game.rb:19:in
`start'
     /opt/ahnsrv/test/components/simon_game/simon_game.rb:16:in `loop'
     /opt/ahnsrv/test/components/simon_game/simon_game.rb:16:in
`start'
     /opt/ahnsrv/test/components/simon_game/simon_game.rb:3:in
`simon_game'
     /opt/ahnsrv/test/dialplan.rb:2:in `load'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/dial_plan.rb:50:in `instance_eval'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/dial_plan.rb:50:in `run'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/dial_plan.rb:105:in `handle'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/dial_plan.rb:81:in `handle'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/agi_server.rb:23:in `serve'
     /usr/local/lib/ruby/1.8/gserver.rb:211:in `start'
     /usr/local/lib/ruby/1.8/gserver.rb:208:in `initialize'
     /usr/local/lib/ruby/1.8/gserver.rb:208:in `new'
     /usr/local/lib/ruby/1.8/gserver.rb:208:in `start'
     /usr/local/lib/ruby/1.8/gserver.rb:198:in `initialize'
     /usr/local/lib/ruby/1.8/gserver.rb:198:in `new'
     /usr/local/lib/ruby/1.8/gserver.rb:198:in `start'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
voip/asterisk/agi_server.rb:66:in `start'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
initializer/asterisk.rb:56:in `join_server_thread_after_initialized'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
66:in `call'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
66:in `trigger_immediately'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
63:in `map'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
63:in `trigger_immediately'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
events_support.rb:47:in `trigger_immediately'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
initializer.rb:349:in `trigger_after_initialized_hooks'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
initializer.rb:143:in `start'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
initializer.rb:92:in `start'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
cli.rb:129:in `start'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
cli.rb:19:in `send'
     /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
cli.rb:19:in `execute!'
     /usr/local/bin/ahn:28
---------------------------
Is there a way to capture the hangup event from the user in the middle
of the call without getting the above errors?
here is the content of my events.rb

events.asterisk.hungup_call.each do |call|
 # This simply logs the extension for all calls going through this
Adhearsion app.
   extension = call.variables[:extension]
  ahn_log "Got a new call hangup with extension #{extension}"
 end


Thanks
David L
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/adhearsion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: hangup from Simon

mrcarrera

David, did you try to catch the raised exception with a begin/rescue/
ensure/end block?

On 25 feb, 00:13, David L <[hidden email]> wrote:

> Hello,
> Playing around with the new version 0.8.1. I am testing with simon
> game, and wants to capture the hangup events. Hanging up in the middle
> of the game results in the error below
> ---
> ERROR agi: #<Errno::EPIPE: Broken pipe>
> ERROR agi:      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/
> adhearsion/voip/asterisk/commands.rb:46:in `write'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/commands.rb:46:in `print'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/commands.rb:46:in `write'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/commands.rb:63:in `raw_response'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/commands.rb:97:in `execute'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/commands.rb:846:in `play_string'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/commands.rb:129:in `play'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/commands.rb:128:in `each'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/commands.rb:128:in `play'
>      /opt/ahnsrv/test/components/simon_game/simon_game.rb:44:in
> `verify_attempt'
>      /opt/ahnsrv/test/components/simon_game/simon_game.rb:19:in
> `start'
>      /opt/ahnsrv/test/components/simon_game/simon_game.rb:16:in `loop'
>      /opt/ahnsrv/test/components/simon_game/simon_game.rb:16:in
> `start'
>      /opt/ahnsrv/test/components/simon_game/simon_game.rb:3:in
> `simon_game'
>      /opt/ahnsrv/test/dialplan.rb:2:in `load'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/dial_plan.rb:50:in `instance_eval'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/dial_plan.rb:50:in `run'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/dial_plan.rb:105:in `handle'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/dial_plan.rb:81:in `handle'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/agi_server.rb:23:in `serve'
>      /usr/local/lib/ruby/1.8/gserver.rb:211:in `start'
>      /usr/local/lib/ruby/1.8/gserver.rb:208:in `initialize'
>      /usr/local/lib/ruby/1.8/gserver.rb:208:in `new'
>      /usr/local/lib/ruby/1.8/gserver.rb:208:in `start'
>      /usr/local/lib/ruby/1.8/gserver.rb:198:in `initialize'
>      /usr/local/lib/ruby/1.8/gserver.rb:198:in `new'
>      /usr/local/lib/ruby/1.8/gserver.rb:198:in `start'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> voip/asterisk/agi_server.rb:66:in `start'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> initializer/asterisk.rb:56:in `join_server_thread_after_initialized'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
> 66:in `call'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
> 66:in `trigger_immediately'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
> 63:in `map'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
> 63:in `trigger_immediately'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> events_support.rb:47:in `trigger_immediately'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> initializer.rb:349:in `trigger_after_initialized_hooks'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> initializer.rb:143:in `start'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> initializer.rb:92:in `start'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> cli.rb:129:in `start'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> cli.rb:19:in `send'
>      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> cli.rb:19:in `execute!'
>      /usr/local/bin/ahn:28
> ---------------------------
> Is there a way to capture the hangup event from the user in the middle
> of the call without getting the above errors?
> here is the content of my events.rb
>
> events.asterisk.hungup_call.each do |call|
>  # This simply logs the extension for all calls going through this
> Adhearsion app.
>    extension = call.variables[:extension]
>   ahn_log "Got a new call hangup with extension #{extension}"
>  end
>
> Thanks
> David L
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/adhearsion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: hangup from Simon

David Lawal
Thanks, thats a great point. However is there a way to capture a hangup or canceled call from the user in the middle of a call in adhearsion?
cheers
David L

> Date: Wed, 25 Feb 2009 07:36:38 -0800
> Subject: [Adhearsion] Re: hangup from Simon
> From: [hidden email]
> To: [hidden email]
>
>
> David, did you try to catch the raised exception with a begin/rescue/
> ensure/end block?
>
> On 25 feb, 00:13, David L <[hidden email]> wrote:
> > Hello,
> > Playing around with the new version 0.8.1. I am testing with simon
> > game, and wants to capture the hangup events. Hanging up in the middle
> > of the game results in the error below
> > ---
> > ERROR agi: #<Errno::EPIPE: Broken pipe>
> > ERROR agi:      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/
> > adhearsion/voip/asterisk/commands.rb:46:in `write'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/commands.rb:46:in `print'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/commands.rb:46:in `write'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/commands.rb:63:in `raw_response'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/commands.rb:97:in `execute'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/commands.rb:846:in `play_string'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/commands.rb:129:in `play'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/commands.rb:128:in `each'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/commands.rb:128:in `play'
> >      /opt/ahnsrv/test/components/simon_game/simon_game.rb:44:in
> > `verify_attempt'
> >      /opt/ahnsrv/test/components/simon_game/simon_game.rb:19:in
> > `start'
> >      /opt/ahnsrv/test/components/simon_game/simon_game.rb:16:in `loop'
> >      /opt/ahnsrv/test/components/simon_game/simon_game.rb:16:in
> > `start'
> >      /opt/ahnsrv/test/components/simon_game/simon_game.rb:3:in
> > `simon_game'
> >      /opt/ahnsrv/test/dialplan.rb:2:in `load'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/dial_plan.rb:50:in `instance_eval'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/dial_plan.rb:50:in `run'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/dial_plan.rb:105:in `handle'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/dial_plan.rb:81:in `handle'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/agi_server.rb:23:in `serve'
> >      /usr/local/lib/ruby/1.8/gserver.rb:211:in `start'
> >      /usr/local/lib/ruby/1.8/gserver.rb:208:in `initialize'
> >      /usr/local/lib/ruby/1.8/gserver.rb:208:in `new'
> >      /usr/local/lib/ruby/1.8/gserver.rb:208:in `start'
> >      /usr/local/lib/ruby/1.8/gserver.rb:198:in `initialize'
> >      /usr/local/lib/ruby/1.8/gserver.rb:198:in `new'
> >      /usr/local/lib/ruby/1.8/gserver.rb:198:in `start'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > voip/asterisk/agi_server.rb:66:in `start'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > initializer/asterisk.rb:56:in `join_server_thread_after_initialized'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
> > 66:in `call'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
> > 66:in `trigger_immediately'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
> > 63:in `map'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/theatre.rb:
> > 63:in `trigger_immediately'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > events_support.rb:47:in `trigger_immediately'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > initializer.rb:349:in `trigger_after_initialized_hooks'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > initializer.rb:143:in `start'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > initializer.rb:92:in `start'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > cli.rb:129:in `start'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > cli.rb:19:in `send'
> >      /home/cbadmin/.gem/ruby/1.8/gems/adhearsion-0.8.1/lib/adhearsion/
> > cli.rb:19:in `execute!'
> >      /usr/local/bin/ahn:28
> > ---------------------------
> > Is there a way to capture the hangup event from the user in the middle
> > of the call without getting the above errors?
> > here is the content of my events.rb
> >
> > events.asterisk.hungup_call.each do |call|
> >  # This simply logs the extension for all calls going through this
> > Adhearsion app.
> >    extension = call.variables[:extension]
> >   ahn_log "Got a new call hangup with extension #{extension}"
> >  end
> >
> > Thanks
> > David L
> --~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/adhearsion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: hangup from Simon

mrcarrera

I'm not completely sure but maybe you could try to use DeadAGI in your
asterisk dialplan, that way your application will still work once the
channel is dead (which happens after hangup); I guess you are not
receiving the hangup events because of that.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/adhearsion?hl=en
-~----------~----~----~----~------~----~------~--~---