Jonas Kellens
2011-Sep-14 12:51 UTC
[asterisk-users] Mysql dialplan statement not executed
Hello, I do the following in a macro in the dialplan : exten => s,n,MYSQL(Connect connid localhost user password AsteriskDB) exten => s,n,MYSQL(Query resultid ${connid} UPDATE custDB SET active=1 WHERE routeID=${ARG1} AND nr=1) exten => s,n,MYSQL(Disconnect ${connid}) But nothing changes in my database... This is the CLI : [Sep 14 16:41:04] -- Executing [s at macro-bal:15] MYSQL("SIP/vc5-0000000b", "Connect connid localhost user password AsteriskDB") in new stack [Sep 14 16:41:04] -- Executing [s at macro-bal:16] MYSQL("SIP/vc5-0000000b", "Query resultid 15 UPDATE custDBSET active=1 WHERE routeID=195 AND nr=1") in new stack [Sep 14 16:41:04] -- Executing [s at macro-bal:17] MYSQL("SIP/vc5-0000000b", "Disconnect 15") in new stack Seems OK, no warnings. But the update has not taken place. Kind regards, Jonas. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110914/a0666598/attachment.htm>
I expect that your same query when executed directly on MySQL console executes successfully ! Normally errors in DB queries are printed on CLI but apparently there is nothing wrong. On Wed, Sep 14, 2011 at 5:51 PM, Jonas Kellens <jonas.kellens at telenet.be>wrote:> ** > Hello, > > I do the following in a macro in the dialplan : > > exten => s,n,MYSQL(Connect connid localhost user password AsteriskDB) > exten => s,n,MYSQL(Query resultid ${connid} UPDATE custDB SET active=1 > WHERE routeID=${ARG1} AND nr=1) > exten => s,n,MYSQL(Disconnect ${connid}) > > But nothing changes in my database... > > This is the CLI : > > [Sep 14 16:41:04] -- Executing [s at macro-bal:15] > MYSQL("SIP/vc5-0000000b", "Connect connid localhost user password > AsteriskDB") in new stack > [Sep 14 16:41:04] -- Executing [s at macro-bal:16] > MYSQL("SIP/vc5-0000000b", "Query resultid 15 UPDATE custDB SET active=1 > WHERE routeID=195 AND nr=1") in new stack > [Sep 14 16:41:04] -- Executing [s at macro-bal:17] > MYSQL("SIP/vc5-0000000b", "Disconnect 15") in new stack > > Seems OK, no warnings. But the update has not taken place. > > > Kind regards, > Jonas. > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > 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/20110914/d8e35e04/attachment.htm>
Jonas Kellens
2011-Sep-14 12:57 UTC
[asterisk-users] Mysql dialplan statement not executed
On 09/14/2011 02:51 PM, Jonas Kellens wrote:> Hello, > > I do the following in a macro in the dialplan : > > exten => s,n,MYSQL(Connect connid localhost user password AsteriskDB) > exten => s,n,MYSQL(Query resultid ${connid} UPDATE custDB SET active=1 > WHERE routeID=${ARG1} AND nr=1) > exten => s,n,MYSQL(Disconnect ${connid}) > > But nothing changes in my database...OK I clearly need to use ", like this : exten => s,n,MYSQL(Query resultid ${connid} UPDATE custDB SET active='1' WHERE routeID="${ARG1}" AND nr="1") Solved. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110914/f1b34d18/attachment.htm>