Using mISDN+CAPI with asterisk on RasperryPI

Jan Neuhäußer <[email protected]> Sun, 17 Sep 2017 21:04:29 +0200
Newsgroups gmane.linux.isdn.i4l.user
Message-ID <2080001.LD3PkYKcMO@tobi15>
Hi,

some weeks ago I followed a discussion on this list ("Using mISDN with recent asterisk and Debian") that encouraged me trying to get asterisk working on a raspberrypi together with mISDN, CAPI and chan_capi.

While capiinfo seems to report success (see below), asterisk gives me the following messages on startup:

[2017-09-17 18:55:19] VERBOSE[1822] loader.c: Loading chan_capi.so.
[2017-09-17 18:55:19] VERBOSE[1822] config.c: Parsing '/etc/asterisk/capi.conf': Found
[2017-09-17 18:55:19] WARNING[1822] chan_capi.c: CAPI not installed, chan_capi disabled!
[2017-09-17 18:55:19] VERBOSE[1822] loader.c: chan_capi.so => (Common ISDN API Driver ($Revision: 963 $))


Has anyone on this list an idea what might have gone wrong?

Btw. there is no device /dev/capi*, but I thought this not needed anymore with mISDN V2?


Any help is appreciated, please have a look at the info below.

Cheers Jan



This is what I have done:

- Installed RASPBX on the raspberrypi, it comes with asterisk 13.15.0 (after upgrade of the distro).
- compiled mISDN, libcapi and capiinfo from isdn4k-utils (https://github.com/b1-systems/mISDN.git + mISDNuser.git)
- compiled chan_capi (tp://ftp.chan-capi.org/chan-capi)

I followed the hints on:

https://www.misdn.eu/wiki/Howto_for_Debian/
https://www.misdn.eu/wiki/Capi/
http://www.melware.org/ChanCapi


Here is some information about the system:


capiinfo:

root@raspbx:/var/log/asterisk# capiinfo
            capi20.c: 164              CapiDebug():[capi20_isinstalled]: standard loop - module: standard
            capi20.c: 164              CapiDebug():[capi20_isinstalled]: capi_fd: -1
            capi20.c: 164              CapiDebug():[capi20_isinstalled]: standard loop - module: misdn
            capi20.c: 164              CapiDebug():[capi20_isinstalled]: other loop - module: standard
            capi20.c: 164              CapiDebug():[capi20_isinstalled]: other loop - module: misdn
            capi20.c: 164              CapiDebug():[capi20_isinstalled]: capi_fd: 4
Number of Controllers : 1
Controller 1:
Manufacturer: mISDN
CAPI Version: 2.0
Manufacturer Version: 0.1
Serial Number: 0000001
BChannels: 2
Global Options: 0x00000009
   internal controller supported
   DTMF supported
B1 protocols support: 0x00000003
   64 kbit/s with HDLC framing
   64 kbit/s bit-transparent operation
B2 protocols support: 0x00000003
   ISO 7776 (X.75 SLP)
   Transparent
B3 protocols support: 0x00000001
   Transparent

  0100
  0200
  09000000
  03000000
  03000000
  01000000
  00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000

Supplementary services support: 0x00000000


mISDN modules (I use an usb isdn adaptor from x-tensions, said to be supported by hfcsusb):

root@raspbx:/var/log/asterisk# lsmod | grep mISDN
mISDN_dsp_oslec         6264  0 
mISDN_dsp             205391  1 mISDN_dsp_oslec
mISDN_core             98372  2 hfcsusb,mISDN_dsp

root@raspbx:/usr/local/src/isdn4k-utils/capi20# lsusb
Bus 001 Device 004: ID 1ae7:0525 X-TENSIONS 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


mISDNcapid is running and the socket exists:

oot@raspbx:/var/log/asterisk# mISDNcapid
Sep 17 19:04:44.917785 I             daemon.c:2238                   main(02385):Init mISDN lib version 20005, debug = 0 (0)
Sep 17 19:04:44.919870 I             daemon.c:2250                   main(02385):Did set eGID to dialout gid:20
Sep 17 19:04:44.919957 I          mc_buffer.c:  40         mc_buffer_init(02385):Setup mc buffer MI_MCBUFFER_DEBUG
debug=0x13 do_daemon=1 config=/etc/capi20.conf

root@raspbx:/var/log/asterisk# ps wwwaux | grep mISDNcapid
root      2386  0.0  0.0   3252   188 ?        Ss   19:04   0:00 mISDNcapid
root      2440  0.0  0.1   4292  1884 pts/1    S+   19:06   0:00 grep mISDNcapid

root@raspbx:/var/log/asterisk# ls -l /var/run/mISDNcapid
insgesamt 0
srw-rw---- 1 root dialout 0 Sep 17 19:04 sock


These are the configs:

root@raspbx:/var/log/asterisk# cat /etc/capi20.conf
debugmask 0x13  - example default debuglevel
mISDN 0 1 1  - first mISDN device is mapped to CAPI20 controller 1 and enabled
#mISDN 1 2 0  - second mISDN device is disabled for CAPI20


root@raspbx:/var/log/asterisk# cat /etc/asterisk/capi.conf
;
; CAPI config
;
;

; general section

[general]

language=de      ;set default language

nationalprefix=0       
internationalprefix=049

rxgain=0.8       ;linear receive gain (1.0 = no change)
txgain=0.8       ;linear transmit gain (1.0 = no change)


; interface sections ...


[ISDN1]          ;this example interface gets name 'ISDN1' and may be any
                 ;name not starting with 'g' or 'contr'.
                 ;Use one interface section for each ISDN port!

isdnmode=MSN     ;'MSN' (point-to-multipoint) or 'DID' (direct inward dial)

incomingmsn=*    ;allow incoming calls to this list of MSNs/DIDs, * = any

controller=1     ;CAPI controller number of this interface/port

softdtmf=on      ;enable/disable software DTMF detection, recommended for AVM cards

context=isdn-in  ;context for incoming calls

devices=2        ;number of concurrent calls (B-Channels) on this controller
                 ;(2 makes sense for single BRI, 30/23 for PRI/T1)


Unloading and loading chan_capi.so:

root@raspbx:/var/log/asterisk# asterisk -rvvv
Asterisk 13.15.0, Copyright (C) 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 13.15.0 currently running on raspbx (pid = 1822)
raspbx*CLI> module unload chan_capi.so
Unloaded chan_capi.so
 Unloading chan_capi.so
[2017-09-17 19:28:39] ERROR[2875]: astobj2.c:131 INTERNAL_OBJ: FRACK!, Failed assertion bad magic number 0x0 for object 0x710730d0 (0)
Got 0 backtrace records
raspbx*CLI> module load chan_capi.so
Loaded chan_capi.so
  == Parsing '/etc/asterisk/capi.conf': Found
[2017-09-17 19:29:06] WARNING[2875]: chan_capi.c:8751 cc_init_capi: CAPI not installed, chan_capi disabled!
 Loaded chan_capi.so => (Common ISDN API Driver ($Revision: 963 $))


The system itself:

root@raspbx:~# uname -a
Linux raspbx 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux