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:
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.