[Asterisk-Users] Mandrake & CAPI

Craig Guy cguy at bigpond.net.au
Sun Feb 20 16:57:27 MST 2005


Or you could go to a 2.6 kernel and use the mISDN drivers.

Craig

----- Original Message ----- 
From: "Razza" <rjames31 at btopenworld.com>
To: <asterisk-users at lists.digium.com>
Sent: Sunday, February 20, 2005 8:00 PM
Subject: [Asterisk-Users] Mandrake & CAPI


> All,
> I have been trying to get CAPI4Linux working on my machine and being
> frank am failing miserably! I am looking for any help available, I am
> real newbie (so please be gentle) and choose to run Mandrake 9.2 as it
> appears quite friendly (or so I thought!).
>
> I have been following the guidance found at
> http://www.voip-info.org/wiki-Asterisk+How+to+connect+with+CAPI for the
> AVM card (actually I have a BT Speedway - apparently the same thing).
>
> I guess the best approach is to detail what I have done in tandem with
> the guidance? So here we go -
>
> Type -
> # modprobe capi
>
> Great! I get no response (which is expected!), so move to step 2
> (http://www.voip-info.org/wiki-Asterisk+AVM+Fritz+CAPI+Driver+Install)
>
> Guidance states 'Download and install your kernel sources' - I installed
> these as part of the original installation, so I'll ignore.
>
> I download and install the CAPI driver -
> # cd /usr/src
> # wget
> ftp://ftp.avm.de/cardware/fritzcrd.pci/linux/suse.82/fcpci-suse8.2-03.11
> .02.tar.gz
> # tar -xzvf fcpci-suse8.2-03.11.02.tar.gz
> # cd fritz
> Great! Looking good!
>
> Guidance states modify the makefile in /usr/src/src.drv as follows -
> Replace -
>  CARD_PATH       = /lib/modules/`uname -r`/misc
> with  -
>  CARD_PATH       = /lib/modules/$(uname -r)/kernel/drivers/isdn/avmb1
>
> I am aware this chap is running Debian and I am running Mandrake, so
> after searching decided to modify the line as such -
>  CARD_PATH       = /lib/modules/2.4.22-10mdk/kernel/drivers/isdn/avmb1
>
> Guidance states modify the KRNLINCL lines for the correct include path -
>
> KRNLINCL        = /usr/src/kernel-headers-`uname -r`/include
> #KRNLINCL        = /lib/modules/`uname -r`/build/include
> #KRNLINCL        = /usr/src/linux/include
>
> And modify the lines as thus -
> DEFINES = -DMODULE -D__KERNEL__ -DNDEBUG \
>                  -D__$(CARD)__ -DTARGET=\"$(CARD)\"
> CCFLAGS = -c $(DEFINES) -O2 -Wall -I $(KRNLINCL)
> With -
> DEFINES = -DMODULE -DMODVERSIONS -D__KERNEL__ -DNDEBUG \
>                  -D__$(CARD)__ -DTARGET=\"$(CARD)\"
> CCFLAGS = -c $(DEFINES) -march=i686 -O2 -Wall -I $(KRNLINCL) \
>                -include $(KRNLINCL)/linux/modversions.h
>
> Again aware of the Debian V's Mandrake configuration, I searched the web
> and found the following guidance for Mandrake (using the google
> translation feature - http://translate.google.com/translate?hl=en
> <http://translate.google.com/translate?hl=en&sl=de&u=http://ixi.thepengu
> in.de/&prev=/search%3Fq%3Dcapi%2Bmandrake%26hl%3Den%26lr%3D%26rls%3DRNWE
> ,RNWE:2004-35,RNWE:en>
> &sl=de&u=http://ixi.thepenguin.de/&prev=/search%3Fq%3Dcapi%2Bmandrake%26
> hl%3Den%26lr%3D%26rls%3DRNWE,RNWE:2004-35,RNWE:en )
>
> And made the following changes to the makefile in /usr/src/src.drv as
> that seemed more appropriate and saved the file -
>
> KRNLINCL =/usr/src/linux/include
>
> DEFINES = Dmodule Dmodversions D__kernel __ Dndebug \
> D__$(card) __ Dtarget=\"$(card) \ "
>
> CCFLAGS = C $(defines) -march=i586 -O2 barrier i $(krnlincl) \
> include/usr/src/linux/include/linux/modversions.h
>
> Going back to the original Guidance
> (http://www.voip-info.org/wiki-Asterisk+AVM+Fritz+CAPI+Driver+Install)
> I am instructed to modify the defs.h file in /usr/src/fritz/src.drv as
> follows -
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> with
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 23)
>
> Great, I'm now ready to run the make command! Unfortunately the first
> couple of responses are as follows which to me looks very bad? And not
> sure what to do next?
>
> [root at asterisk src.drv]# make
> cc C Dmodule Dmodversions D__kernel__ DNDEBUG D____ Dtarget=\"\"
> -march=i586 -O2 barrier i /usr/src/linux/include
> include/usr/src/linux/include/linux/modversions.h main.c -o main.o
> cc: C: No such file or directory
> cc: Dmodule: No such file or directory
> cc: Dmodversions: No such file or directory
> cc: D__kernel__: No such file or directory
> cc: DNDEBUG: No such file or directory
> cc: D____: No such file or directory
> cc: Dtarget="": No such file or directory
> cc: barrier: No such file or directory
> cc: i: No such file or directory
> cc: include/usr/src/linux/include/linux/modversions.h: No such file or
> directory
>
>
> For completeness I Have included the makefile and defs.h files
>
> -------- Makefile --------
> SOURCES  = main.c driver.c tables.c queue.c lib.c tools.c
> OBJECTS  = $(patsubst %.c,%.o,$(SOURCES))
> LIBRARY  = ../lib/$(CARD)-lib.o
>
> CARD_PATH = /lib/modules/2.4.22-10mdk/kernel/drivers/isdn/avmb1
> CS_PATH  = /lib/modules/`uname -r`/pcmcia-external
>
> KRNLINCL = /usr/src/linux/include
>
> DEFINES  = Dmodule Dmodversions D__kernel__ DNDEBUG \
>     D__$(CARD)__ Dtarget=\"$(CARD)\"
> CCFLAGS  = C $(DEFINES) -march=i586 -O2 barrier i $(KRNLINCL) \
>   include/usr/src/linux/include/linux/modversions.h
> LDFLAGS  = -r
>
> ifeq ($(CARD),fcpcmcia)
> CS_MOD  = fcpcmcia_cs.o
> CS_SRC  = fcpcmcia_cs.c
> else
> CS_MOD  =
> CS_SRC  =
> endif
>
> all:  $(CARD).o $(LIBRARY) $(CS_MOD)
>
> install: $(CARD).o $(LIBRARY) $(CS_MOD)
>   mkdir -p $(CARD_PATH)
>   cp -f $(CARD).o $(CARD_PATH)
> ifeq ($(CARD),fcpcmcia)
>   mkdir -p $(CS_PATH)
>   cp -f $(CS_MOD) $(CS_PATH)
> endif
>
> clean:
>   $(RM) $(OBJECTS) $(CARD).o $(CS_MOD)
>
> $(CARD).o: $(OBJECTS)
>   $(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBRARY)
>
> $(OBJECTS): %.o: %.c
>   $(CC) $(CCFLAGS) $< -o $@
>
> $(CS_MOD): $(CS_SRC)
>   $(CC) $(CCFLAGS) $< -o $@
>
> # No dependencies yet...
>
>
> -------- Defs.h --------
> /*
>  * defs.h
>  * Copyright (C) 2002, AVM GmbH. All rights reserved.
>  *
>  * This Software is  free software. You can redistribute and/or
>  * modify such free software under the terms of the GNU Lesser General
> Public
>  * License as published by the Free Software Foundation; either
>  * version 2.1 of the License, or (at your option) any later version.
>  *
>  * The free software is distributed in the hope that it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>  * Lesser General Public License for more details.
>  *
>  * You should have received a copy of the GNU Lesser General Public
>  * License along with this Software; if not, write to the Free Software
>  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
> USA, or see
>  * http://www.opensource.org/licenses/lgpl-license.html
>  *
>  * Contact: AVM GmbH, Alt-Moabit 95, 10559 Berlin, Germany, email:
> info at avm.de
>  */
>
> #ifndef __have_defs_h__
> #define __have_defs_h__
>
> #ifndef LINUX_VERSION_CODE
> # include <linux/version.h>
> #endif
>
> #ifndef TRUE
> # define TRUE  (1==1)
> # define FALSE  (1==0)
> #endif
>
> /*----------------------------------------------------------------------
> -----*\
> \*----------------------------------------------------------------------
> -----*/
> #if defined (__fcclassic__)
> # define PRODUCT_LOGO "AVM FRITZ!Card Classic"
> # define INTERFACE "isa"
> #elif defined (__fcpnp__)
> # define PRODUCT_LOGO "AVM FRITZ!Card PnP"
> # define INTERFACE "pnp"
> #elif defined (__fcpcmcia__)
> # define PRODUCT_LOGO "AVM FRITZ!Card PCMCIA"
> # define INTERFACE "pcmcia"
> #elif defined (__fcpci__)
> # define PRODUCT_LOGO "AVM FRITZ!Card PCI"
> # define INTERFACE "pci"
> #endif
> #define DRIVER_LOGO PRODUCT_LOGO " driver"
> #define SHORT_LOGO "fritz-" INTERFACE
>
> #define REV_DEFAULT "0.5.2"
>
> /*----------------------------------------------------------------------
> -----*\
> \*----------------------------------------------------------------------
> -----*/
> #if defined (OSDEBUG) && defined (NDEBUG)
> # undef NDEBUG
> #endif
>
> #define UNUSED_ARG(x) (x)=(x)
>
> /*----------------------------------------------------------------------
> -----*\
> \*----------------------------------------------------------------------
> -----*/
> #define KB   1024
> #define MIN_LIB_HEAP_SIZE (64 * KB)
> #define MAX_LIB_HEAP_SIZE (600 * KB)
>
> /*----------------------------------------------------------------------
> -----*\
> \*----------------------------------------------------------------------
> -----*/
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 13)
> # define GET_PCI_BASE(d, r) (d)->base_address[r]
> #else
> # define GET_PCI_BASE(d, r) (d)->resource[r].start
> #endif
>
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 43)
> # define KFREE_SKB(x) dev_kfree_skb(x)
> #else
> # include <linux/netdevice.h>
> # define KFREE_SKB(x) dev_kfree_skb_any(x)
> #endif
>
> #if defined (CONFIG_ISAPNP_MODULE) && !defined (CONFIG_ISAPNP)
> #define CONFIG_ISAPNP
> #endif
>
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 23)
> typedef void irqreturn_t;
>
> #define IRQ_NONE
> #define IRQ_HANDLED
> #define IRQ_RETVAL(x)
> #endif
>
> #endif
>
>


----------------------------------------------------------------------------
----


> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list