# \[Issue\] Outgoing Analog DAHDI Extension

**URL:** <https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744>\
**Category:** Asterisk Support\
**Created:** [January 6, 2011, 8:39pm UTC](https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744 "2011-01-06T20:39:18Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [January 6, 2011, 8:39pm UTC](https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744/1 "2011-01-06T20:39:18Z")

</div>

Hi all,

whenever I try to go Off Hook on my Analog Phone I get a busy tone after a little while (2-3 seconds)

The Asterisk Log shows this:

` == Starting DAHDI/2-1 at internal,s,1 failed so falling back to exten 's'
  == Starting DAHDI/2-1 at internal,s,1 still failed so falling back to context 'default'
[Jan 6 20:29:06] WARNING[2433]: pbx.c:4358 __ast_pbx_run: Channel 'DAHDI/2-1' sent into invalid extension 's' in context 'default', but no invalid handler
    -- Hungup 'DAHDI/2-1'
`

My DAHDY-Conf:

[code] Autogenerated by /usr/sbin/dahdi\_genconf on Thu Apr 15 14:23:23 2010  
; If you edit this file and execute /usr/sbin/dahdi\_genconf again,  
; your manual changes will be LOST.  
; Dahdi Channels Configurations (chan\_dahdi.conf)  
;  
; This is not intended to be a complete chan\_dahdi.conf. Rather, it is intended  
; to be #include-d by /etc/chan\_dahdi.conf that will include the global settings  
;

; Span 1: WCTDM/4 “Wildcard TDM400P REV E/F Board 5” (MASTER)  
;;; line="1 WCTDM/4/0 FXOKS (SWEC: MG2)"  
signalling=fxo\_ls  
callerid=“FAX” \<720\>  
mailbox=720  
group=1  
context=internal  
channel =\> 1  
callerid=  
mailbox=  
group=  
context=internal

;;; line="2 WCTDM/4/1 FXOKS (SWEC: MG2)"  
signalling=fxo\_ls  
callerid=“SKY Box” \<721\>  
mailbox=721  
group=5  
context=internal  
channel =\> 2  
callerid=  
mailbox=  
group=  
context=internal

;;; line="3 WCTDM/4/2 FXSKS (SWEC: MG2)"  
signalling=fxs\_ks  
callerid=asreceived  
group=0  
context=from-pstn  
channel =\> 3  
callerid=  
group=  
context=pstn  
[/code]

my Extensions.conf:

[code][general]  
static=yes  
writeprotect=no

[default]  
;include =\> local

[globals]  
DIALTIMEOUT = 45 ;; seconds  
PAGING\_HEADER=intercom  
INTERNAL\_HEADER=internal

[internal]  
exten =\> \_70X,hint,SIP/${EXTEN}  
exten =\> \_70X,1,SIPAddHeader(Alert-Info: ${INTERNAL\_HEADER})  
exten =\> \_70X,2,NoOp(SIP/mypeer ${CALLERID(num)} ext ${EXTEN})  
exten =\> \_70X,n,GotoIf($["${CALLERID(num)}" = “${EXTEN}”]?vm:vm2)  
exten =\> \_70X,n(vm),VoicemailMain(s${EXTEN})  
exten =\> \_70X,n(vm2),Dial(SIP/${EXTEN},25,Tt)  
exten =\> \_70X,n,VoiceMail(${EXTEN})  
exten =\> \_71X,hint,SIP/${EXTEN}  
exten =\> \_71X,1,SIPAddHeader(Alert-Info: ${INTERNAL\_HEADER})  
exten =\> \_71X,2,NoOp(SIP/mypeer ${CALLERID(num)} ext ${EXTEN})  
exten =\> \_71X,n,GotoIf($["${CALLERID(num)}" = “${EXTEN}”]?vm:vm2)  
exten =\> \_71X,n(vm),VoicemailMain(s${EXTEN})  
exten =\> \_71X,n(vm2),Dial(SIP/${EXTEN},25,Tt)  
exten =\> \_71X,n,VoiceMail(${EXTEN})  
exten =\> \_720,1,Dial(DAHDI/1)  
exten =\> \_721,1,Dial(DAHDI/2)

…  
[/code]

I can call the Analog Dahdi Ports 1 & 2 and answer the call but cannot make an outgoing call

I tried to add:

`exten => i,1,playback(tt-weasels)
` to my default as recommended in some other forum post and can then hear the announcement …

` == Starting DAHDI/2-1 at internal,s,1 failed so falling back to exten 's'
  == Starting DAHDI/2-1 at internal,s,1 still failed so falling back to context 'default'
    -- Sent into invalid extension 's' in context 'default' on DAHDI/2-1
    -- Executing [i@default:1] Playback("DAHDI/2-1", "tt-weasels") in new stack
    -- <DAHDI/2-1> Playing 'tt-weasels.gsm' (language 'en')
    -- Auto fallthrough, channel 'DAHDI/2-1' status is 'UNKNOWN'
    -- Hungup 'DAHDI/2-1'
`

where do I go wrong …?

THX

Steff

---

<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:** [January 7, 2011, 10:25pm UTC](https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744/2 "2011-01-07T22:25:11Z")

</div>

ok … I tried Google but no luck …

Content of chan\_dahdi.conf:

```auto
[trunkgroups]

[channels]
loadzone=uk
defaultzone=uk
usecallerid=yes
ukcallerid=yes
cidsignalling=v23 ; Added for UK CLI detection
cidstart=polarity ; Added for UK CLI detection
sendcalleridafter=1
callerid=asreceived ; propagate the CID received from BT.

context=from-pstn
signalling=fxs_ks
rxwink=300 ; Atlas seems to use long (250ms) winks
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
faxdetect=incoming
;echotraining=800
rxgain=0.0
txgain=0.0
callgroup=1
pickupgroup=1

;Uncomment these lines if you have problems with the disconection of your analog lines
;busydetect=yes
;busycount=3

immediate=yes
;usecallerid=yes
;callwaiting=yes
;usecallingpres=yes
;callwaitingcallerid=yes
;threewaycalling=yes
;transfer=yes
;canpark=yes
;cancallforward=yes
;callreturn=yes
;echocancel=yes
;echocancelwhenbridged=no
;echotraining=yes

;group=1
;callgroup=1
;pickupgroup=1

;callprogress=yes
progzone=uk
tonezone = 4 ; 0 is US
jbenable = yes

[home-phones]
context=internal ; Uses the [internal] context in extensions.conf
signalling=fxo_ks ; was auto fxo_ks Use FXO signalling for an FXS channel - as set in sytem.conf.conf
channel => 1 ; Telephone attached to port 1
channel => 2 ; Telephone attached to port 2
dahdichan => 1,2

[pstn]
context=incoming-pstn-line ; Incoming calls go to [incoming-pstn-line] in extensions.conf
signalling=auto ; fxs_ks Use FXS signalling for an FXO channel - use as set in system.conf
faxdetect=incoming
busydetect=yes
;channel => 3
dahdichan => 3 ; PSTN attached to port 3

#include /etc/asterisk/dahdi-channels.conf
```

are there any changes I have to make here ?

It seems whenever I go Off Hook the Extension want’s to default to the [default] but for security I have not included = internal in the [default]

Any Hints?

THX

Steff

---

<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:** [January 10, 2011, 6:57pm UTC](https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744/3 "2011-01-10T18:57:20Z")

</div>

Found it …

```auto

```

needs to be off 😉

Now I just need to figure out how I can dial external/internal with these Extensions

---

<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:** [April 28, 2011, 10:08am UTC](https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744/4 "2011-04-28T10:08:17Z")

</div>

one last thing, when trying to dial from an analog Port it always goes directly to my [outgoing] which is included in my internal …

```auto
[outgoing]
exten => _09X!,1,Dial(DAHDI/3/${EXTEN})
exten => _09X!,2,Congestion
exten => _07X!,1,Dial(DAHDI/3/${EXTEN})
exten => _07X!,2,Congestion
exten => _147X!,1,Dial(DAHDI/3/${EXTEN})
exten => _14X!,2,Congestion
exten => _15X!,1,Dial(DAHDI/3/${EXTEN})
exten => _15X!,2,Congestion
exten => _999,1,Dial(DAHDI/3/${EXTEN})
exten => _999,2,Congestion
exten => _08X!,1,Dial(DAHDI/3/${EXTEN})
exten => _08X!,2,Congestion
exten => _02X!,1,Dial(DAHDI/3/${EXTEN})
exten => _02X!,2,Congestion
exten => _01X!,1,Dial(DAHDI/3/${EXTEN})
exten => _01X!,2,Congestion
exten => _118X!,1,Dial(DAHDI/3/${EXTEN})
exten => _118X!,2,Congestion
exten => _7X!,1,Dial(DAHDI/3/${EXTEN})
exten => _7X!,2,Congestion
exten => _8X!,1,Dial(DAHDI/3/${EXTEN})
exten => _8X!,2,Congestion
```

What would I need to change to be able to dial internally and dial external numbers as each times I go off hook with the analog phone and want to dial example 0771123456789 it matches \_07x and sends the 3 digits to the PSTN and does no send the additional full number …

THX

Steff

---

<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:** [April 28, 2011, 11:53am UTC](https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744/5 "2011-04-28T11:53:45Z")

</div>

The context is defaulting to internal, and only falling back to default because there is no match for an empty number (s).

I’ve not used a pure FXO/FXS system, so I’m not sure how incomplete numbers are handled, but your number patterns ought to at least code the minimum length of the numbers, e.g. \_020XXXXXXXX!

In the US, the numbers, are, I think, all of predictable length, so it is easier for them.

I suspect this may be helpful:

[voip-info.org/wiki/view/Aste … n+Matching](http://www.voip-info.org/wiki/view/Asterisk+Extension+Matching)

---

<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:** [April 28, 2011, 1:35pm UTC](https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744/6 "2011-04-28T13:35:53Z")

</div>

You should also be using . rather than !. The documentation isn’t clear, but, as well as matching zero digits, ! seems to stop looking for extra digits as soon as it is the only possible match, rather than waiting for a timeout.

Don’t use . on my London example, as all the digits have already been matched.

---

<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:** [May 12, 2011, 9:37pm UTC](https://community.asterisk.org/t/issue-outgoing-analog-dahdi-extension/33744/7 "2011-05-12T21:37:07Z")

</div>

OK,

found my issue 😉

I forgot about the chan\_dahdi.conf.

Running dahdi show channels showed me that I had a context for the analog Ports called internal in th chan\_dahdi.conf.

The Entries in the dahdi-channels.conf poing =\> to the chan\_dahdi.conf and that check the extension.conf.

new addition just for my Fax:

`[fax];see chan_dahdi and dahdi-channels
exten => _07.,1,Dial(DAHDI/3/${EXTEN})
exten => _07.,2,Congestion
exten => _020XXXXXXXX!,1,Dial(DAHDI/3/${EXTEN})
exten => _020XXXXXXXX!,2,,Congestion
exten => _7XXXXXXX!,1,Dial(DAHDI/3/${EXTEN})
exten => _7XXXXXXX!,2,,Congestion
exten => _8XXXXXXX!,1,Dial(DAHDI/3/${EXTEN})
exten => _8XXXXXXX!,2,,Congestion
exten => _01XXXXXXXXX!,1,Dial(DAHDI/3/${EXTEN})
exten => _01XXXXXXXXX!,2,,Congestion
exten => _147X!,1,Dial(DAHDI/3/${EXTEN})
exten => _14X!,2,Congestion
exten => _15X!,1,Dial(DAHDI/3/${EXTEN}
exten => _0049X.,1,Dial(DAHDI/3/${EXTEN})
exten => _0049X.,2,Congestion
exten => _15X!,2,Congestion
exten => _999,1,Dial(DAHDI/3/${EXTEN})
exten => _999,2,Congestion
`

THX

Steffen
