[asterisk-users] PHP/AGI/SetVar Issue

Steve Edwards asterisk.org at sedwards.com
Thu Jun 4 18:05:04 CDT 2009


On Thu, 4 Jun 2009, Peder wrote:

> Is there a limitation to the number of variables you can set from a PHP 
> agi script?

Not that I've found yet :)

One of my AGIs sets almost 600 channel variables.

It (written in C) takes all of 1/100 of a second to lookup the variables 
from 2 tables in a MySQL database and set all of the variables.

[snip]

> Here is the part from the agi that sets the variables:
>
> echo ' EXEC SetVar ISLOCALCONTEXT="'.$row['context'].'"';
> echo ' EXEC SetVar ISLOCALDID="'.$row['did'].'"';

You are violating the AGI protocol. First, you have to read the AGI 
environment. Then, for every request, you must read the response.

You will save yourself a lot of time and hair if you use an established 
library.

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