comtech
(Com Tech)
September 23, 2020, 2:23pm
2
Different use case, but @billsimon ’s solution will work for you as well. Essentially make a custom context that calls the AGI and use that for your inbound route.
Custom context means you write it yourself; you have a lot of options!
Make a new context in the /etc/asterisk/extensions_custom.conf file (for example, call it [from-pstn-filterspam]) and add some dialplan like this (NOT tested)
[from-pstn-filterspam]
exten => _X.,1,NoOp(Entered pstn custom context)
same => n,ExecIf($[${REGEX("^V[0-9]+" CALLERID(name))} = 1]?Goto(app-blackhole,congestion,1))
same => n,Goto(from-pstn,${EXTEN},1)
(it can be on a single line but I spread it out to make it more …