[asterisk-users] Best way to connect to a MySQL Database

Leif Madsen leif.madsen at asteriskdocs.org
Mon Nov 15 18:38:17 CST 2010


On 10-11-15 06:04 PM, Matt Darnell wrote:
> 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?

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:

http://astbook.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-CHP-12.html

And here:

http://ofps.oreilly.com/titles/9780596517342/ch15.html

(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.)

Leif.



More information about the asterisk-users mailing list