Hi,

For those interested in using MySQL directly from extensions.conf, there's 
already a source file floating around for using a MYSQL application to 
do SELECT queries.

We're using the MYSQL app a lot in our exensions.conf, but we missed 
support for queries that don't return a result like UPDATE or INSERT. 
Here's an updated app_mysql.c which introduces the Execute command. 

Sample:
exten => s,300,MYSQL(Connect connid ${HOST} ${USER} ${PASSWORD} ${DATABSE})
exten => s,301,MYSQL(Execute resultid ${connid} UPDATE table SET haveSetting = 1 WHERE 
dnid=\'${CALLERIDNUM}\')
exten => s,302,MYSQL(Disconnect ${connid})

This somewhat mimics the way the Borland implements this type of queries 
in their products like Delphi.

It is a quick hack, but we've been using it for a couple of days now and 
have not seen any issues with it. (yet? ;-) )

Enjoy.

-- 
Andreas Sikkema                Rits tele.com
Scheepmakersstraat 11      3011 VH Rotterdam
t: +31 (0)10 2245544    f: +31 (0)10 2245540

Attachment: app_mysql.c
Description: app_mysql.c

_______________________________________________
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to