Dialplan Show based on caller ID

Hello,

I have in my dialplan something like this:

[inbound-dids]
exten => _[+*#0-9A-Za-z]./_8881234567,1,NoOp(Blacklisted: Ticket #123456)
 same => n,Goto(termination,hangup,1)
 same => n,Hangup()

exten => _[+*#0-9A-Za-z]./_8009991212,1,NoOp(Blacklisted: Ticket #654321)
 same => n,Goto(termination,hangup,1)
 same => n,Hangup()

Is there a way to check, from within the dialplan, whether a CID-specific pattern for a given caller ID exists? For example, can I test whether a rule matching 8881234567 is present using DIALPLAN_EXISTS(), or is there a better way to do this in the dialplan or from the CLI?

Thank you

Hello,

For CID pattern existence checks in Asterisk dialplan, there is no direct reliable method inside the dialplan itself.

A better approach is to manage CID rules using AstDB or an external database and perform a lookup before routing the call.

You can verify loaded dialplan entries using:

dialplan show

This keeps the logic cleaner and more scalable for large setups.