[Asterisk-Users] Help sought: AVM C4

Michael J. Tubby G8TIC mike.tubby at thorcom.co.uk
Sun May 29 15:56:09 MST 2005


All,

I'm trying to set up Asterisk with an AVM C4 ISDN card, I've got stuck very 
early on -- I'm usually pretty good at this stuff but why is the 
documentation for Asterisk/CAPI/ISDN/Fedora so bad (almost non-existent)?

I have the following:

- Hardware: P3 3.2GHz, 1Gb PC3200 RAM, Intel S865WP1E mobo, Digium TDM400P 
and AVM C4 Controller

- Software Fedora Core 3 (all yum updates including to doday), Asterisk 
1.0.7, Zaptel 1.0.7, Chan_capi 0.3.5


I have made Zaptel and Asterisk-1.0.7 - asterisk is okay - it works with my 
Cisco 7960 phones internally and in my VOIP wide area number plan to 
friends, etc.

I have done nothing with the TDM400P yet other than test I can load zaptel 
and the card driver -- which I can.

I have the C4 controller installed and I want to get CAPI up and working.

I have a /etc/capi.conf with the following in it:

card     file   proto io    irq mem  cardnr options
b1isa     b1.t4  DSS1  0x150 7   -    -      P2P
b1pci     b1.t4  DSS1  -     -   -    -
c4        c4.bin DSS1  -     -   -    -
c4        -      DSS1  -     -   -    -
c4        -      DSS1  -     -   -    -      P2P
c4        -      DSS1  -     -   -    -      P2P
t1isa     t1.t4  DSS1  0x340 9   -    0
t1pci     t1.t4  DSS1  -     -   -    -
fcpci     -      -     -     -   -    -
fcclassic -      -     0x300 5   -    -


I have the C4's firmware in /usr/lib/isdn.  If I do:

    modprobe c4
    modprobe capi

I get the following in /var/log/messages:

    May 29 22:11:29 pabx kernel: capifs: Rev 1.1.2.3
    May 29 22:11:29 pabx kernel: capi20: Rev 1.1.2.7: started up with major 
68 (middleware+capifs)
    May 29 22:12:04 pabx kernel: capi: Rev 1.1.2.7: unloaded
    May 29 22:12:14 pabx kernel: CAPI Subsystem Rev 1.1.2.8
    May 29 22:12:14 pabx kernel: b1: revision 1.1.2.2
    May 29 22:12:14 pabx kernel: ACPI: PCI interrupt 0000:03:01.0[A] -> GSI 
22 (level, low) -> IRQ 177
    May 29 22:12:14 pabx kernel: c4: PCI BIOS reports AVM-C4 at i/o 0xbc00, 
irq 177, mem 0xfeafec00
    May 29 22:12:14 pabx kernel: kcapi: Controller 1: c4-bc00 attached
    May 29 22:12:14 pabx kernel: kcapi: Controller 2: c4-bc00 attached
    May 29 22:12:14 pabx kernel: kcapi: Controller 3: c4-bc00 attached
    May 29 22:12:14 pabx kernel: kcapi: Controller 4: c4-bc00 attached
    May 29 22:12:14 pabx kernel: c4: AVM C4 at i/o 0xbc00, irq 177, mem 
0xfeafec00
    May 29 22:12:14 pabx kernel: c4: revision 1.1.2.2
    May 29 22:12:25 pabx kernel: capi20: Rev 1.1.2.7: started up with major 
68 (middleware+capifs)


I've made the chan_capi code, okay I know about the file-descriptor patch 
for BSD and Linux kernel >= 2.6.11 and have applied it, ie. this:

      p = malloc(sizeof(struct capi_pipe));
      memset(p, 0, sizeof(struct capi_pipe));
      p->fd = fds[1];
-     c->fds[0] = fds[1];
+     c->fds[0] = fds[0];
      p->PLCI = -1;
      p->i = i;
      p->c = c;


I have the default /etc/asterisk/capi.conf which should let the chan_capi.so 
shared library load even though it will be the wrong config for my site.

My /etc/asterisk/modules.conf looks like this:

    ;
    ; Asterisk configuration file
    ;
    ; Module Loader configuration file
    ;

    [modules]
    autoload=yes
    ;
    ; If you want, load the GTK console right away.
    ; Don't load the KDE console since
    ; it's not as sophisticated right now.
    ;
    noload => pbx_gtkconsole.so
    ;load => pbx_gtkconsole.so
    noload => pbx_kdeconsole.so
    ;
    ; Intercom application is obsoleted by
    ; chan_oss.  Don't load it.
    ;
    noload => app_intercom.so
    ;
    ; Explicitly load the chan_modem.so early on to be sure
    ; it loads before any of the chan_modem_* 's afte rit
    ;
    load => chan_modem.so
    load => res_musiconhold.so
    ;
    ; Load either OSS or ALSA, not both
    ; By default, load OSS only (automatically) and do not load ALSA
    ;
    noload => chan_alsa.so
    ;noload => chan_oss.so

    ;
    ; CAPI
    ;
    load => res_features.so
    load => chan_capi.so

    ;
    ; Module names listed in "global" section will have symbols globally
    ; exported to modules loaded after them.
    ;
    [global]
    chan_modem.so=yes
    chan_capi.so=yes



When I start asterisk:

   asterisk -vvvgc

I get this:

 [chan_capi.so] => (Common ISDN API for Asterisk)
  == Parsing '/etc/asterisk/capi.conf': Found
May 29 23:04:32 NOTICE[23261]: chan_capi.c:2636 load_module: CAPI not 
installed!
May 29 23:04:32 WARNING[23261]: loader.c:345 ast_load_resource: 
chan_capi.so: load_module failed, returning -1
May 29 23:04:32 WARNING[23261]: chan_capi.c:2812 unload_module: Unable to 
unregister from CAPI!
  == Unregistered channel type 'CAPI'
May 29 23:04:32 WARNING[23261]: loader.c:391 load_modules: Loading module 
chan_capi.so failed!
[root at pabx asterisk]# Warning, flexibel rate not heavily tested!
Ouch ... error while writing audio data: : Broken pipe


What am I missing or doing wrong?  Do I need to use /sbin/capiinit -- it is 
not clear?  If I try then I always get:

    [root at pabx asterisk]# capiinit
    ERROR: cannot load module kernelcapi
    [root at pabx asterisk]#

whether I have the modules already loaded or not...


I've even done the research on CAPI and FC3 with the device naming under 
udev and used the "fix it" script provided here:

    http://www.friendglow.net/en/faq/faq_kernel26_udev_en.shtml

to no avail (but I did have to change the ownership of the devices from 
"root.dialout" to "root.tty" because my FC3 has no group called "dialout" --  
so I picked something approximate/close as a guess...


Can anyone give me some advice on what to do next to get it all going?


Regards


Mike





More information about the asterisk-users mailing list