Asterisk PHP API
The page for the Asterisk PHP API…
There have been other PHP libraries built for this in the past but they are either poorly documented or too ‘low level’ forcing you to understand the manager API before you can use it.
I decided to build my own to fill the gap I saw and plan on implementing every function of the Asterisk manager interface as a distinct method in the class. So far I’ve succeeded in producing the following:
- Command: Execute Command
- IAXpeers: List IAX Peers
- ListCommands: List available manager commands
- Logoff: Logoff Manager
- Monitor: Monitor/Record a channel
- Originate: Originate Call
- Ping: Pong
- QueueAdd: Add member to queue
- QueueRemove: Remove member from queue
- Queues: Queue list and status
- SIPpeers: List SIP Peers
Get The API
Page: Google Project Page
SVN: svn checkout http://asterisk-php-api.googlecode.com/svn/trunk/ asterisk-php-api-read-only
PEAR
The API is now in the PEAR repository. I think Asterisk finally deserves a solid API in PHP and this process will involve the following (non-exhaustive list):
- End user documentation.
- Use of PEAR_Exception library.
- Take on boardpear-dev group comments.
- Code cleanup.
- Robust testing.
Please feel free to discuss this in the comments, email me, comment at Google Code project site or post in the pear-dev mailing list.
Reference
8 Comments to “Asterisk PHP API”
Leave a Reply

[...] Visit the blog page for more info on the new PHP interface. [...]
Very nice. please keep up the good work. I will start contributing when I feel comfortable enough.
I’ve corrected the bug you posted at the libs Google Projects site. Thanks for bringing it to my attention. Its much appreciated.
[...] was again compounded when I had to implement a patch in my Asterisk PHP API which is Subversion hosted. As the current version was out of date the patch failed so needed to [...]
I’d like to know how can i create an client application that can connect asterisk with vtiger and the programming can be with php
Hi,
how can i out your code to work?
Do i have to put it on the Asterisk machine? Configuring apache?
Thanks
Hi, I am using your API and loving it so far. How would I set it up to save the startMonitor file to an external server? Also is it normal for my channel SIP/5100 to keep changing to things like SIP/5100-2783f34 etc? How would I know what channel to startMonitor on if it keeps changing?
Thanks
Hi,
I’ve looked in PEAR and the AsteriskManager has no releases yet. Could you please check what happens that it is no longer available in PEAR?
Many thanks for the API!
Wessel