B410p and isdn pbx, please help newbie

Hi, i’m skilled with Linux, but newbie with Asterisk. I want to set(for testing/learning) an isdn pbx.
I bought an isdn phone and a digium b410p card. I have configured it in Slackware-Current with the kernel 5.14.14 and latest git dahdi drivers, asterisk version is 16.15.0

First I create the file /etc/dahdi/genconf_parameters

# toni italiani
lc_country      it

# context delle chiamate entranti dalla scheda dahdi
context_lines   from-dahdi

# gruppo di default nel quale inserire le linee dahdi
group_lines     0


# signalling delle linee (bri o bri_ptmp)
bri_sig_style   bri_ptmp

then I run dahdi_genconf


dahdi_genconf -vvv
Default parameters from /etc/dahdi/genconf_parameters
Generating /etc/dahdi/assigned-spans.conf
cut: '/sys/bus/dahdi_devices/devices/pci:0000:05:05.0/spantype': No such file or directory
Generating /etc/dahdi/system.conf
Generating /etc/asterisk/dahdi-channels.conf

the card is configured with two NT ports and two TE ports, I put the telephone in TE port.

This is the /etc/dahdi/system.conf


# Autogenerated by /usr/sbin/dahdi_genconf on Fri Oct 22 22:07:16 2021
# If you edit this file and execute /usr/sbin/dahdi_genconf again,
# your manual changes will be LOST.
# Dahdi Configuration File
#
# This file is parsed by the Dahdi Configurator, dahdi_cfg
#
# Span 1: B4/0/1 "B4XXP (PCI) Card 0 Span 1" (MASTER) AMI/CCS YELLOW 
span=1,1,0,ccs,ami
# termtype: te
bchan=1-2
hardhdlc=3
echocanceller=mg2,1-2

# Span 2: B4/0/2 "B4XXP (PCI) Card 0 Span 2" AMI/CCS YELLOW 
span=2,2,0,ccs,ami
# termtype: te
bchan=4-5
hardhdlc=6
echocanceller=mg2,4-5

# Span 3: B4/0/3 "B4XXP (PCI) Card 0 Span 3" AMI/CCS YELLOW 
span=3,0,0,ccs,ami
# termtype: nt
bchan=7-8
hardhdlc=9
echocanceller=mg2,7-8

# Span 4: B4/0/4 "B4XXP (PCI) Card 0 Span 4" AMI/CCS RED 
span=4,0,0,ccs,ami
# termtype: nt
bchan=10-11
hardhdlc=12
echocanceller=mg2,10-11

# Global data

loadzone	= it
defaultzone	= it

this is the chan_dahdi.conf


[trunkgroups]
[channels]
language=it
context=public
switchtype=euroisdn
signalling=bri_cpe
usecallerid=yes
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
context= incoming
echocancel=yes
channel => 1,2,4,5,7,8,10,11
echocancelwhenbridged=yes
group=1
callgroup=1
pickupgroup=1

I don’t know if is all fine, dahdi tool report this

DAHDI Telephony Interfaces ├─────────────────────┐
│ │
│ Alarms Span │
│ YEL B4XXP (PCI) Card 0 Span 1 ↑ │
│ YEL B4XXP (PCI) Card 0 Span 2 ▒ │
│ YEL B4XXP (PCI) Card 0 Span 3 ▮ │
│ RED B4XXP (PCI) Card 0 Span 4

and the console report this

virtuale-2CLI> dahdi show status
Description Alarms IRQ bpviol CRC Fra Codi Options LBO
B4XXP (PCI) Card 0 Span 1 YEL 0 0 0 CCS AMI 0 db (CSU)/0-133 feet (DSX-1)
B4XXP (PCI) Card 0 Span 2 YEL 0 0 0 CCS AMI 0 db (CSU)/0-133 feet (DSX-1)
B4XXP (PCI) Card 0 Span 3 YEL 0 0 0 CCS AMI 0 db (CSU)/0-133 feet (DSX-1)
B4XXP (PCI) Card 0 Span 4 RED 0 0 0 CCS AMI 0 db (CSU)/0-133 feet (DSX-1)
virtuale-2
CLI> dahdi show ch
channel channels
virtuale-2*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked In Service Description
pseudo default default Yes
1 from-dahdi it default Yes
2 from-dahdi it default Yes
4 from-dahdi it default Yes
5 from-dahdi it default Yes
7 from-dahdi it default Yes
8 from-dahdi it default Yes
10 from-dahdi it default Yes
11 from-dahdi it default Yes

Is all ok or there is something wrong?

I have few questions.
What is the difference between NT and TE mode? If I want to connect phones or TA to ports is better NT or TE?
How to assign a telephone number to port?

Thanks

That sounds the wrong way round to me; I hope the drivers tolerate shorts. See https://www.patton.com/support/kb_art.asp?art=127&p=122

This looks like an obsolete card, in which case it will be difficult to find help, other than the user manual. Otherwise, you are expected to get help from the vendor.

You assign a number to a port by creating an extension, in extensions.conf, that dials through that port.

Thanks for answer. I put the isdn phone in NT port. but the led is still blinking red, anyway dahdi tool said is yellow


   YEL             B4XXP (PCI) Card 0 Span 3                       ▮  │ 
    YEL             B4XXP (PCI) Card 0 Span 4

for the extensions i put those lines in extensions.conf under the “local” context

exten => 102,1,Dial(DAHDI/1)
exten => 103,1,Dial(DAHDI/2)
exten => 104,1,Dial(DAHDI/3)
exten => 105,1,Dial(DAHDI/4)

exten => 200,1,Answer()
same => n,Playback(hello-world)
same => n,Hangup()

Is correct?

Looks OK to me. As you are implying the hangup for the dial’s, I don’t understand why you make one explicit for the playback.

1 Like

Thanks for answer.
Finally the card is working and after two days of hard work I have a green light

Alarms Span │
│ RED B4XXP (PCI) Card 0 Span 1 ↑ │
│ RED B4XXP (PCI) Card 0 Span 2 ▒ │
│ OK B4XXP (PCI) Card 0 Span 3 ▮ │
│ YEL B4XXP (PCI) Card 0 Span 4

I have connect an old isdn hamlet TA which can also make phone calls) to the port 3, i still have problems with telephone isdn, is a Swatch cordless isdn II, give me “line busy” when i call the 200 extension
I’m a little confusing about the context, in the file chan_dahdi.conf i put

; Context for incoming calls. Defaults to ‘default’
;
context=from-dahdi

is correct?

The context needs to be the context you used in defining your dialplan extensions. Generally you would have different contexts for devices that are permitted to make chargeable calls, from that for those that can’t. The latter is often made the default context, which defaults to default in bare Asterisk. Often you use include to include the latter in the former. Please see the sample configuration file, that comes with the Asterisk source code.

Names are arbitrary as far as Asterisk is concerned, but from-dahdi doesn’t sound sensible. If you were using FreePBX conventions, the NT ports would probably be set to from-internal, and the TE ports to from-pstn, but that assumes you are using it in a standard network topology.

I’ve never used BRI. It was abandoned very early in the UK. However, I believe that you would normally use the public network as a clock source, and slave the clocks to that for your internal devices. I’m not sure how that translates to obsolete Digium hardware (if not obsolete, ask Sangoma), and DAHDI.

1 Like

I have some problems even with green light.
This is my configuration

/etc/dahdi/system.conf

 # Span 1: B4/0/1 "B4XXP (PCI) Card 0 Span 1" AMI/CCS RED 
    span=1,0,0,ccs,ami
    # termtype: nt
    bchan=1-2
    hardhdlc=3
    echocanceller=mg2,1-2
    # Span 2: B4/0/2 "B4XXP (PCI) Card 0 Span 2" AMI/CCS RED 
    span=2,0,0,ccs,ami
    # termtype: nt
    bchan=4-5
    hardhdlc=6
    echocanceller=mg2,4-5
    # Span 3: B4/0/3 "B4XXP (PCI) Card 0 Span 3" AMI/CCS RED 
    span=3,0,0,ccs,ami
    # termtype: nt
    bchan=7-8
    hardhdlc=9
    echocanceller=mg2,7-8
    # Span 4: B4/0/4 "B4XXP (PCI) Card 0 Span 4" (MASTER) AMI/CCS 
    span=4,0,0,ccs,ami
    # termtype: nt
    bchan=10-11
    hardhdlc=12
    echocanceller=mg2,10-11

/etc/asterisk/chan_dahdi.conf

    [trunkgroups]
    [channels]
    language=it
    context=local
    switchtype=euroisdn
    signalling=bri_net_ptmp
    usecallerid=yes
    callwaiting=yes
    usecallingpres=yes
    callwaitingcallerid=yes
    threewaycalling=yes
    transfer=yes
    canpark=yes
    cancallforward=yes
    callreturn=yes
    context= incoming
    echocancel=yes
    channel => 1,2,4,5,7,8,10,11
    echocancelwhenbridged=yes
    group=1
    callgroup=1
    pickupgroup=1

/etc/asterisk/dahdi-channels.conf

 ; Span 1: B4/0/1 "B4XXP (PCI) Card 0 Span 1" AMI/CCS RED 
    group=0,11
    context=from-dahdi
    switchtype = euroisdn
    signalling = bri_net_ptmp
    channel => 1-2
    context = default
    group = 63
    ; Span 2: B4/0/2 "B4XXP (PCI) Card 0 Span 2" AMI/CCS RED 
    group=0,12
    context=from-dahdi
    switchtype = euroisdn
    signalling = bri_net_ptmp
    channel => 4-5
    context = default
    group = 63
    ; Span 3: B4/0/3 "B4XXP (PCI) Card 0 Span 3" AMI/CCS RED 
    group=0,13
    context=from-dahdi
    switchtype = euroisdn
    signalling = bri_net_ptmp
    channel => 7-8
    context = default
    group = 63
    ; Span 4: B4/0/4 "B4XXP (PCI) Card 0 Span 4" (MASTER) AMI/CCS 
    group=0,14
    context=from-dahdi
    switchtype = euroisdn
    signalling = bri_net_ptmp
    channel => 10-11
    context = default
    group = 63

The port with the phone attached is green, so is OK

dahdi_tool said:


    RED             B4XXP (PCI) Card 0 Span 1                       ↑  │ 
                              │     RED             B4XXP (PCI) Card 0 Span 2                       ▒  │ 
                              │     RED             B4XXP (PCI) Card 0 Span 3                       ▮  │ 
                              │     OK              B4XXP (PCI) Card 0 Span 4

From the isdn phone I try to call the 200 test extensions and exit with the isdn error code 3302

this is my extensions.conf part

   exten => 200,1,Answer()
    same => n,Playback(hello-world)
    same => n,Hangup()
    
    exten => 1000,1,Dial(dahdi/4,20)

When i try to call “1000” from console said

 Span 2: Channel 0/1 got hangup, cause 18
    -- Hungup 'DAHDI/i2/-2'
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'ALSA/default' status is 'CHANUNAVAIL'
  << Hangup on console >>

Finally a little progress!

In extensions.conf I use

[from-dahdi]
exten => _XXXXX.,1,Dial(DAHDI/g14/${EXTEN})
exten => _XXXXX.,2,Hangup()

Then I call from console the phone and is ringing
But I still have 3002 if i call from the isdn phone

If someone maybe understand the problem, this is the debug of pri

039991122
    -- Executing [039991122@local:1] Dial("ALSA/default", "DAHDI/g14/039991122") in new stack
PRI Span: 4 -- Making new call for cref 32773
    -- Requested transfer capability: 0x00 - SPEECH
PRI Span: 4 Sending message for call 0x7f0d84008b20 on call->link: 0x782140 with TEI/SAPI 127/63
PRI Span: 4 
PRI Span: 4 > Protocol Discriminator: Q.931 (8)  len=26
PRI Span: 4 > TEI=127 Call Ref: len= 1 (reference 5/0x5) (Sent from originator)
PRI Span: 4 > Message Type: SETUP (5)
PRI Span: 4 > [04 03 80 90 a3]
PRI Span: 4 > Bearer Capability (len= 5) [ Ext: 1  Coding-Std: 0  Info transfer capability: Speech (0)
PRI Span: 4 >                              Ext: 1  Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 4 >                                User information layer 1: A-Law (35)
PRI Span: 4 > [18 01 89]
PRI Span: 4 > Channel ID (len= 3) [ Ext: 1  IntID: Implicit  BRI  Spare: 0  Exclusive  Dchan: 0
PRI Span: 4 >                       ChanSel: B1 channel
PRI Span: 4 >                     ]
PRI Span: 4 > [70 0b 80 30 37 38 34 33 36 36 35 30 38]
PRI Span: 4 > Called Party Number (len=13) [ Ext: 1  TON: Unknown Number Type (0)  NPI: Unknown Number Plan (0)  '039991122' ]
PRI Span: 4 > [a1]
PRI Span: 4 > Sending Complete (len= 1)
PRI Span: 4 q931.c:6531 q931_setup: Call 32773 enters state 1 (Call Initiated).  Hold state: Idle
    -- Called DAHDI/g14/039991122
PRI Span: 4 T303 timed out.  cref:32773
PRI Span: 4 Sending message for call 0x7f0d84008b20 on call->link: 0x782140 with TEI/SAPI 127/63
PRI Span: 4 
PRI Span: 4 > Protocol Discriminator: Q.931 (8)  len=26
PRI Span: 4 > TEI=127 Call Ref: len= 1 (reference 5/0x5) (Sent from originator)
PRI Span: 4 > Message Type: SETUP (5)
PRI Span: 4 > [04 03 80 90 a3]
PRI Span: 4 > Bearer Capability (len= 5) [ Ext: 1  Coding-Std: 0  Info transfer capability: Speech (0)
PRI Span: 4 >                              Ext: 1  Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 4 >                                User information layer 1: A-Law (35)
PRI Span: 4 > [18 01 89]
PRI Span: 4 > Channel ID (len= 3) [ Ext: 1  IntID: Implicit  BRI  Spare: 0  Exclusive  Dchan: 0
PRI Span: 4 >                       ChanSel: B1 channel
PRI Span: 4 >                     ]
PRI Span: 4 > [70 0b 80 30 37 38 34 33 36 36 35 30 38]
PRI Span: 4 > Called Party Number (len=13) [ Ext: 1  TON: Unknown Number Type (0)  NPI: Unknown Number Plan (0)  '039991122' ]
PRI Span: 4 > [a1]
PRI Span: 4 > Sending Complete (len= 1)
PRI Span: 4 T303 timed out.  cref:32773
PRI Span: 4 q931.c:6415 t303_expiry: Call 32773 enters state 22 (Call Abort).  Hold state: Idle
PRI Span: 4 Fake clearing.  cref:32773
PRI Span: 4 q931.c:9910 pri_internal_clear: alive 1, hangupack 1
Span 4: Processing event PRI_EVENT_HANGUP(6)
    -- Span 4: Channel 0/1 got hangup, cause 18
PRI Span: 4 q931.c:7270 q931_hangup: Hangup master cref:32773
PRI Span: 4 q931.c:7312 q931_hangup: Remaining slaves 0
    -- Hungup 'DAHDI/i4/039991122-5'
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [039991122@local:2] Hangup("ALSA/default", "") in new stack
  == Spawn extension (local, 039991122, 2) exited non-zero on 'ALSA/default'
  << Hangup on console >> 
PRI Span: 4 T312 timed out.  cref:32773
PRI Span: 4 Destroying call 0x7f0d84008b20, ourstate Call Abort, peerstate Call Present, hold-state Idle

I have tried to change the signalling from bri_net_ptmp to other values(bri_net, bri) but then asterisk refuse to start the span

I don’t have the detailed knowledge of BRI or DAHDI to help you any further. Normally you would be expected to get support on configuring the card from Sangoma, but I think you are using a second hand, and possibly end of life, card, so that support probably isn’t available to you, but you should probably ask.

Also the questions you asked about contexts suggest, to me, that you do not have a basic understanding of Asterisk. Taking on anything but simple SIP systems or analogue phones, is not advisable without that knowledge. Those two cases are sufficiently frequently used that there is a lot of material on the net (although much of it is of very poor quality, at least for SIP), and there are lots of people with the experience to help on peer support forums.

1 Like

I know, i’m a newbie of asterisk, voip, etc I only try to learn because I like to learn(btw isdn is not more active in my country, but i like the retro-technologies)

Another question: the incoming call to isdn phone are “working” because the phone ring(even if fail when answer, but this is another problem), the outgoing calling from isdn phone to other numbers(500, 200, etc) are not reported by pri debug, what I miss?
This is extensions.conf

[from-dahdi]
exten => _XXXXX.,1,Dial(DAHDI/g14/${EXTEN})
exten => _XXXXX.,2,Hangup()

Some progress.
After setting 100 ohm terminator ON in card, finally my isdn phone is ringing and I answer for the first time!
I have only some problem with the other phone(is a soft-phone) because it put the +039 for every call.

Finally I have solved the first 50% of problem

Reading from this howto https://bach-online.de/make-internet-calls-with-a-real-isdn-phone/ i modify my /etc/asterisk/chan_dahdi.conf adding/modify those lines.


overlapdial=yes
immediate=no

Now from the isdn phone I can call the sip phone and finally the internal extensions answer, this is the extensions.conf

[from-dahdi]
include => local
exten => 1796522,1,Dial(DAHDI/g12/${EXTEN})
exten => 1796522,2,Hangup()

exten => s,1,Answer()
exten => s,2,Dial(Local/${EXTEN},10,t,m)
exten => s,4,Hangup()

[local]
include => from-dahdi

exten => 1001,1,Dial(SIP/telefono1,20,Ttm)
same  => n,Hangup

exten => 7500,1,VoicemailMain(@mycontext)

exten => 600,1,Answer()
exten => 600,2,Playback(demo-echotest) ; Let them know what
exten => 600,3,Echo()                  ; Do the echo test
exten => 600,4,Playback(demo-echodone) ; Let them know it
exten => 600,5,Hangup()

I still have the problem of the isdn-ta adapter (can receive the answer, but cannot call)
but problably is hw problem, hw misconfigured, os misconfigured

I have a doubt, the isdn TA usually use the CAPI driver, I know asterisk support capi but I cannot find a updated chan_capi from git which compile with the asterisk 16 serie.
Maybe using CAPI the TA “phone” will work?

Using core set debug 100 I see this new error message


[Oct 28 18:59:44] PRI Span: 1 TEI=64 MDL-ERROR (I): T200 expired N200 times sending RR/RNR in state 8(Timer recovery)

What can be?

Another error using the isdn diagnostic program from Windows

[Oct 28 19:41:15] PRI Span: 1 Could not find a layer 2 link for received frame with SAPI/TEI of 0/127.

Finally solution found! Was a problem of usb redirection(the Windows softphone is in a virtual machine), before I redirect the usb using “usb-redirection” of Libvirt and works very bad(can receive…but no answer), now I put an usb pci-e controller/adapter, redirect the entire card to guest, connect the usb-ta and voilà…

Istantanea_2021-10-30_21-55-38

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.