[asterisk-users] link to MySQL connection

James Sharp james at fivecats.org
Tue Dec 3 12:52:04 CST 2013

On 12/3/2013 10:11 AM, Don Kelly wrote:
>> In the php routines, I would like to use the persistent connection
>> that is established in the dialplan, rather than creating a new
>> connection each time they run. How can I do this?
> You can't, they are completely separate processes and code.
> Joshua Colp
> Thanks--that's not the answer I wanted, but it sure was quick. :) Is there
> anything that would enable me to use a persistent connection in the agi?
> --Don
> Yes.  Use func_odbc in your PHP AGI.   In Asterisk dialplan functions are
> treated like dialplan variables so you can get and set them just like you
> would other dialplan variables.
> If it takes 5 seconds to open a PDO DB connection inside PHP you have some
> OTHER problem.
> Eric Wieling
> Thanks, Eric. If I can't figure out why the connection takes so long, I'll
> try the func_ODBC approach.

look into DNS problems.  Something may be trying to do an reverse DNS 
lookup and taking too long to either give up or get an answer.

More information about the asterisk-users mailing list