# Detect dialed number asterisk + quadBRI PCI ISDN

**URL:** <https://community.asterisk.org/t/detect-dialed-number-asterisk-quadbri-pci-isdn/1925>\
**Category:** Asterisk Support\
**Created:** [October 17, 2005, 12:29pm UTC](https://community.asterisk.org/t/detect-dialed-number-asterisk-quadbri-pci-isdn/1925 "2005-10-17T12:29:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![olex](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@olex](https://community.asterisk.org/u/olex)\
**Post date:** [October 17, 2005, 12:29pm UTC](https://community.asterisk.org/t/detect-dialed-number-asterisk-quadbri-pci-isdn/1925/1 "2005-10-17T12:29:03Z")

</div>

Hello, all.  
I am new with asterisk and have one problem.

I have a quadBRI PCI ISDN card with one ISDN line (4example 1599)  
and two SIP phones with numbers 100 and 101. I want forward calls from external line to one of SIP phones, 4example with 1599100 to Phone1 and 1599101 to Phone2. But when I dial 1599100 I have only 1599 in ${EXTEN} variable, but I need also second part of number (101):  
\*CLI\>  
– Accepting voice call from ‘9242960323’ to ‘1599’ on channel 0/1, span 1  
– Executing NoOp(“Zap/1-1”, “1599”) in new stack  
– Executing Hangup(“Zap/1-1”, “”) in new stack  
== Spawn extension (isdn-incoming, 1599, 2) exited non-zero on ‘Zap/1-1’  
– Hungup ‘Zap/1-1’

I cannot find any solution for this problem, so I’ll be thankfull for any answer.

my cfg files:

zapata.conf  
[channels]

switchtype = euroisdn

; p2mp TE mode (for connecting ISDN lines in point-to-multipoint mode)  
signalling = bri\_cpe\_ptmp

pridialplan = dynamic  
prilocaldialplan = local  
nationalprefix = 0  
internationalprefix = 00  
usecallingpres=yes

echocancel = yes  
echocancelwhenbridged = yes  
echotraining = 100

context=isdn-incoming  
group = 1

# ; S/T port 1-4 channel =\> 1-2 channel =\> 4-5 channel =\> 7-8 channel =\> 10-11

sip.conf  
[general]  
context=default  
port=5060  
bindaddr=0.0.0.0

[100]  
type=friend  
context=sip-phones  
secret=123  
host=dynamic  
qualify=yes  
canreinvite=no  
callerid=“User1” \<100\>

# [101] type=friend context=sip-phones secret=123 host=dynamic qualify=yes canreinvite=no callerid=“User2” \<101\>

extensions.conf  
; incoming ISDN BRI calls arrive in this context  
; we need an extension for every DID/MSN or a pattern that will match all

[isdn-incoming]  
exten =\> \_X.,1,NoOp(${EXTEN})  
exten =\> \_X.,2,Hangup

; in sip.conf you put context=sip-phones so the phones can dial out  
; using zaptel group 1 (which includes all BRI ports, see zapata.conf)  
[sip-phones]  
exten =\> 100,1,Dial(SIP/100)  
exten =\> 101,1,Dial(SIP/101)

exten =\> \_X.,1,Dial(ZAP/g1/${EXTEN},60)  
exten =\> \_X.,2,Hangup

; if the called party is busy  
exten =\> \_X.,102,Playtones(busy)  
exten =\> \_X.,103,Wait(10)  
exten =\> \_X.,104,Hangup

; if all zaptel channels in that group are in use  
; or the D channels are down  
exten =\> \_X.,202,Playtones(congestion)  
exten =\> \_X.,203,Wait(10)  
exten =\> \_X.,204,Hangup

---

<div class="post-metadata">

**Author:** ![rusty](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@rusty](https://community.asterisk.org/u/rusty)\
**Post date:** [October 17, 2005, 1:30pm UTC](https://community.asterisk.org/t/detect-dialed-number-asterisk-quadbri-pci-isdn/1925/2 "2005-10-17T13:30:45Z")

</div>

how about

[isdn-incoming]  
exten =\> 1599,1,Answer  
exten =\> 1599,2,Dial(SIP/101)

---

<div class="post-metadata">

**Author:** ![olex](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@olex](https://community.asterisk.org/u/olex)\
**Post date:** [October 17, 2005, 2:41pm UTC](https://community.asterisk.org/t/detect-dialed-number-asterisk-quadbri-pci-isdn/1925/3 "2005-10-17T14:41:50Z")

</div>

Sorry, but you didn’t understood my problem, I have NoOp only for logging in console, I can, of course redirect call to SIP phone, but how I know to which? I should do something like:  
[isdn-incoming]  
exten =\> 1599.,1,Dial(SIP/{$EXTEN:4})  
…

but my {$EXTEN} is not 1599101, but only 1599 . This is the problem.

---

<div class="post-metadata">

**Author:** ![rusty](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@rusty](https://community.asterisk.org/u/rusty)\
**Post date:** [October 17, 2005, 3:02pm UTC](https://community.asterisk.org/t/detect-dialed-number-asterisk-quadbri-pci-isdn/1925/4 "2005-10-17T15:02:28Z")

</div>

Ok sound like what you want is a DID service where multiple numbers are sent on same line. This would be provided to you by your service provider then you can route the differnt number to differnet phones.

Or you could still use 1 number and a menu to direct the call press 1 for 101 and 2 for 102.

---

<div class="post-metadata">

**Author:** ![olex](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@olex](https://community.asterisk.org/u/olex)\
**Post date:** [October 18, 2005, 5:43am UTC](https://community.asterisk.org/t/detect-dialed-number-asterisk-quadbri-pci-isdn/1925/5 "2005-10-18T05:43:23Z")

</div>

Thank you, I’ll ask my provider about this feature.
