Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Asterisk AMI - PHP or Node.js?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
shahidh at gmail.com
Guest





PostPosted: Sat Dec 28, 2013 6:32 am    Post subject: [asterisk-users] Asterisk AMI - PHP or Node.js? Reply with quote

I would like to develop a Call Center Dialer (outbound and inbound calls) and it would use AMI method to communicate with Asterisk Server.

A daemon would need to run in the background, would you recommend coding in PHP or Node.js? which would be much faster and stable.


Thanks
Back to top
dan.jenkins88 at gmail...
Guest





PostPosted: Sat Dec 28, 2013 6:42 am    Post subject: [asterisk-users] Asterisk AMI - PHP or Node.js? Reply with quote

On Sat, Dec 28, 2013 at 11:32 AM, Shahid H <shahidh@gmail.com (shahidh@gmail.com)> wrote:


Hi,
 
Quote:
I would like to develop a Call Center Dialer (outbound and inbound calls) and it would use AMI method to communicate with Asterisk Server.

A daemon would need to run in the background, would you recommend coding in PHP or Node.js? which would be much faster and stable.





I've done something very similar, and I've done it with Node.js - it's a great fit for it; whereas you're kinda forcing PHP to do something it wasn't 100% designed for; in my experience Node is a much better fit for it.


I've spoken at Astricon about doing it and it's fairly easy with modules that already exist in the Node.js ecosystem.


The talk I did in 2012 is probably the most relevant: http://www.youtube.com/watch?v=FCwzbgR_adQ


The slides can be found here: http://www.slideshare.net/danjenkins/asterisk-html5-and-nodejs-a-world-of-endless-possibilities-14881614


And my module for talking to asterisk via the AMI is available on npm https://npmjs.org/package/asterisk-ami


On the question of stability/speed, I don't know to be honest but I would guess that Node would be faster due to it's async nature; but whether you would really see much of that speed gain due to async is entirely dependant on your application and how it runs, what it talks to, are any of these things potentially blocking.


Node.js is nearing V1 but to be honest, it's the most stable it's ever been, with HUGE companies using it in production environments. The system that I wrote is still running on Node v 0.6 and has been up and running with near 0 downtime for over a year, and the reasons for downtime are external, such as server moves, DNS changes etc.
 

Quote:


Thanks






--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Let me know if you want to know any more.


Dan 
Back to top
shahidh at gmail.com
Guest





PostPosted: Sat Dec 28, 2013 7:05 am    Post subject: [asterisk-users] Asterisk AMI - PHP or Node.js? Reply with quote

Thanks Daniel, that was useful, I will check those links Smile

I am pretty good with PHP and jQuery. So I guess learning Node.js shouldn't be too difficult.


If I decided to use Node.js - what is the best way to communicate with a browser to AMI process? Send a XML or HTTP command from a browser to AMI process .. or whatever I execute on the browser - it save the commands to the database.. a process will listen the commands from a database.


Other options are http requests and do the ipc... or maybe WebSocket?



On Sat, Dec 28, 2013 at 11:41 AM, Daniel Jenkins <dan.jenkins88@gmail.com (dan.jenkins88@gmail.com)> wrote:
Quote:

On Sat, Dec 28, 2013 at 11:32 AM, Shahid H <shahidh@gmail.com (shahidh@gmail.com)> wrote:


Hi,
 
Quote:
I would like to develop a Call Center Dialer (outbound and inbound calls) and it would use AMI method to communicate with Asterisk Server.

A daemon would need to run in the background, would you recommend coding in PHP or Node.js? which would be much faster and stable.






I've done something very similar, and I've done it with Node.js - it's a great fit for it; whereas you're kinda forcing PHP to do something it wasn't 100% designed for; in my experience Node is a much better fit for it.


I've spoken at Astricon about doing it and it's fairly easy with modules that already exist in the Node.js ecosystem.


The talk I did in 2012 is probably the most relevant: http://www.youtube.com/watch?v=FCwzbgR_adQ


The slides can be found here: http://www.slideshare.net/danjenkins/asterisk-html5-and-nodejs-a-world-of-endless-possibilities-14881614


And my module for talking to asterisk via the AMI is available on npm https://npmjs.org/package/asterisk-ami


On the question of stability/speed, I don't know to be honest but I would guess that Node would be faster due to it's async nature; but whether you would really see much of that speed gain due to async is entirely dependant on your application and how it runs, what it talks to, are any of these things potentially blocking.


Node.js is nearing V1 but to be honest, it's the most stable it's ever been, with HUGE companies using it in production environments. The system that I wrote is still running on Node v 0.6 and has been up and running with near 0 downtime for over a year, and the reasons for downtime are external, such as server moves, DNS changes etc.
 

Quote:


Thanks






--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Let me know if you want to know any more.


Dan 





--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
james at fivecats.org
Guest





PostPosted: Sat Dec 28, 2013 8:52 am    Post subject: [asterisk-users] Asterisk AMI - PHP or Node.js? Reply with quote

On 12/28/2013 7:04 AM, Shahid H wrote:
Quote:
Thanks Daniel, that was useful, I will check those links Smile

I am pretty good with PHP and jQuery. So I guess learning Node.js
shouldn't be too difficult.

If I decided to use Node.js - what is the best way to communicate with a
browser to AMI process? Send a XML or HTTP command from a browser to AMI
process .. or whatever I execute on the browser - it save the commands
to the database.. a process will listen the commands from a database.

Other options are http requests and do the ipc... or maybe WebSocket?

My code will probably end up on Thedailywtf.com for it, but I have a
PHP-based system that uses PAMI to talk to the AMI interface. There's a
daemon process that listens for commands via a FIFO buffer. Several
other processes & web scripts just send commands to the controller
process via that FIFO.

Seems to work well for me.


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services