Is this command the best way to access a MySQL database –
MYSQL(Connect connid dhhost dbuser dbpass dbname) ?
I thought I heard that using ODBC was a bit more stable.
Anyone have any experience?
I prefer to access MySQL using an AGI to access the database and set
I think database access in the dialplan is ‘ugly.’
I confess I’ve never done it, but if you search back through the list
archives, you’ve find examples that must have taken forever to figure out
all the quoting cruft.
I like wrapping up the database cruft in a nice and tidy little box. It
makes for a much more readable and maintainable dialplan.
Also, you won’t have your database credentials on display and you’ll have
full access to the database features and error return codes.
I write my AGIs in C so the impact is insignificant.
Use func_odbc along with res_odbc. I’ve taken dialplans for customers who were
having issues with MYSQL() and had about 9 lines of dialplan compressed down to
1 line of dialplan for the call, with much greater stability.
Some information about that here:
(The second link is to the 3rd edition of the Asterisk book, currently being
written, so this is a preview of the text in rough draft form.)
On Mon, Nov 15, 2010 at 6:38 PM, Leif Madsen
In the past I’ve just used the MySQL commands (back before I trusted
the ODBC access). Now I use func_odbc
As I know there are sevearl ways to access MySQL database. The easiest way
is to use Agi server but you can also use Asterisk addons or some other
Because I’m Visual Dialplan user I prefer Agi option and I use Integration
Server (Agi server) for database access.
It is easy, one block (one line of code) and you can execute SQL query.
Here is some information you may find useful: