• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

4.2.3. Asterisk and AVM B1 BRI card - Howto

1. Introduction

The AVM B1 PCI card is an ISDN controller for ISDN Basic Rate Interface (BRI), which support the Novell CAPI Manager interface. It supports all of the features provided by the BRI. The AVM B1 supports various D channel protocols such as DSS1 [EURO-ISDN], NI-1, 5ESS, and 1TR6.

In this tutorial we are going to show you how to set up your Asterisk server to work with this card on Debian GNU/Linux, under the CAPI channel

 


2. Preparations, Installation and Configuration

As we already mentioned you will need a Debian Linux distribution

We assume that you already have an installed and running Asterisk.

However, if you do not have it or do not know how to do it, we have a tutorial which could guide through the whole process of how to obtain, compile and start a working Asterisk PBX.

You could start from the basic - here and then you could continue with the configuration files, applications and functions.

Now, let's continue with the AVM B1 card. The best thing about it is that the drivers are coming with the Linux kernel (2.6.15.1 or higher). However, It will not hurt if you check, whether do you actually have them.

The quickest way is to check into your drivers directory. There you should have the isdn/hardware/avm/ subdirectories.

$ cd /lib/modules/`uname -r`/kernel/drivers/
$ ls -la
$ cd isdn/hardware/avm/
$ ls

The files, you are looking for are called b1.ko and b1.pci.ko.

Ok, now we know that the drivers are here - it is time to get the CAPI channel installed and working.
In order to install successfully the chan_capi module, we will need some extra packages.

The first one of them is the capiutils package. It's available in the current Debian Stable version, which now is 3.1. In some Debian testing versions it is missing. If this is your case you will need to make a small change into your source.list (this is the file where you specify the sources, where your apt program to search for packages).

The change is to add one line into this file. It is placed in the /etc/apt/ directory. The line you have to add, in our case is:
deb http://ftp.belnet.be/debian/ stable main contrib non-free. However in your case could be different - you could change http://ftp.belnet.be/ with the closest Debian mirror site to your location.
The whole operation:

# cd /etc/apt/
# vim source.list


Add - deb http://ftp.belnet.be/debian/ stable main contrib non-free

Now you are ready to obtain the package - just perform the following command:

# apt-get install capiutils


We need this package because its purpose is to load the cards drivers (remember the b1.ko and b1.pci.ko) and the card firmware.

As we mention firmware - the card firmware is required. You have to download it. It is available at the following web address:

ftp://ftp.in-berlin.de/pub/capi4linux/firmware/b1/

Get the latest version of the b1.t4 file and put it in the /usr/share/isdn directory (you might need to create
that one first).
In order to perform that job, you could use the following commands:

# mkdir -p /usr/share/isdn
# cd /usr/share/isdn && wget ftp://ftp.in-berlin.de/pub/capi4linux/firmware/b1/3-11-03/b1.t4

One final package to obtain before downloading and install the chan_capi module - we will need the libcapi20-dev package. It is required by the chan_capi. If you do not have this file you will not be able to compile successfully the CAPI channel. So it is crucial and in order to get it use the following command:

# apt-get install libcapi20-dev

At that point the drivers of your AVM card should be started automatically.

If they are not, you will have to take a look
at the capi.conf file, placed in the /etc/isdn/ directory.

# cd /etc/isdn/
# vim capi.conf

What you are looking for, is something like the following on the picture below:

capi.conf.jpg

Now, we are ready for the chan_capi module. The latest chan_capi source could be obtained from:

http://sourceforge.net/projects/chan-capi/

Put the package in your /usr/src directory. Unpack it by using the following command:

# tar -xvzf chan_capi-cm-0.6.4.tar.gz

Now the installation - in order to install the chan_capi module use the following commands:

# cd /usr/src/chan_capi-cm-0.6.4
# make
# make install
# make install_config

Congratulations, you have the chan_capi module installed.

 


3. Configurations considering the Asterisk

We already have working BRI card and installed chan_capi module. The next step is to make it work with our Asterisk PBX.

First, check in the modules.conf file, placed in the /etc/asterisk/ directory, whether do you have the following lines:

load => chan_capi.so

and in the [global] section:

chan_capi.so=yes

If they do not exist, you have to add them manually

The second configuration file, where you have to make configurations capi.conf file, placed in the /et/asterisk/ directory.

# cd /etc/asterisk/
# vim capi.conf

There is a sample configuration file in the chan_capi package, which you could copy into your /etc/asterisk directory.

However, if you execute the make install_config as shown above then the system will do this automatically.

The sample capi.conf configuration file looks like the following:

 
;
; CAPI config
;
;

; general section

[general]
nationalprefix=0
internationalprefix=00
rxgain=0.8
txgain=0.8
language=de            ;set default language
;ulaw=yes                 ;set this, if you live in u-law world instead of a-law

; interface sections ...

[ISDN1]                   ;this example interface gets name 'ISDN1' and may be any
                              ;name not starting with 'g' or 'contr'.
;ntmode=yes           ;if isdn card operates in nt mode, set this to yes
isdnmode=msn        ;'MSN' (point-to-multipoint) or 'DID' (direct inward dial)
                              ;when using NT-mode, 'DID' should be set in any case
incomingmsn=*        ;allow incoming calls to this list of MSNs/DIDs, * = any
;defaultcid=123        ;set a default caller id to that interface for dial-out,
                              ;this caller id will be used when dial option 'd' is set.
;controller=0            ;ISDN4BSD default
;controller=7            ;ISDN4BSD USB default
controller=1             ;capi controller number to use
group=1                  ;dialout group
;prefix=0                 ;set a prefix to calling number on incoming calls
softdtmf=on            ;enable/disable software dtmf detection, recommended for AVM cards
relaxdtmf=on          ;in addition to softdtmf, you can use relaxed dtmf detection
accountcode=          ;Asterisk accountcode to use in CDRs
context=capi-in        ;context for incoming calls
;holdtype=hold        ;when Asterisk puts the call on hold, ISDN HOLD will be used. If
                             ;set to 'local' (default value), no hold is done and Asterisk may
                             ;play MOH.
;immediate=yes      ;DID: immediate start of pbx with extension 's' if no digits were
                             ;     received on incoming call (no destination number yet)
                             ;MSN: start pbx on CONNECT_IND and don't wait for SETUP/SENDING-COMPLETE.
                             ;     info like REDIRECTINGNUMBER may be lost, but this is necessary for
                             ;     drivers/pbx/telco which does not send SETUP or SENDING-COMPLETE.
;echosquelch=1       ;_VERY_PRIMITIVE_ echo suppression
;echocancel=yes      ;EICON DIVA SERVER (CAPI) echo cancelation
                             ;(possible values: 'no', 'yes', 'force', 'g164', 'g165')
echocancelold=yes   ;use facility selector 6 instead of correct 8 (necessary for older eicon drivers)
;echotail=64            ;echo cancel tail setting
;bridge=yes            ;native bridging (CAPI line interconnect) if available
;callgroup=1           ;Asterisk call group
;language=de         ;set language for this device (overwrites default language)
devices=2              ;number of concurrent calls on this controller
                            ;(2 makes sense for single BRI, 30 for PRI)
 

This configuration of the file is made for a BRI line in point-to-multipoint TE mode. If you are now familiar with this terms please read the following tutorial

The third file to configure depends on the protocol you are going to use - IAX2, SIP, MGCP. In our case we will use our softphone Idefisk, which use the IAX2 protocol. You could download it from here. Please, take a look also at our tutorial - to learn how to configure it to work with Asterisk PBX.

We need one registered user in the iax.conf file (we are going to use the IAX2 protocol). If you want to use other protocol such as SIP or MGCP, you have to do the configurations below respectively in the sip.conf or mgcp.conf.

iax.conf.jpg

So, we have registered the user idefisk

Type=friend means that this user is allowed to make and receive calls. Host=dynamic means that the IP is not statically assigned but dynamically through DHCP server. Allow=all means that the line, which this user will use, could support all audio codecs. Context=test - this shows that the user will be allowed to work only with the extensions in this context in the configuration file extensions.conf.


Our capi.conf

capi.conf.jpg

extensions.conf Configurations

Now lets take a look at the extensions.conf file.

extensions.conf.jpg

On the picture above you could see our test extensions.conf file.

As you could see on the screenshot of our capi.conf - the context where the incoming calls will be handled is capi-in. So we will make a context with this name and we will configure the following extension:

exten => 555555,1,GoTo(test,555,1)

So when somebody dial 555555 (this is our ISDN number) he/she will be directed to our test context and attached to the internal number 555. All this will be provided by the GoTo application.

The 555 number will be attached to the Idefisk user through the IAX2 protocol used with the Idefisk softphone. For the purpose we will use the Dial application with arguments - IAX2/idefisk.

Now the incoming calls are handled, but what about the outgoing?
Well, in order to make outgoing calls using the CAPI channel there are three different ways to do this. The syntaxes are:

Dial(CAPI/g<group>/[<callerid>:]<destination>[/<params>])
Dial(CAPI/contr<controller>/[<callerid>:]<destination>[/<params>])
Dial(CAPI/<interface-name>/[<callerid>:]<destination>[/<params>])

In our case we will use the last one with the interface-name. As you could see in the screenshot above, our interface section has the name ISDN1. So we will use this name to dial out:

exten => _9X.,1,Dial(CAPI/ISDN1/${EXTEN:1}/b,30)

In this way our user will be able to make outgoing calls by dialing 9 in front of the number.

Finally, in order to be sure that the Asterisk PBX will hang up the line, when the conversation is over, it is a good idea to make an extension for hanging up the line using the Hangup application.


 


4. Additional information

More information about the extensions.conf file you could find here.
For more information about the iax.conf file, check here.

The application is tested with our IAX softphone Idefisk. You could download it from here. A manual about this softphone could be found here.

If you would like to test the application with the SIP channel you could take a look at our tutorials about the SIP Softphones, where you could pick up the one which suits your needs and learn how to configure it to work with the Asterisk PBX

 


5. Uploaded files

iax.conf
extensions.conf
capi.conf
b1.t4
chan_capi-cm-0.6.4.tar.gz
INSTALL - chan_capi.txt
README - chan_capi.txt

 


6. References

The official page of the AVM
The CAPI page
The CAPI channel download
The page with the AVM firmwares
Very good page with information about the isdn4linux
The Asterisk Official Page

 

 
User Comments
prescription for viagra online (niki dot bou95 at lm360 dot us)
17 September 2020 02:51:25
prescription for viagra online https://mymvrc.org/
Alex (ac at it-cell dot com)
11 January 2008 11:26:07
I was wondering if i could install 2 X AVM B1 controllers to an Asterisk server. Should there be a problem? Generally can more than 1 avm b1 controllers work in an asterisk server?

Thanks
Thomas (te at te-consult dot dk)
14 September 2007 08:33:41
Thanks for a great tutorial - it helped me quite a bit. However, I am stuck at capiinfo - it doesn't give any output.

I am running debian on a 2.6.21-2-686 kernel with the capi modules, and I have a BT AVM Fritz pci card. In dmesg it looks like the capi drivers are loading:

------
capifs: Rev 1.1.2.3
CAPI Subsystem Rev 1.1.2.8
capi20: Rev 1.1.2.7: started up with major 68 (middleware+capifs)
b1: revision 1.1.2.2
b1dma: revision 1.1.2.3
b1pci: revision 1.1.2.2
------

and again a little further down:

------
capi: Rev 1.1.2.7: unloaded
CAPI Subsystem Rev 1.1.2.8
capi20: Rev 1.1.2.7: started up with major 68 (middleware+capifs)
b1: revision 1.1.2.2
b1dma: revision 1.1.2.3
b1pci: revision 1.1.2.2
------

However, neither 'capiinit start/init/reload' nor 'capiinfo' gives me any output. It is as if the device is not in /dev/ though I have a '/dev/capi20' and a '/dev/capi' directory (which is empty).

Does anyone have any hints I can use?

Thanks a lot,

Thomas

GabbyForrest (GabbyForrest at yahoo dot com)
05 March 2007 17:17:11
Hello there
I think I'm almost done but still does not work ...
I'm trying to use a AVM B1 PCI v4.0 on CentOS 4.4 and Asterisk 1.2
Following Tommy's instructions above here is where I am

- downloaded capi4k-utils
- did make menuconfig and browsed to my kernel sources
- left the menu and everything started
- did make and make install
- there was NO /etc/capi.conf (as someone else reported above!) so I created one and entered the following text:

b1pci /usr/share/isdn/b1.t4 DSS1 - - - -

- downloaded the firmware for the B1 PCI card in /usr/share/isdn/b1.t4
- gone to the scripts directory and started makedev.sh
- started capiinit
- run capiinfo

Number of Controllers : 1
Controller 1:
Manufacturer: AVM GmbH
CAPI Version: 2.0
Manufacturer Version: 3.11-03 (49.19)
Serial Number: 3905499
BChannels: 2
Global Options: 0x00000039
internal controller supported
DTMF supported
Supplementary Services supported
channel allocation supported (leased lines)
B1 protocols support: 0x4000001f
64 kbit/s with HDLC framing
64 kbit/s bit-transparent operation
V.110 asynconous operation with start/stop byte framing
V.110 synconous operation with HDLC framing
T.30 modem for fax group 3
B2 protocols support: 0x00000b1b
ISO 7776 (X.75 SLP)
Transparent
LAPD with Q.921 for D channel X.25 (SAPI 16)
T.30 for fax group 3
ISO 7776 (X.75 SLP) with V.42bis compression
V.120 asyncronous mode
V.120 bit-transparent mode
B3 protocols support: 0x8000003f
Transparent
T.90NL, T.70NL, T.90
ISO 8208 (X.25 DTE-DTE)
X.25 DCE
T.30 for fax group 3
T.30 for fax group 3 with extensions

0100
0200
39000000
1f000040
1b0b0000
3f000080
00000000 00000000 00000000 00000000 00000000 00000000
01000001 00020000 00000000 00000000 00000000

Supplementary services support: 0x000003ff
Hold / Retrieve
Terminal Portability
ECT
3PTY
Call Forwarding
Call Deflection
MCID
CCBS

- edited /etc/asterisk/capi.info
- started Asterisk

linux*CLI> capi info
Contr1: 2 B channels total, 2 B channels free.

linux*CLI> capi show channels
CAPI B-channel information:
Line-Name NTmode state i/o bproto isdnstate ton number
----------------------------------------------------------------
ISDN1#02 no ----- - trans 0x00 ''->''
ISDN1#01 no ----- - trans 0x00 ''->''

linux*CLI> capi debug

- trying to ring in, I get unavailable and no trace on Asterisk
- Trying to dial out I get

-- CAPI queue frame: [ TYPE: Control (4) SUBCLASS: Hangup (1) ] [ISDN1#02]

- the status of the channel changes though

linux*CLI> capi show channels
CAPI B-channel information:
Line-Name NTmode state i/o bproto isdnstate ton number
----------------------------------------------------------------
ISDN1#02 no Disc - trans 0x00 ''->'' B3q=0
ISDN1#01 no ----- - trans 0x00 ''->'' B3q=0

- tried all combinations in /etc/asterisk/capi.conf with no result:
ntmode=yes/no
isdnmode=did/msn

- also on reboot capi disappears and have to reload it. How can I put it in startup?

Any help will be very much appreciated
Thanks
Gabby
Weiss (rv dot weiss at gmail dot com)
05 February 2007 11:10:03
Hello,

We are french student and to validate our diploma we have to make one
project. Our project is about Asterisk 1.4.0 and ISDN channel, we have an
AVM Fritz USB isdn modem. Maybe do you know how to configure asterisk to
make a call to a SIP phone from an Analog phone.
We have search a lot on the net but all of the solution that we have found
doesn't work ... We are a litle bit deperate at this time.

I hope that you can help us.

Best Regards

Herve Weiss
George (georgik at kiselov dot com)
17 January 2007 01:21:34
Yes, I did
download fcpci*.src.rpm from source CentOS, the aplay patches from archive and compile the fcpci
Alex (info at ac-edv dot de)
05 January 2007 21:06:00
i tried to install two AVM b1 PCI Cards. Although lspci shows me 2 cards, capiinfo finds only one card.
With my 2 old B1 ISA cards i have no problems at all.
Do you habe any idea?

Thx

Alex
vasilios Tzanoudakis (vtzan at citiwave dot net)
24 September 2006 16:41:22
I also need help installing AVM Fritz PCI V2.0. this card needs fcpci module ONLY! i tried and read too many docs and howtos. nothing worked at all. I have tried trixbox(CentOS) and Slackware 10.2.
Fips (philipp at phsvideo dot com)
16 April 2006 23:38:20
I also need help to install Fritz AVM card on a CentOS (asterisk@home 2.7). maybe in german. i have no linux skills.
thanks
Carlos (librettista at hotmail dot com)
23 March 2006 06:47:51
Has anyone installed an Fritz AVM card on a Centos system ? (asterisk@home)
Thanks
 
Add Comment
Name:
Email:
Comment:
In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • https://donde-ver-ant-man-y-la-avispa-qu...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-scream-6-tyt.statuspag...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-guardianes-de-la-noche...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-demon-slayer-villa-de-...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://www.reddit.com/r/BenavidezvPlant...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™