Asterisk MySQL

Hi all,

I am using MySQL query inside my extentions.conf. i have more than 200 agents using the same extentions and i can see in each request asterisk try to connect mysql.

My question is, Is there any way to make only one connection for all users who is using the same extentions.

Here is my example working extentions:

[mysqlt]
exten => _X.,1,MYSQL(Connect connid 192.168.1.65 username password database)
exten => _X.,2,MYSQL(Query r ${connid} INSERT\ INTO\ Userstabl\ set\ user=921)
exten => s,n,MYSQL(Disconnect ${connid})

Please advice me how i can make one connection for all users?

Thank You
Abdul

Every part of the dialplan is accessed threaded and per call.

Think of it like every CALL is making a cloned “child” of your dialplan (which is absolutely needed to make Asterisk working anyway).

You cant do what you want to do.

The only thing you CAN do is, handle the calls via AGI and use sessions there, triggering SQL (or not).

Hi,

Using AGI for calls is interesting. I would like to know which AGI can do good performance for Asterisk. Because in view the AGI also will be called with each calls, so if have more than 500 calls, the AGI should give good performace to Asterisk.

Ane how i can use sessions in AGI for to voice more DB connection?