[asterisk-users] Preferred language for Asterisk AGIs development ?

Steve Edwards asterisk.org at sedwards.com
Tue May 5 14:41:45 CDT 2009


Un-top-posting...

> On Tue, 2009-05-05 at 11:52 +0500, Kashif Naeem wrote:
>>
>> We are going to start development for a product based over Asterisk. 
>> According to you, which is the preferred language for AGIs / IVRs 
>> development in Asterisk. I got opinions that Perl is going to be 
>> replaced by PHP for all future developments.

On Tue, 5 May 2009, Kenneth Shaw wrote:

> If you're intent on staying on Asterisk, I would suggest skipping AGI, 
> and write a client that monitors the state of asterisk via the manager 
> interface.

AGI and AMI are 2 different solutions to 2 different classes of problems. 
It may even make sense to use AMI in an AGI. I've never had the need.

AGI is executed in the context of a call. AMI is completely "external" to 
a call.

Think of AGI as "dialplan on steroids" and AMI as SNMP.

> AGIs are messy in my opinion.

AGIs are very "clean" in my opinion.

AGIs solve a large body of problems. An AGI is executed when requested by 
your dialplan. It does something and then it exits. If the caller hangs 
up, your AGI is notified (via signal) and can do something about it. If 
your AGI crashes, it only affects that single call. If you have 2 
simultaneous calls, you have 2 separate AGI in separate processes and 
memory spaces.

AMI implies writing a daemon that must be running all the time. Almost by 
definition, it should be multi-threaded or event driven so it can handle 
multiple simultaneous calls. If the daemon crashes, it will probably 
adversely impact all calls.

AGI and AMI are only 2 "tools" at your disposal. In terms of "ease of 
implementation," I'd define the available set of tools and rank them in 
this order when considering how to solve a problem:

) Dialplan
) AGI
) AMI
) Asterisk applications

The list would be inverted if you consider complexity (skills needed to 
write) or risk (impact of a bug).

> There isn't really any "best" language for AGIs, as AGIs just 
> communicate with Asterisk via a pipe. So really, the best language for 
> AGIs are the language you like the best and/or best fits the application 
> domain/requirements for your project.

As Bill Clinton would say "it depends on how you define best."

What is appropriate for 10 calls per day may be different than 10,000 
calls per day.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-users mailing list