Using Dynamic Routes as an extended blocklist

This post by @ptravel reminded me about the periodic request that comes up here to be able to block inbound calls based on Caller ID Name. The existing blacklist module can’t do this, but there was a third party module years ago called Swiss Army Knife that added this extended functionality. I don’t know if SAK will install on a current system or not.

Not to worry. Whenever anyone asks the question that starts with “I need to branch the call flow based on the value of …” then you are squarly in Dynamic Routes territory. In this case you can use the existing Blacklist module to populate the AstDB with offending Caller ID Name values. You can then check the AstDB for the entry using this expression:

${DB_EXISTS(blacklist/${CALLERID(name)})}

The above will check the blacklist DB for the presence of the Caller ID name and if present, will return the value 1. If not present, it will return a value of 0. You can then construct the call flow in a Dynamic Route as follows:

This works differently from the Blacklist module in that you must route the call from the inbound route to the new Dynamic Route, but otherwise should work as expected. Could benefit from some actual testing, such as with CallerID name with special characters or spaces.

3 Likes

I’ll try this. Thanks!

This worked perfectly. Thanks!

1 Like

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