Hi,
I have several PRI and BRI cards all working fine except for one PRI line/port which is “misbehaving”.
Just for the record, this failing PRI line works fine with an old Asterisk 1.4 with libpri. It “misbehaves” when moving it to a new Asterisk 18.10.0 with libpri 1.6.0.
Whenever I dial “DAHDI/g4/${DIALED_NUMBER}” I can hear my provider’s automated voice saying that the dialed number does not exist.
So I’m guessing that the PRI port (Digium) works fine, and that I am accessing my provider’s services. However, it seems (just a thought here) that Asterisk is not sending the digits out properly through the PRI line (or the provider is not receiving all of them properly).
It’s as if ${DIALED_NUMBER} were sent truncated somehow. I have no proof of this because I have no way of knowing what the PRI line provider is actually “seeing”.
This is what I see in the console:
-- Called DAHDI/g4/${DIALED_NUMBER}
-- DAHDI/i6/${DIALED_NUMBER}-c is proceeding passing it to PJSIP/web4053-000000ed
-- DAHDI/i6/${DIALED_NUMBER}-c is making progress passing it to PJSIP/web4053-000000ed
> 0x7fa67812d4e0 -- Strict RTP learning after remote address set to: ${ASTERISK_SERVER_PUB_IP_ADDR1}:26898
> 0x7fa67812d4e0 -- Strict RTP learning after ICE completion
> 0x7fa67812d4e0 -- Strict RTP learning after remote address set to: ${CLIENT_IP_ADDR}:41237
-- PJSIP/web4053-000000ed requested media update control 26, passing it to DAHDI/i6/${DIALED_NUMBER}-c
> 0x7fa67812d4e0 -- Strict RTP switching to RTP target address ${CLIENT_IP_ADDR}:41237 as source
My chan_dahdi.conf includes a files which contains:
; Span 6: WCTE2/0/2 "WCTE23X (PCI) Card 0 Span 2" CCS/HDB3/CRC4 RED
group=4,16
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 44-58,60-74
context = default
group = 63
My /etc/dahdi/system.conf contains:
# Span 6: WCTE2/0/2 "WCTE23X (PCI) Card 0 Span 2" CCS/HDB3/CRC4 RED
span=6,6,0,ccs,hdb3,crc4
# termtype: te
bchan=44-58,60-74
dchan=59
echocanceller=mg2,44-58,60-74
If I run
# asterisk -rx "pri show spans"
I can see that the span is up:
PRI span 6/0: Up, Active
Here are the details:
# asterisk -rx "pri show span 6"
Primary D-channel: 59
Status: Up, Active
Switchtype: EuroISDN
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: 2000
T203: 10000
T303: 4000
T305: 30000
T308: 4000
T309: 6000
T312: 6000
T313: 4000
T316: -1
N316: 2
T-HOLD: 4000
T-RETRIEVE: 4000
T-RESPONSE: 4000
T-STATUS: 4000
T-ACTIVATE: 10000
T-DEACTIVATE: 4000
T-INTERROGATE: 4000
T-RETENTION: 30000
T-CCBS1: 4000
T-CCBS2: 2700000
T-CCBS3: 20000
T-CCBS4: 5000
T-CCBS5: 3600000
T-CCBS6: 3600000
T-CCNR2: 10800000
T-CCNR5: 11700000
T-CCNR6: 11700000
Q931 RX: 55
Q931 TX: 47
Q921 RX: 165
Q921 TX: 75385
Q921 Outstanding: 0 (TEI=0)
Total active-calls:0 global:0
CC records:
Overlap Recv: No
I also ran
pri set debug on span 6
and I’m getting lots of messages in the console.
Example:
-- Executing [s@custom-dialout:2] Dial("PJSIP/web4053-0000017d", "DAHDI/g4/${DIALED_NUMBER},300,tTwWxX") in new stack
PRI Span: 6 -- Making new call for cref 32778
-- Requested transfer capability: 0x00 - SPEECH
PRI Span: 6
PRI Span: 6 > DL-DATA request
PRI Span: 6 > Protocol Discriminator: Q.931 (8) len=36
PRI Span: 6 > TEI=0 Call Ref: len= 2 (reference 10/0xA) (Sent from originator)
PRI Span: 6 > Message Type: SETUP (5)
PRI Span: 6 TEI=0 Transmitting N(S)=12, window is open V(A)=12 K=7
PRI Span: 6
PRI Span: 6 > Protocol Discriminator: Q.931 (8) len=36
PRI Span: 6 > TEI=0 Call Ref: len= 2 (reference 10/0xA) (Sent from originator)
PRI Span: 6 > Message Type: SETUP (5)
PRI Span: 6 > [04 03 80 90 a3]
PRI Span: 6 > Bearer Capability (len= 5) [ Ext: 1 Coding-Std: 0 Info transfer capability: Speech (0)
PRI Span: 6 > Ext: 1 Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 6 > User information layer 1: A-Law (35)
PRI Span: 6 > [18 03 a1 83 81]
PRI Span: 6 > Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Preferred Dchan: 0
PRI Span: 6 > ChanSel: As indicated in following octets
PRI Span: 6 > Ext: 1 Coding: 0 Number Specified Channel Type: 3
PRI Span: 6 > Ext: 1 Channel: 1 Type: CPE]
PRI Span: 6 > [6c 06 21 80 34 30 35 33]
PRI Span: 6 > Calling Party Number (len= 8) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
PRI Span: 6 > Presentation: Presentation allowed, User-provided, not screened (0) '4053' ]
PRI Span: 6 > [70 0a 80 36 35 36 36 36 30 34 39 39]
PRI Span: 6 > Called Party Number (len=12) [ Ext: 1 TON: Unknown Number Type (0) NPI: Unknown Number Plan (0) '${DIALED_NUMBER}' ]
PRI Span: 6 > [a1]
PRI Span: 6 > Sending Complete (len= 1)
PRI Span: 6 q931.c:6531 q931_setup: Call 32778 enters state 1 (Call Initiated). Hold state: Idle
-- Called DAHDI/g4/${DIALED_NUMBER}
PRI Span: 6
PRI Span: 6 < Protocol Discriminator: Q.931 (8) len=10
PRI Span: 6 < TEI=0 Call Ref: len= 2 (reference 10/0xA) (Sent to originator)
PRI Span: 6 < Message Type: CALL PROCEEDING (2)
PRI Span: 6 < [18 03 a9 83 81]
PRI Span: 6 < Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan: 0
PRI Span: 6 < ChanSel: As indicated in following octets
PRI Span: 6 < Ext: 1 Coding: 0 Number Specified Channel Type: 3
PRI Span: 6 < Ext: 1 Channel: 1 Type: CPE]
PRI Span: 6 Received message for call 0x7fa61812f420 on link 0x55ff206ddfe0 TEI/SAPI 0/0
PRI Span: 6 -- Processing IE 24 (cs0, Channel ID)
PRI Span: 6 q931.c:9095 post_handle_q931_message: Call 32778 enters state 3 (Outgoing Call Proceeding). Hold state: Idle
Span 6: Processing event PRI_EVENT_PROCEEDING(13)
-- DAHDI/i6/${DIALED_NUMBER}-11 is proceeding passing it to PJSIP/web4053-0000017d
PRI Span: 6
PRI Span: 6 < Protocol Discriminator: Q.931 (8) len=13
PRI Span: 6 < TEI=0 Call Ref: len= 2 (reference 10/0xA) (Sent to originator)
PRI Span: 6 < Message Type: PROGRESS (3)
PRI Span: 6 < [1e 02 8a 81]
PRI Span: 6 < Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Network beyond the interworking point (10)
PRI Span: 6 < Ext: 1 Progress Description: Call is not end-to-end ISDN; further call progress information may be available inband. (1) ]
PRI Span: 6 < [1e 02 8a 88]
PRI Span: 6 < Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Network beyond the interworking point (10)
PRI Span: 6 < Ext: 1 Progress Description: Inband information or appropriate pattern now available. (8) ]
PRI Span: 6 Received message for call 0x7fa61812f420 on link 0x55ff206ddfe0 TEI/SAPI 0/0
PRI Span: 6 -- Processing IE 30 (cs0, Progress Indicator)
PRI Span: 6 -- Processing IE 30 (cs0, Progress Indicator)
Span 6: Processing event PRI_EVENT_PROGRESS(17)
-- DAHDI/i6/${DIALED_NUMBER}-11 is making progress passing it to PJSIP/web4053-0000017d
> 0x7fa5e410e550 -- Strict RTP learning after remote address set to: ${ASTERISK_SERVER_PUBLIC_IP_ADDR1}:21728
> 0x7fa5e410e550 -- Strict RTP learning after ICE completion
> 0x7fa5e410e550 -- Strict RTP learning after remote address set to: ${CLIENT_IP_ADDR}:40221
-- PJSIP/web4053-0000017d requested media update control 26, passing it to DAHDI/i6/${DIALED_NUMBER}-11
> 0x7fa5e410e550 -- Strict RTP switching to RTP target address ${CLIENT_IP_ADDR}:40221 as source
> 0x7fa5e410e550 -- Strict RTP learning complete - Locking on source address ${CLIENT_IP_ADDR}:40221
PRI Span: 6
PRI Span: 6 < Protocol Discriminator: Q.931 (8) len=9
PRI Span: 6 < TEI=0 Call Ref: len= 2 (reference 10/0xA) (Sent to originator)
PRI Span: 6 < Message Type: DISCONNECT (69)
PRI Span: 6 < [08 02 83 9f]
PRI Span: 6 < Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Transit network (3)
PRI Span: 6 < Ext: 1 Cause: Normal, unspecified (31), class = Normal Event (1) ]
PRI Span: 6 Received message for call 0x7fa61812f420 on link 0x55ff206ddfe0 TEI/SAPI 0/0
PRI Span: 6 -- Processing IE 8 (cs0, Cause)
PRI Span: 6 -- Found active call: 0x7fa61812f420 cref:32778
PRI Span: 6 q931.c:9345 post_handle_q931_message: Call 32778 enters state 12 (Disconnect Indication). Hold state: Idle
Span 6: Processing event PRI_EVENT_HANGUP_REQ(15)
-- Span 6: Channel 0/1 got hangup request, cause 31
PRI Span: 6 q931.c:7332 q931_hangup: Hangup other cref:32778
PRI Span: 6 q931.c:7089 __q931_hangup: ourstate Disconnect Indication, peerstate Disconnect Request, hold-state Idle
PRI Span: 6 q931.c:6124 q931_release: Call 32778 enters state 19 (Release Request). Hold state: Idle
PRI Span: 6
PRI Span: 6 > DL-DATA request
PRI Span: 6 > Protocol Discriminator: Q.931 (8) len=9
PRI Span: 6 > TEI=0 Call Ref: len= 2 (reference 10/0xA) (Sent from originator)
PRI Span: 6 > Message Type: RELEASE (77)
PRI Span: 6 TEI=0 Transmitting N(S)=13, window is open V(A)=13 K=7
PRI Span: 6
PRI Span: 6 > Protocol Discriminator: Q.931 (8) len=9
PRI Span: 6 > TEI=0 Call Ref: len= 2 (reference 10/0xA) (Sent from originator)
PRI Span: 6 > Message Type: RELEASE (77)
PRI Span: 6 > [08 02 81 9f]
PRI Span: 6 > Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Private network serving the local user (1)
PRI Span: 6 > Ext: 1 Cause: Normal, unspecified (31), class = Normal Event (1) ]
-- Hungup 'DAHDI/i6/${DIALED_NUMBER}-11'
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@custom-dialout:3] Return("PJSIP/web4053-0000017d", "") in new stack
-- Executing [${DIALED_NUMBER}@default:3] Hangup("PJSIP/web4053-0000017d", "") in new stack
== Spawn extension (default, ${DIALED_NUMBER}, 3) exited non-zero on 'PJSIP/web4053-0000017d'
PRI Span: 6
PRI Span: 6 < Protocol Discriminator: Q.931 (8) len=5
PRI Span: 6 < TEI=0 Call Ref: len= 2 (reference 10/0xA) (Sent to originator)
PRI Span: 6 < Message Type: RELEASE COMPLETE (90)
PRI Span: 6 Received message for call 0x7fa61812f420 on link 0x55ff206ddfe0 TEI/SAPI 0/0
PRI Span: 6 q931.c:9204 post_handle_q931_message: Call 32778 enters state 0 (Null). Hold state: Idle
PRI Span: 6 q931.c:7332 q931_hangup: Hangup other cref:32778
PRI Span: 6 q931.c:7089 __q931_hangup: ourstate Null, peerstate Null, hold-state Idle
PRI Span: 6 Destroying call 0x7fa61812f420, ourstate Null, peerstate Null, hold-state Idle
Span 6: Processing event PRI_EVENT_HANGUP_ACK(9)
As I said before, during the above console log I can hear the provider’s autoamted voice telling me that the number I dialed is invalid or the subscriber doesn’t exist.
Also, the provider does not require a special prefix to dial out.
In fact, if I check my old Asterisk 1.4 system I can confirm that I’m dialing out the same way but with “ZAP/g1/${DIALED_NUMBER}|300|TWf” where ${DIALED_NUMBER} is exactly the same.
My old /etc/asterisk/zapata.conf (Asterisk 1.4) is:
[trunkgroups]
trunkgroup => 1,16
spanmap => 1,1,1
[channels]
language=es
context=from-zaptel
signalling=fxs_ks
rxwink=300
usecallerid=yes
cidsignalling=dtmf
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
rxgain=14.0
txgain=1.0
group=0
immediate=no
busydetect=no
callprogress=no
faxdetect=no
switchtype = euroisdn
signalling = pri_cpe
overlapdial=yes
context=from-alcatel-custom
group = 1
callgroup = 1
pickupgroup = 1
immediate=no
echocancel=yes
echotraining=yes
echocancelwhenbridged=yes
rxgain=2.0
txgain=1.0
busydetect=no
facilityenable = yes
transfer = yes
channel => 1-15
channel => 17-31
My old /etc/zaptel.conf is:
span=1,1,0,ccs,hdb3,crc4
bchan=1-15
dchan=16
bchan=17-31
Still in my old Asterisk 1.4 system:
# asterisk -rx "pri show span 1"
Primary D-channel: 16
Status: Provisioned, Up, Active
Switchtype: EuroISDN
Type: CPE
Overlap Dial: 1
Logical Channel Mapping: 0
Timer and counter settings:
N200: 3
N202: 3
K: 7
T200: 1000
T202: 10000
T203: 10000
T303: 4000
T305: 30000
T308: 4000
T309: 6000
T313: 4000
T-HOLD: 4000
T-RETRIEVE: 4000
T-RESPONSE: 4000
Overlap Recv: Yes
So, I’m wondering why the calls are working fine in the old 1.4 system but not in the new one.
Any ideas?