[asterisk-users] MySQL Update from exten

Benchev bbench at mail.bg
Thu Apr 19 22:02:20 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
> >

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/



More information about the asterisk-users mailing list