[asterisk-users] MySQL Update from exten

Lee Jenkins lee at datatrakpos.com
Thu Apr 19 18:20:51 MST 2007


Barton Fisher wrote:
> I've tried every combination I could find on the net and so far there is 
> no joy
> The thing is I can do this update from the command line:  Maybe some new 
> eyes might find the answer?
> 
> exten => update,1,MYSQL(Connect connid localhost root password dax)
> exten => update,n,MYSQL(QUERY resultid ${connid} UPDATE\ caller\ SET\ 
> lastcall=${LASTCALL}\,totalcalls=totalcalls+1\,currentcalls=currentcalls+1\ 
> WHERE\ dnis=\'${IVR-Exten}\'\ AND\ ani=\'${CALLERID(number)}\')
> exten => update,n,MYSQL(Clear ${resultid})
> exten => update,n,MYSQL(Disconnect ${connid})
> 
> Asterisk logs says:
> Apr 19 15:50:05 VERBOSE[19740] logger.c: -- Executing 
> MYSQL("SIP/5400-b7bbfaf0", "QUERY resultid 201 UPDATE caller SET 
> lastcall= 04/18/07 11:12:55, totalcalls= totalcalls+1, currentcalls= 
> currentcalls+1 WHERE dnis= '7690' AND ani= '5400'") in new stack
> Apr 19 15:50:05 WARNING[18333] app_addon_sql_mysql.c: Identifier 200, 
> identifier_type 2 not found in identifier list
> Apr 19 15:50:05 WARNING[18333] app_addon_sql_mysql.c: Invalid result 
> identifier 200 passed in aMYSQL_clear
> 
> I understand what the warning message is really saying
> 
> Bart

I don't use mySQL much, but if lastcall is a Timestamp field, don't you 
have to quote it out?

-- 

Warm Regards,

Lee





More information about the asterisk-users mailing list