AW: [Asterisk-Users] Bug in PGSQL

Steven Critchfield critch at basesys.com
Mon May 26 07:46:30 MST 2003


This is what I have had working

exten => 81,1,PGSQL,"Connect connid host=localhost user=dts dbname=pbx";
exten => 81,2,PGSQL,"Query resultid ${connid} Select floor(random() *
count(distinct mid) + 1) as jokeid from messages";
exten => 81,3,PGSQL,"Fetch fetchid ${resultid} jokeid";
exten => 81,4,PGSQL,"Query resultid ${connid} Select message,
char_length(message) from messages where mid = ${jokeid} order by uid
asc";
exten => 81,5,PGSQL,"Fetch fetchid ${resultid} message strlen";
exten => 81,6,GotoIf,${strlen}?81|100:81|8;
exten => 81,7,Goto,t|1
exten => 81,8,Festival,${message}
exten => 81,9,GotoIf,${fetchid}?81|100:81|5
exten => 81,100,Wait,1
exten => 81,101,Festival,"Good bye"
exten => 81,102,Goto,t|1

Last upgrade and compile was May 12th.
Of course as I go to test that it still works, it doesn't. I have been
able to get a hair closer to having it work again by putting unquoteing
the queries and writing the line like functions. But still had problems.


On Mon, 2003-05-26 at 09:09, Thomas Haeger wrote:
> The whole extenstr is as follows:
> 
> 	exten => ....Connect etc.
> 
> 	exten => _XXXX,2,"Query resultid ${connid} SELECT count(*) from tbltest
> where fldtest='${EXTEN}'";
> 
> 	exten => .....
> 
> It works with
> 
> 	exten => _XXXX,2,"Query resultid ${connid} SELECT fldtest from tbltest
> where fldtest='${EXTEN}'";
> 
> 
> 
> Regards,
> 
> Thomas
> -----Ursprüngliche Nachricht-----
> Von: asterisk-users-admin at lists.digium.com
> [mailto:asterisk-users-admin at lists.digium.com]Im Auftrag von Steven
> Critchfield
> Gesendet: Montag, 26. Mai 2003 16:09
> An: asterisk-users at lists.digium.com
> Betreff: Re: [Asterisk-Users] Bug in PGSQL
> 
> 
> Did you quote the string?
> 
> Granted I haven't used mine in a while, but I have a similar query that
> has worked just fine in extensions.conf.
> 
> On Mon, 2003-05-26 at 08:46, Thomas Haeger wrote:
> > Hi all,
> >
> > i use the PGSQL App, and i have found out, if you use a "(" or a ")" in
> your
> > query the query crashes...
> >
> > My sample query was :
> >
> > 	SELECT count(*) from tbltest where fldtest='xxx'
> >
> > can somebody fix this ...??
> >
> > Regards,
> >
> > Thomas.
> >
> >
> > *******************************************
> > beroNet technologies GmbH
> > Dipl.- Ing. Thomas Häger
> > Potsdamer Str. 18 A
> > 14513 Teltow
> >
> > FON:    +49 (0) 3328 3077731
> > FAX:    +49 (0) 3328 334779
> > Email:  thomas.haeger at beronet.com
> > *******************************************
> >
> > _______________________________________________
> > Asterisk-Users mailing list
> > Asterisk-Users at lists.digium.com
> > http://lists.digium.com/mailman/listinfo/asterisk-users
> --
> Steven Critchfield <critch at basesys.com>
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
Steven Critchfield <critch at basesys.com>




More information about the asterisk-users mailing list