Sangoma A101 issues - D-Channel going offline

We are trying to turn up a new PRi circuit and I am having issues getting it to stay connected. According to ATT everything is set correctly on their end.

I have the following when I run a “pri show span 1” I get the following.
Primary D-channel: 24
Status: Up, Active
Switchtype: National ISDN
Type: CPE
Remote type: Network
Overlap Dial: 0
Logical Channel Mapping: 0
Timer and counter settings:
N200: 3
N202: 3
K: 7
T200: 1000
T201: 1000
T202: 10000
T203: 10000
T303: 4000
T305: 30000
T308: 4000
T309: 6000
T312: 6000
T313: 4000
T-HOLD: 4000
T-RETRIEVE: 4000
T-RESPONSE: 4000
Q931 RX: 0
Q931 TX: 0
Q921 RX: 302
Q921 TX: 322
Q921 Outstanding: 0 (TEI=0)
Total active-calls:0 global:0
CC records:
Overlap Recv: No

and when I run “pri set debug on span 1” I get the following over and over.
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 MDL-ERROR (F): SABME in state 7(Multi-frame established)
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 MDL-ERROR (F): SABME in state 7(Multi-frame established)
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 MDL-ERROR (F): SABME in state 7(Multi-frame established)
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 MDL-ERROR (F): SABME in state 7(Multi-frame established)

And when I make a call, I get the following:
PRI Span: 1 – Making new call for cref 327695
– Requested transfer capability: 0x00 - SPEECH
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=51
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 > Message Type: SETUP (5)
PRI Span: 1 TEI=0 Transmitting N(S)=0, window is open V(A)=0 K=7
PRI Span: 1
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=51
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 > Message Type: SETUP (5)
PRI Span: 1 > [04 03 80 90 a2]
PRI Span: 1 > Bearer Capability (len= 5) [ Ext: 1 Coding-Std: 0 Info transfer capability: Speech (0)
PRI Span: 1 > Ext: 1 Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 1 > User information layer 1: u-Law (34)
PRI Span: 1 > [18 03 a1 83 81]
PRI Span: 1 > Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Preferred Dchan: 0
PRI Span: 1 > ChanSel: As indicated in following octets
PRI Span: 1 > Ext: 1 Coding: 0 Number Specified Channel Type: 3
PRI Span: 1 > Ext: 1 Channel: 1 Type: CPE]
PRI Span: 1 > [1e 02 80 83]
PRI Span: 1 > Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: User (0)
PRI Span: 1 > Ext: 1 Progress Description: Calling equipment is non-ISDN. (3) ]
PRI Span: 1 > [28 0a b1 4a 6f 68 6e 20 42 65 68 72]
PRI Span: 1 > Display (len=10) Charset: 31 [ name ]
PRI Span: 1 > [6c 05 21 80 31 30 33]
PRI Span: 1 > Calling Number (len= 7) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
PRI Span: 1 > Presentation: Presentation permitted, user number not screened (0) ‘103’ ]
PRI Span: 1 > [70 0b a1 35 31 32 34 35 30 34 39 32 39]
PRI Span: 1 > Called Number (len=13) [ Ext: 1 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1) ‘xxxxxxxxxx’ ]
PRI Span: 1 q931.c:6036 q931_setup: Call 32769 enters state 1 (Call Initiated). Hold state: Idle
– Called DAHDI/g0/xxxxxxxxxx
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 MDL-ERROR (F): SABME in state 7(Multi-frame established)
PRI Span: 1 TEI=0 DL event: Q931_DL_EVENT_DL_ESTABLISH_IND(1)
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=12
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 > Message Type: STATUS (125)
PRI Span: 1 TEI=0 Transmitting N(S)=0, window is open V(A)=0 K=7
PRI Span: 1
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=12
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 > Message Type: STATUS (125)
PRI Span: 1 > [08 02 80 9f]
PRI Span: 1 > Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: User (0)
PRI Span: 1 > Ext: 1 Cause: Normal, unspecified (31), class = Normal Event (1) ]
PRI Span: 1 > [14 01 01]
PRI Span: 1 > Call State (len= 3) [ Ext: 0 Coding: CCITT (ITU) standard (0) Call state: Call Initiated (1)
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 MDL-ERROR (F): SABME in state 7(Multi-frame established)
PRI Span: 1 TEI=0 DL event: Q931_DL_EVENT_DL_ESTABLISH_IND(1)
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=12
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 > Message Type: STATUS (125)
PRI Span: 1 TEI=0 Transmitting N(S)=0, window is open V(A)=0 K=7
PRI Span: 1
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=12
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 > Message Type: STATUS (125)
PRI Span: 1 > [08 02 80 9f]
PRI Span: 1 > Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: User (0)
PRI Span: 1 > Ext: 1 Cause: Normal, unspecified (31), class = Normal Event (1) ]
PRI Span: 1 > [14 01 01]
PRI Span: 1 > Call State (len= 3) [ Ext: 0 Coding: CCITT (ITU) standard (0) Call state: Call Initiated (1)
PRI Span: 1 T303 timed out. cref:32769
PRI Span: 1 q931.c:5883 t303_expiry: Call 32769 enters state 0 (Null). Hold state: Idle
PRI Span: 1 Fake clearing. cref:32769
PRI Span: 1 q931.c:9219 pri_internal_clear: alive 1, hangupack 1
Span 1: Processing event PRI_EVENT_HANGUP
– Span 1: Channel 0/1 got hangup, cause 31
PRI Span: 1 q931.c:6837 q931_hangup: Hangup other cref:32769
PRI Span: 1 q931.c:6594 __q931_hangup: ourstate Null, peerstate Null, hold-state Idle
PRI Span: 1 Destroying call 0x7ff92c00e2b0, ourstate Null, peerstate Null, hold-state Idle
– Hungup ‘DAHDI/i1/xxxxxxxxxx-1’
== Everyone is busy/congested at this time (1:0/0/1)

-- Executing [[email protected]:23] NoOp("SIP/103-0000000b", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 31") in new stack
-- Executing [[email protected]:24] GotoIf("SIP/103-0000000b", "0?continue,1:s-CHANUNAVAIL,1") in new stack
-- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
-- Executing [[email protected]:1] Set("SIP/103-0000000b", "RC=31") in new stack
-- Executing [[email protected]:2] Goto("SIP/103-0000000b", "31,1") in new stack
-- Goto (macro-dialout-trunk,31,1)
-- Executing [[email protected]:1] Goto("SIP/103-0000000b", "continue,1") in new stack
-- Goto (macro-dialout-trunk,continue,1)
-- Executing [[email protected]:1] NoOp("SIP/103-0000000b", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 31 - failing through to other trunks") in new stack
-- Executing [[email protected]:2] Set("SIP/103-0000000b", "CALLERID(number)=103") in new stack
-- Executing [[email protected]:6] Macro("SIP/103-0000000b", "outisbusy,") in new stack
-- Executing [[email protected]:1] Progress("SIP/103-0000000b", "") in new stack
-- Executing [[email protected]:2] GotoIf("SIP/103-0000000b", "0?emergency,1") in new stack
-- Executing [[email protected]:3] GotoIf("SIP/103-0000000b", "0?intracompany,1") in new stack
-- Executing [[email protected]:4] Playback("SIP/103-0000000b", "all-circuits-busy-now&pls-try-call-later, noanswer") in new stack
-- <SIP/103-0000000b> Playing 'all-circuits-busy-now.ulaw' (language 'en')

PRI Span: 1 TEI=0 MDL-ERROR (I): T200 expired N200 times sending RR/RNR in state 8(Timer recovery)
PRI Span: 1 TEI=0 Sending SABME
PRI Span: 1 Changing from state 8(Timer recovery) to 5(Awaiting establishment)
Span 1: Processing event PRI_EVENT_DCHAN_DOWN
== Primary D-Channel on span 1 down
[2013-12-05 16:47:44] WARNING[18976]: sig_pri.c:1126 pri_find_dchan: Span 1: D-channel is down!
– <SIP/103-0000000b> Playing ‘pls-try-call-later.ulaw’ (language ‘en’)
PRI Span: 1 TEI=0 Sending SABME
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 Sending SABME
– Executing [[email protected]:5] Congestion(“SIP/103-0000000b”, “20”) in new stack
[2013-12-05 16:47:46] WARNING[19230]: channel.c:4753 ast_prod: Prodding channel ‘SIP/103-0000000b’ failed
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/103-0000000b’ in macro ‘outisbusy’
== Spawn extension (from-internal, xxxxxxxxxx, 6) exited non-zero on ‘SIP/103-0000000b’
– Executing [[email protected]:1] Hangup(“SIP/103-0000000b”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/103-0000000b’
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 Sending SABME
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 TEI=0 MDL-ERROR (G): T200 expired N200 times sending SABME in state 5(Awaiting establishment)
PRI Span: 1 Changing from state 5(Awaiting establishment) to 4(TEI assigned)
PRI Span: 1 TEI=0 DL event: Q931_DL_EVENT_DL_RELEASE_IND(3)
PRI Span: 1 TEI=0 Got SABME from network peer.
PRI Span: 1 TEI=0 Sending UA
PRI Span: 1 Changing from state 4(TEI assigned) to 7(Multi-frame established)
PRI Span: 1 TEI=0 DL event: Q931_DL_EVENT_DL_ESTABLISH_IND(1)
Span 1: Processing event PRI_EVENT_DCHAN_UP
== Primary D-Channel on span 1 up

I have a ticket open with Sangoma but haven’t heard back yet and was hoping someone could shed some light on this issue.

I appreciate any help.
Cliff

A quick glance with my eyes falling asleep show everything is normal. ATT is hanging up the call with cause 31. I would ask them why they are sending back a cause 31 right after you dial the number as at this point its on them.

Thanks for the late night response. I will bring this back up with them. I thought maybe it was my problem since the d-channel was dropping.

I just thought I would follow up on this issue since I heard back from Sangoma this morning. The issue was I had hardware and software hdlc enabled. I am still confused how it got in this state, but I was working with several configs when I was working with ATT.

HI Cliff,

thanks for providing the support logger attached.
From the output of your asterisk CLI it looks like the D channel is bouncing up and down. As seen from “Primary D-Channel on span 1 up/down” messages"

I took a look at your support logger and it looks like you have both software and hardware hdlc enabled and are competing against each other.
To resolve this issue entirely simply edit the following file and change ‘dchan’ to ‘hardhdlc’:
/etc/dahdi/system.conf

Save and restart.

After further review, I see that this file will be replaced by the system when it is generated. I don’t see how to make this change from the dahdi module anywhere. I looked at the Dahdi documentation at http://literature.schmoozecom.com/dahdi-module/userguide/Dahdi-Module-UserGuide.pdf but don’t see how to change this setting. I assume the next time I make changes the file will go back to the default settings. I am sure I am missing something easy here.