Asterisk AMI – PHP Or Node.js?

Home » Asterisk Users » Asterisk AMI – PHP Or Node.js?
Asterisk Users 3 Comments

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.


3 thoughts on - Asterisk AMI – PHP Or Node.js?

  • Hi,

    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:

  • Thanks Daniel, that was useful, I will check those links 🙂

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