I have a situation where we have a growing list of CIDnum’s that get sent to a custom context via dialplan GotoIf. Rather than continually append each number to the GotoIf line in the dialplan (which is getting to be a mile long):
exten => _X.,n,GotoIf($[$["${ocn}" = “15555551212”] | ["${ocn}" = “15555551313”] | ["${ocn}" = “15555551414”] | ["${ocn}" = “15555551515”]…]?sub-custom,_X.,1)
We’d like to leverage Asterisk 11’s sqlite database and simply have the dialplan run a query on the database for the number, much like checking the existence of a number in the blacklist table:
I realize the inherent risks of mucking with the astdb.sqlite file, but would like to know if it’s possible to create a custom database or add a custom table with the intent of querying it through the dialplan. Or if there is a better or other way of screening a bunch of numbers within the diaplan.
You could probably hack the caller ID name, setting the name=${ocn} temporarily, then run BLACKLIST(), and finally restore the caller ID name to the original value.