Klaus Darilion
2008-Nov-13 14:16 UTC
[asterisk-users] database queries from extensions.conf
Hi! What is the preferred way to make database lookups from within the dialplan? I only know the MYSQL function from asterisk-addons. Are the other methods too? (e.g. for postgresql, unixodbc) thanks klaus
On Thu, 2008-11-13 at 15:16 +0100, Klaus Darilion wrote:> What is the preferred way to make database lookups from within the dialplan?The preferred method is to use func_odbc, which takes SQL queries and builds custom dialplan functions from them. I've used it quite a bit, and am very happy with it. I also presented on func_odbc at AstriCon, and you can download my presentation: http://www.astricon.net/2008/glendale/web/presentations/DatabaseDriven_JSmith.pdf -- Jared Smith Training Manager Digium, Inc.
Wolfgang Pichler
2008-Nov-13 16:11 UTC
[asterisk-users] database queries from extensions.conf
Hi, you yould also use DBQuery (does only support mysql) - take a look at http://www.voip-info.org/wiki/view/Asterisk+cmd+DBQuery (it does also contain a cdr backend to write customzied cdr entries to the database) regards, Wolfgang Klaus Darilion schrieb:> Hi! > > What is the preferred way to make database lookups from within the dialplan? > > I only know the MYSQL function from asterisk-addons. Are the other > methods too? (e.g. for postgresql, unixodbc) > > thanks > klaus > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Klaus Darilion
2008-Nov-13 18:15 UTC
[asterisk-users] database queries from extensions.conf
Wolfgang Pichler schrieb:> Hi, > > you yould also use DBQuery (does only support mysql) - take a look at > http://www.voip-info.org/wiki/view/Asterisk+cmd+DBQuery (it does also > contain a cdr backend to write customzied cdr entries to the database)hi wolfgang! Have you programmed this yourself? Do you know how it compares to MYSQL function and func_odbc? regards klaus> > regards, > Wolfgang > > Klaus Darilion schrieb: >> Hi! >> >> What is the preferred way to make database lookups from within the dialplan? >> >> I only know the MYSQL function from asterisk-addons. Are the other >> methods too? (e.g. for postgresql, unixodbc) >> >> thanks >> klaus >> >> _______________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users >> > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Wolfgang Pichler
2008-Nov-13 19:17 UTC
[asterisk-users] database queries from extensions.conf
Hi, yes - i did have done it myself. The main difference is that the dbquery application does use the res_mysqlpool - which is a small piece of code which does handle a pool of connections to one or more mysql servers. So you can make a fault tolerant system by using two master - master replicated mysql systems - and have mysqlpool configured to use both servers (and if one fails - it can use the other, and you can turn off one server by setting the conenction count to 0 for maintance). DBQuery does not let you execute direct mysql queries - you have to define them in the config before - but i like it that way... Also the cdr backend with a customized sql querie is handy. regards, Wolfgang Klaus Darilion schrieb:> Wolfgang Pichler schrieb: > >> Hi, >> >> you yould also use DBQuery (does only support mysql) - take a look at >> http://www.voip-info.org/wiki/view/Asterisk+cmd+DBQuery (it does also >> contain a cdr backend to write customzied cdr entries to the database) >> > > hi wolfgang! > > Have you programmed this yourself? > > Do you know how it compares to MYSQL function and func_odbc? > > regards > klaus > > > >> regards, >> Wolfgang >> >> Klaus Darilion schrieb: >> >>> Hi! >>> >>> What is the preferred way to make database lookups from within the dialplan? >>> >>> I only know the MYSQL function from asterisk-addons. Are the other >>> methods too? (e.g. for postgresql, unixodbc) >>> >>> thanks >>> klaus >>> >>> _______________________________________________ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> >>> asterisk-users mailing list >>> To UNSUBSCRIBE or update options visit: >>> http://lists.digium.com/mailman/listinfo/asterisk-users >>> >>> >> _______________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users >> > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Klaus Darilion wrote:> Wolfgang Pichler schrieb: > >> Hi, >> >> you yould also use DBQuery (does only support mysql) - take a look at >> http://www.voip-info.org/wiki/view/Asterisk+cmd+DBQuery (it does also >> contain a cdr backend to write customzied cdr entries to the database) >> > > hi wolfgang! > > Have you programmed this yourself? > > Do you know how it compares to MYSQL function and func_odbc? > > regards > klaus > > > >> regards, >> Wolfgang >> >> Klaus Darilion schrieb: >> >>> Hi! >>> >>> What is the preferred way to make database lookups from within the dialplan? >>> >>> I only know the MYSQL function from asterisk-addons. Are the other >>> methods too? (e.g. for postgresql, unixodbc) >>> >>> thanks >>> klaus >>> >>> _______________________________________________ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> >>> asterisk-users mailing list >>> To UNSUBSCRIBE or update options visit: >>> http://lists.digium.com/mailman/listinfo/asterisk-users >>> >>> >> _______________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users >> > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >func_odb only allows a SINGLE database statement Ergo you cannot do Transactions or Multi-statement SQL It is a MAJOR Backstep in DB Access. The MYSQL add-on is the BEST way to access DB from Dial Plan Digium should support and ADD to this rather than non putting a SINGLE mention of it in the last book and making no mention of it at Astricon. With this Add-on, and if DIGIUM would fix the brain dead implement ion of REAL-TIME for Exstensions.conf, things would/could be Soooooo Sweet. [ Can I get a Amen for having LABELS for steps in exstensions.conf when it is in Real Time ? Why the Heck do I have to use Different Format for Applications in exstensions.conf ]