# Dialplan to detect if context have includes

**URL:** <https://community.asterisk.org/t/dialplan-to-detect-if-context-have-includes/44872>\
**Category:** Asterisk General\
**Created:** [January 3, 2014, 8:28pm UTC](https://community.asterisk.org/t/dialplan-to-detect-if-context-have-includes/44872 "2014-01-03T20:28:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnu](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gnu](https://community.asterisk.org/u/gnu)\
**Post date:** [January 3, 2014, 8:28pm UTC](https://community.asterisk.org/t/dialplan-to-detect-if-context-have-includes/44872/1 "2014-01-03T20:28:18Z")

</div>

Hi. I need help.

I have this:

[internal]  
include =\> A  
include =\> B  
exten=\>71,1,Dial(SIP/71)

I need a way to display inside a NoOp() if the context [interna] have the include =\> Ainside of it.

If the context have the include =\> A, set the variable: TEST=1

I need help here. I was trying using EXIST\_DB but, any function check if EXIST something inside of context?

Thanks!

---

<div class="post-metadata">

**Author:** ![dejanst](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@dejanst](https://community.asterisk.org/u/dejanst)\
**Post date:** [January 6, 2014, 2:04pm UTC](https://community.asterisk.org/t/dialplan-to-detect-if-context-have-includes/44872/2 "2014-01-06T14:04:52Z")

</div>

I think there is no way of knowing this in Asterisk dialplan. The “include =\>” statements are read only when Asterisk is parsing the dialplans on boot or on “dialplan reload”.

What is the use case that requires this?

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [January 6, 2014, 2:11pm UTC](https://community.asterisk.org/t/dialplan-to-detect-if-context-have-includes/44872/3 "2014-01-06T14:11:53Z")

</div>

include needs to be encoded in the internal data structures. It is #include that is resolved at load time. However, I agree that the use case is needed here.
