use of Punchblock

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

use of Punchblock

David Maldonado
Hello, my name is Dave, I'm a newbie investigating the use of Punchblock as an interface to Asterisk in a rails api I'm building.

I'm playing around with it in a console and cannot get a connection to Asterisk established. Entering:

client = Punchblock.client_with_connection('asterisk', {  host: '127.0.0.1', port: 5038, username: 'api', password: 'api'  })
client
.run


and getting:

ArgumentError: wrong number of arguments (1 for 0)
 
/usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:111:in `dispatch_action'
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:103:in `
login'
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:53:in `post_init'

 
/usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:38:in `run'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `
public_send'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'

 
/usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `
block in invoke'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'

 
/usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `
block in initialize'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'

Punchblock::DisconnectedError:  
from /usr/local/lib/ruby/gems/2.1.0/gems/punchblock-2.4.0/lib/punchblock/connection/asterisk.rb:20:in `run'


I have the 'api' user defined in manager.conf, am I using this library correctly? I'm ultimately trying to send ami commands to post/delete from the asterisk database.

Thanks! -dave

--
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: use of Punchblock

Ben Klang-2
Hi David,


Il giorno Oct 22, 2014, alle ore 1:16 PM, David Maldonado <[hidden email]> ha scritto:

Hello, my name is Dave, I'm a newbie investigating the use of Punchblock as an interface to Asterisk in a rails api I'm building.


Welcome to the community.

First, let me give you a quick layout of the various libraries we, the Adhearsion project, maintain.  It may be of help:

RubyAMI: Library for speaking Asterisk Manager Interface, which is the transport for AsyncAGI

Punchblock: Abstraction layer that presents a unified API on top of Rayo (FreeSWITCH, others) and AsyncAGI (Asterisk)

Adhearsion: Framework for creating voice applications, uses Punchblock to guarantee compatibility across FreeSWITCH and Asterisk

My guess is that Punchblock is the wrong layer and that you really want RubyAMI.  Or, if you have something more sophisticated that needs to preserve state, you really want Adhearsion.  If you use Adhearsion you can then present an HTTP API using Virginia Reel: https://github.com/polysics/virginia/, which is Adhearsion’s plugin for serving HTTP.

I hope that helps.  If you still want to move forward with Punchblock, let me know and I’ll attempt to help you with your original issue.

/BAK/


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

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

I'm playing around with it in a console and cannot get a connection to Asterisk established. Entering:

client = Punchblock.client_with_connection('asterisk', {  host: '127.0.0.1', port: 5038, username: 'api', password: 'api'  })
client.run


and getting:

ArgumentError: wrong number of arguments (1 for 0)
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:111:in `dispatch_action'
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:103:in `
login'
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:53:in `post_init'

 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:38:in `run'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `
public_send'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'

 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `
block in invoke'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'

 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `
block in initialize'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'

Punchblock::DisconnectedError:  
from /usr/local/lib/ruby/gems/2.1.0/gems/punchblock-2.4.0/lib/punchblock/connection/asterisk.rb:20:in `run'


I have the 'api' user defined in manager.conf, am I using this library correctly? I'm ultimately trying to send ami commands to post/delete from the asterisk database.

Thanks! -dave


--
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: use of Punchblock

Ben Langfeld-2
In reply to this post by David Maldonado
Try locking to Celluloid 0.15.x, and let us know if that helps. You should also try using the latest Punchblock, which is 2.5.3, rather than 2.4.0 which is from 7 months ago.

On 22 October 2014 15:16, David Maldonado <[hidden email]> wrote:
Hello, my name is Dave, I'm a newbie investigating the use of Punchblock as an interface to Asterisk in a rails api I'm building.

I'm playing around with it in a console and cannot get a connection to Asterisk established. Entering:

client = Punchblock.client_with_connection('asterisk', {  host: '127.0.0.1', port: 5038, username: 'api', password: 'api'  })
client
.run


and getting:

ArgumentError: wrong number of arguments (1 for 0)
 
/usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:111:in `dispatch_action'
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:103:in `
login'
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:53:in `post_init'

 
/usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:38:in `run'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `
public_send'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'

 
/usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `
block in invoke'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'

 
/usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `
block in initialize'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'

Punchblock::DisconnectedError:  
from /usr/local/lib/ruby/gems/2.1.0/gems/punchblock-2.4.0/lib/punchblock/connection/asterisk.rb:20:in `run'


I have the 'api' user defined in manager.conf, am I using this library correctly? I'm ultimately trying to send ami commands to post/delete from the asterisk database.

Thanks! -dave

--
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: use of Punchblock

David Maldonado
In reply to this post by Ben Klang-2
Wow, sorry for the late reply I deleted my original post so I thought no one saw it. I did figure out that RubyAMI was what I needed to be using and I have a simple api for adding extensions, inbound routes and follow mes completed. Now I want to get my company to ditch FreePBX entirely and let me write an Adhearsion app!

I love this project and hope to do some cool stuff with it.

On Monday, October 27, 2014 10:12:32 AM UTC-4, Ben Klang wrote:
Hi David,


Il giorno Oct 22, 2014, alle ore 1:16 PM, David Maldonado <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="rC2rO7WKK6QJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">david.m....@...> ha scritto:

Hello, my name is Dave, I'm a newbie investigating the use of Punchblock as an interface to Asterisk in a rails api I'm building.


Welcome to the community.

First, let me give you a quick layout of the various libraries we, the Adhearsion project, maintain.  It may be of help:

RubyAMI: Library for speaking Asterisk Manager Interface, which is the transport for AsyncAGI

Punchblock: Abstraction layer that presents a unified API on top of Rayo (FreeSWITCH, others) and AsyncAGI (Asterisk)

Adhearsion: Framework for creating voice applications, uses Punchblock to guarantee compatibility across FreeSWITCH and Asterisk

My guess is that Punchblock is the wrong layer and that you really want RubyAMI.  Or, if you have something more sophisticated that needs to preserve state, you really want Adhearsion.  If you use Adhearsion you can then present an HTTP API using Virginia Reel: <a href="https://github.com/polysics/virginia/" target="_blank" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fpolysics%2Fvirginia%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNF56g0kRs8mYsh8Ynu7ZlC0DVdmyw';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fpolysics%2Fvirginia%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNF56g0kRs8mYsh8Ynu7ZlC0DVdmyw';return true;">https://github.com/polysics/virginia/, which is Adhearsion’s plugin for serving HTTP.

I hope that helps.  If you still want to move forward with Punchblock, let me know and I’ll attempt to help you with your original issue.

/BAK/


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

I'm playing around with it in a console and cannot get a connection to Asterisk established. Entering:

client = Punchblock.client_with_connection('asterisk', {  host: '127.0.0.1', port: 5038, username: 'api', password: 'api'  })
client.run


and getting:

ArgumentError: wrong number of arguments (1 for 0)
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:111:in `dispatch_action'
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:103:in `
login'
 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:53:in `post_init'

 /usr/local/lib/ruby/gems/2.1.0/gems/ruby_ami-2.2.1/lib/ruby_ami/stream.rb:38:in `run'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `
public_send'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'

 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `
block in invoke'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'

 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `
block in initialize'
 /usr/local/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'

Punchblock::DisconnectedError:  
from /usr/local/lib/ruby/gems/2.1.0/gems/punchblock-2.4.0/lib/punchblock/connection/asterisk.rb:20:in `run'


I have the 'api' user defined in manager.conf, am I using this library correctly? I'm ultimately trying to send ami commands to post/delete from the asterisk database.

Thanks! -dave


--
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="rC2rO7WKK6QJ" 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" 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 [hidden email].
For more options, visit https://groups.google.com/d/optout.