Re: New extension for VoIP Asterisk Manager ( Request for comments )

From: Date: Tue, 02 Jan 2007 04:38:46 +0000
Subject: Re: New extension for VoIP Asterisk Manager ( Request for comments )
References: 1 2 3  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-4427@lists.php.net to get a copy of this message
On 1/1/07, Wez Furlong <kingwez@gmail.com> wrote: Is there any reason why you chose to implement this in C and not as a PHP class using the PHP's network functions?
With C is lot more fun :) Seriously, I already have an event oriented framework using PHP classes with standard network functions, but I havent made benchmarks to see differences in performance, my plan is do so. For the company I used to work, I created a whole architecture in PHP based on manager events, and am not sure how well is going to perform in stress conditions. So basically 2 reasons lead me to write this. 1. I wanted to learn C and was looking for a small project to start. 2. I think in the future, under high loads of calls, the extension will make a difference in the VoIP servers. On 1/1/07, Pedram Nimreezi <zenstyle@gmail.com> wrote:
thank you I was wondering the same thing...I saw an abandoned extension project..on, i think voipinfo... is it anything like that? does it provide anything more then the phpagi classes? thx
Not sure wich extension you have seen. AFAIK, phpagi classes are not the same. I have some php custom AGI classes, but AGI is different, AGI communicates using STDIN and STDOUT. The manager interface use TCP sockets. I know FastAGI also uses TCP sockets, but the difference between AGI and AMI is that AGI create a whole new process per channel. The manager interface can control ALL the channels at once, it runs in its own thread and not requires the extra overhead of spawning a new process for each Asterisk call/channel. I started an open source project here: http://opencallmanager.ivsol.net/ There you can see a little about the advantages of using an event oriented approach ( With Asterisk manager Interface) and not a procedural approach, like in AGI. The project is somehow stuck because I quit my old Job and am not working in VoIP stuff full time anymore, but I hope this new year will come again to live. But now it works tough. I hope you remember what you seen in voip-info, I would like to see if someone already started something similar. Kind Regards
Hi Moises, --Wez. On 12/31/06, Moises Silva <moises.silva@gmail.com> wrote:
Hi. I have written a small extension for PHP to be able to connect with Asterisk Manager Interface. More information about Asterisk and its manager interface can be found here: http://www.digium.com/ http://www.asterisk.org/ http://www.voip-info.org/wiki/view/Asterisk+manager+API This allow any PHP script easily send actions ( Like originate VoIP calls and hangup current calls in the PBX ) and receive events ( like new call, ringing call, peer register etc ) and act upon them using callbacks. Im using standar Linux TCP sockets, I guess work need still be done to compile in other plataforms, but asterisk is mainly used on linux, so I think is a good start. The latest code can be found at: svn://moy.ivsol.net/php-ami/trunk A few documentation and example script is included. I welcome ALL the feedback, good or bad. A sample session would look like this: $resource = ami_connect('asterisk.domain.com:5038', 'user', 'password'); ami_send_action($resource, 'Ping'); $response = ami_read($resource); var_dump($response) /* usually the Pong response should be received here
*/;
The user can register callbacks to wait for events and responses to actions. And start waiting calling ami_loop() function. The function never returns unless some callback return a value equal to AMI_EXIT_LOOP constant. I also wanted to know what are the steps to include this in pecl
repository.
Kind Regards. -- "Su nombre es GNU/Linux, no solamente Linux, mas info en
http://www.gnu.org"
-- PECL development discussion Mailing List ( http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PECL development discussion Mailing List ( http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- ~ Pedram Nimreezi -- Not by age, but by knowledge is wisdom acquired. There is not enough time to do all the nothing we want to do.
-- "Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"

« previous php.pecl.dev (#4427) next »