Extensions_custom.conf stoped to work after update

I`m looking for help for the below code.
It was working fine but after update or something else!, it 'seems that is not working any more!!!

exten => _X.,1,noop(select agent)
same => n,noop(${CALLERID(num)})
same => n,MYSQL(Connect connid localhost user pass asteriskcdrdb)
same => n,MYSQL(Query resultid ${connid} Select cnum from cdr where dst like “%${CALLERID(num)}” and calldate > DATE_SUB( now(), INTERVAL 30 MINUTE ) ORDER BY calldate DESC LIMIT 1)
same => n,MYSQL(Fetch fetchid ${resultid} agentnum)
same => n,MYSQL(Disconnect ${connid})
same => n,noop(${agentnum})
same => n,set(agentnum=a${agentnum})
same => n,noop(${agentnum})
same => n,GotoIf($[${agentnum} = a]?none:exist)
same => n(exist),noop(goto agent)
same => n,goto(from-internal,${agentnum:1},1)
same => n(none),noop(goto trunk)
same => n,goto(from-trunk,99998901,1)

In what way is it not working? What’s the errors in the asterisk console you are getting?

The code is for directing incoming call based on the last extension that call them.
but after update, all the incoming are going to the IVR and looks like the code is not active!

You’ll still need to provide the log of a call attempt if you’d like assistance with it. It’ll be hard for anyone here to guess what’s going on without a call log example.

Did you change major asterisk version? The deprecated MySQL applications are not supported on any asterisk version newer than 18.

this is the version

Connected to Asterisk 18.17.1 currently running on freepbx (pid = 2529)

so what is the suggestion if I want to route incoming call based on the last extension that call?

For the record, I found the issue and it wasn’t related to the Asterisk version. the config for the trunk was removed from the trunk.
I just added context=check-agent to the related trunk and it`s working fine now :))

Thanks everyone for the help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.