# Dialplan Show based on caller ID

**URL:** <https://community.asterisk.org/t/dialplan-show-based-on-caller-id/112940>\
**Category:** Asterisk Dialplan\
**Created:** [May 17, 2026, 2:19pm UTC](https://community.asterisk.org/t/dialplan-show-based-on-caller-id/112940 "2026-05-17T14:19:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PitzKey](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pitzkey/32/5827_2.png) [@PitzKey](https://community.asterisk.org/u/PitzKey)\
**Post date:** [May 17, 2026, 2:19pm UTC](https://community.asterisk.org/t/dialplan-show-based-on-caller-id/112940/1 "2026-05-17T14:19:09Z")

</div>

Hello,

I have in my dialplan something like this:

```c
[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()`](https://docs.asterisk.org/Asterisk_21_Documentation/API_Documentation/Dialplan_Functions/DIALPLAN_EXISTS/), or is there a better way to do this in the dialplan or from the CLI?

Thank you

---

<div class="post-metadata">

**Author:** ![kingasterisk](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@kingasterisk](https://community.asterisk.org/u/kingasterisk)\
**Post date:** [May 19, 2026, 5:07am UTC](https://community.asterisk.org/t/dialplan-show-based-on-caller-id/112940/2 "2026-05-19T05:07:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [June 18, 2026, 5:07am UTC](https://community.asterisk.org/t/dialplan-show-based-on-caller-id/112940/3 "2026-06-18T05:07:56Z")

</div>

Closed on June 18, 2026, 5:07am UTC

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