[asterisk-users] MySQL query from extensions?

Yossi Ben Hagai yossibh at gmail.com
Fri Apr 13 15:13:03 MST 2007


That's the correct syntax:

exten => s,1,Noop()
exten => s,n,MYSQL(Connect connid localhost root passw0rd dax)

exten => s,n,MYSQL(Query resultid ${connid} SELECT\ password\ FROM\
dnislookup\ WHERE\ dnis=${IVR-Exten})
exten => s,n,MYSQL(Fetch fetchid ${resultid} password)

exten => s,n,MYSQL(Clear ${password})
exten => s,n,MYSQL(Disconnect ${connid})
exten => s,n,returnpes
On 4/14/07, Barton Fisher <bhfisher at icpage.com> wrote:
>
> Sorry,
> From the logs I see:
>
> Apr 13 13:32:06 WARNING[19854] app_addon_sql_mysql.c: Identifier 0,
> identifier_type 2 not found in identifier list
> Apr 13 13:32:06 WARNING[19854] app_addon_sql_mysql.c: aMYSQL_fetch:
> Invalid result identifier 0 passed
>
> Using this:
>
> exten => s,1,Noop()
> exten => s,n,MYSQL(Connect connid localhost root passw0rd dax)
> exten => s,n,MYSQL(Query resultid ${connid} SELECT\ password\ FROM\
> dnislookup\ WHERE\ dnis=\'${IVR-Exten}\')
> exten => s,n,MYSQL(Fetch fetchid ${password} password)
> exten => s,n,MYSQL(Clear ${password})
> exten => s,n,MYSQL(Disconnect ${connid})
> exten => s,n,return
>
> Bart
>
> Alex Balashov wrote:
> > On Fri, 13 Apr 2007, Barton Fisher said something to this effect:
> >
> >> What wrong with this:
> >
> >   Well... what is wrong with it?  :-)
> >
> >   I'm not trying to be funny, but, what are the symptoms that it
> > doesn't work?  Error output on Asterisk console?  Logs?  Anything you
> > can provide would be helpful.
> >
> > -- Alex
> >
> > --
> > Alex Balashov <sasha at presidium.org>
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >   http://lists.digium.com/mailman/listinfo/asterisk-users
> >
> >
> >
> > __________ NOD32 2187 (20070413) Information __________
> >
> > This message was checked by NOD32 antivirus system.
> > http://www.eset.com
> >
> >
> >
>
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070413/d3db93d9/attachment.htm


More information about the asterisk-users mailing list