# Extensions.conf, Filter not available SIPs

**URL:** <https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775>\
**Category:** Asterisk Support\
**Created:** [October 28, 2008, 10:48am UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775 "2008-10-28T10:48:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mod83](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mod83](https://community.asterisk.org/u/mod83)\
**Post date:** [October 28, 2008, 10:48am UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775/1 "2008-10-28T10:48:37Z")

</div>

Hi,

i have 3 digits internal Numbers (100-999) and i want to realize a function who checks, if an extension is available (or not) and route this to a defined specific extension.

Example:  
I have extensions for 100 and 101. When a call is for 102 (extension that doesnt exists) it would be nice, that the call is tranfered to 100. When a call is for 100, the call should be tranferred to 100…

Thanks for help,  
Mod

---

<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:** [October 28, 2008, 11:02am UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775/2 "2008-10-28T11:02:44Z")

</div>

${DIALSTATUS} after Dial

I think 1.6 has functions for getting device status.

---

<div class="post-metadata">

**Author:** ![mod83](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mod83](https://community.asterisk.org/u/mod83)\
**Post date:** [October 28, 2008, 11:09am UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775/3 "2008-10-28T11:09:27Z")

</div>

Hi!

I have asterisk 1.4 ☹

My extensions.conf looks like this:

`exten => _12345XXX,1,Dial(SIP/${EXTEN:5},20)
`

This handles calls from outside…

How can i implementent DIALSTATUS in this Case?

Mod

---

<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:** [October 28, 2008, 11:11am UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775/4 "2008-10-28T11:11:49Z")

</div>

I don’t see why not.

---

<div class="post-metadata">

**Author:** ![mod83](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mod83](https://community.asterisk.org/u/mod83)\
**Post date:** [October 28, 2008, 11:54am UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775/5 "2008-10-28T11:54:40Z")

</div>

Could you please help me HOW to implement DIALSTATUS in my extensions.conf?

---

<div class="post-metadata">

**Author:** ![davevg](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@davevg](https://community.asterisk.org/u/davevg)\
**Post date:** [October 28, 2008, 2:23pm UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775/6 "2008-10-28T14:23:26Z")

</div>

`exten => _12345XXX,1,Dial(SIP/${EXTEN:5},20)
exten => _12345XXX,n,NoOp(${DIALSTATUS})
exten => _12345XXX,n, do something based on the status...`

And DIALSTATUS will be one of:

CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL  
DONTCALL | TORTURE | INVALIDARGS

---

<div class="post-metadata">

**Author:** ![mod83](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mod83](https://community.asterisk.org/u/mod83)\
**Post date:** [October 28, 2008, 3:04pm UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775/7 "2008-10-28T15:04:59Z")

</div>

Hi,

thanks for help.

And when an extension is not available it is ths status “chanunavail”?

I dont know how to “do something based on the status”. Could you please provide me an example based on my need?

Thanks,  
Mod

---

<div class="post-metadata">

**Author:** ![davevg](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@davevg](https://community.asterisk.org/u/davevg)\
**Post date:** [October 28, 2008, 6:38pm UTC](https://community.asterisk.org/t/extensions-conf-filter-not-available-sips/23775/8 "2008-10-28T18:38:36Z")

</div>

Look in the configs directory of your asterisk source for some example dialplans in extensions.conf. Specifically look at macro-stdexten.
