[asterisk-users] MySQL Update from exten

2007-04-19 Thread Barton Fisher
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


___
--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


Re: [asterisk-users] MySQL Update from exten

2007-04-19 Thread Lee Jenkins

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



___
--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


Re: [asterisk-users] MySQL Update from exten

2007-04-19 Thread Benchev
 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
 

Probably

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)}\')

Benchev


-

Най-добрият начин да научаваш новините,
които те интересуват.Бързо лесно и безплатно!
новини с филтър
http://www.radar.bg/

___
--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