نمایش نتایج: از شماره 1 تا 1 از مجموع 1

موضوع: Asterisk and ISDN

  
  1. #1
    نام حقيقي: 1234

    مدیر بازنشسته
    تاریخ عضویت
    Jul 2009
    محل سکونت
    5678
    نوشته
    5,634
    سپاسگزاری شده
    2513
    سپاسگزاری کرده
    272

    Asterisk and ISDN

    Asterisk and ISDN


    As mentioned in the previous article setting up Asterisk isn't that hard if you only want voip. In fact one of the Trixbox distribution is actually a VMWare image that you can start playing with right away.

    The real functionality however is found in combining the world of Voip with the hardware telecom lines. Let's face it, most companies still use those and have learned to trust on the reliability of POTS (Plain Old Telephone System i.e. analog phonelines) or ISDN (digital lines: the BRI consumer type that has two B channels and one D (protocol) channel, and the PRI type which is technically similar except for the amount of B channels; in the US and Japan it's 23 B, in Europe and Australia 30). They want the advantages of Voip but are not quite ready to let the reliability of regular phone lines slide.

    Always works…

    The nice thing about asterisk is that it can function as a bridge between the different technologies. In Holland ISDN is pretty big with most companies. The smaller ones typically get one or more ISDN2 connections the larger ones get ISDN15 or 30. Whatever the number of lines, the technology is basically the same. Asterisk can simply connect Voip to ISDN and vice versa, the only thing needed is a trunk set up in asterisk, some inbound and outbound routes and of course the right hardware to connect to the telecom provider. It's even possible to use ISDN phones with Asterisk this way, but that's for another time. For now we'll stick with the (much nicer) Voip phones…
    If you happen to have an ISDN line: good news! Asterisk can work with very cheap basic ISDN cards that are found in any computer shop. To make it even easier, the cards best used are based on the HFC chipset. This chipset is used by a large number of vendors and is easily recognizable by the graphic of the two towers printed on the chip, representing the towers of the Dom cathedral in Cologne.


    If you look closely you can just make out the Dom on the chip on the Sweex ISDN card.

    Before we have Asterisk route our calls through this ISDN card however, we need to get Linux to understand it first.
    There are two ways to get Linux to play nice with ISDN cards that I know to be functional and working:


    1. trough the Zaptel HFC Bristuff drivers
    2. by using mISDN


    More information on Bristuff and mISDN can be found on the excellent voip-info.org website.
    Both methods have advantages as well as disadvantages. We'll be working with Trixbox, and the older versions (before 2.2.8) have a script installed called 'install-ZAPHFC'. You basically run it and it will install the drivers and make a so called 'ZAP' channel available for you in Asterisk. The downside is that it recompiles asterisk, and makes a number of modifications that make it less compatible with the Trixbox implementation. Most are only cosmetic, but one particularly nasty effect is that the fax recognition no longer works and that the update packages function no longer works.

    mISDN doesn't have those downsides, and also supports a larger array of ISDN cards, but is a bit trickier to set up. The downside here is that echo-cancellation is quite limited compared to the zaptel implementation. We will look at mISDN in another article.

    ZAPHFC
    For this article let's start with getting an ISN card to work using the install-ZAPHFC script. First step of course is to get the ISDN card in place. I have used a simple Sweex ISDN card (15 to 20 Euro's) for my installation. Once physically installed it's pretty simple to confirm the card is there by using 'lspci':
    [root@phone ~]# lspci
    00:00.0 Host bridge: Intel Corporation 82845 845 (Brookdale) Chipset Host Bridge (rev 03)
    00:01.0 PCI bridge: Intel Corporation 82845 845 (Brookdale) Chipset AGP Bridge (rev 03)
    00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 12)
    00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 12)
    00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 Controller (rev 12)
    00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus Controller (rev 12)
    00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio Controller (rev 12)
    01:00.0 VGA compatible controller: ATI Technologies Inc Rage 128 Pro Ultra TF
    02:08.0 Network controller: Cologne Chip Designs GmbH ISDN network controller [HFC-PCI] (rev 02)
    02:0c.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78)


    Next step is to run the install-ZAPHFC script. If it's not available on the distribution you're using, you can manually download it like this:
    Go to the Linux command prompt (make sure you are root)
    wget http://brightheadtechnology.com/othe...install-ZAPHFC
    Now move it to the 'sbin' folder and apply 'chmod + x install-ZAPHFC' to make it executable.
    Now simply run it!
    Install-ZAPHFC comes with a number of options.

    [root@phone ~]# install-ZAPHFC -h
    -----------------------------------------------------
    Searching for HFC Chipset based cards.
    -----------------------------------------------------
    Found a 1 port card (1397:2bd0) with an HFC-PCI chipset.
    install-ZAPHFC:
    Install BRIstuff support.
    Builds zaphfc and configures one, or more, single port HFC cards.
    Builds qozap and configures a 4 port or an 8 port HFC card.
    usage:
    install-ZAPHFC [-a <version> |-l ] [-B |-C ] [-R ] [-m 1|0[1|0[1|0[1|0]]] ] [-f t|u [-t 1|2|3|4] [-s 1|0[1|0[1|0[1|0]]]] ]
    install-ZAPHFC -h
    install-ZAPHFC -V
    Options:
    -a <version>: The version of Asterisk you want to patch with BRIstuff (e.g. 1.2.1)
    The default is to use the version number from the currently installed Asterisk.
    -B Build only. Will disable the configuration module*.
    -C Configure only. Will disable the build module*.
    * if you specify both B & C options the last occurrence on the command line takes presidence
    -f Apply Florz's patch (Florz' Patch for the zaphfc Driver). (Default no)
    t (tested) the last tested patch will be applied (this may use an earlier * to do so).
    u (un-tested) patch the latest version of BRIstuff (CAUTION).
    -h This help screen
    -l List the versions of Asterisk that you can build BRIstuff for.
    -M set the mirror to use for downloading the Asterisk sources from.
    -M 0 Use the mirror specified by Junghanns
    -M 1 Use the Digium mirror (default)
    -m Set the NT/TE mode for each card.
    Use 1 for NT mode and 0 for TE mode.
    Specify one or more cards with card 1 as the rightmost digit. Examples:
    -m 1 Card 1 in NT mode.
    -m 10 Card 2 NT mode card 1 TE mode.
    -m 11 Cards 2 & 1 in NT mode.
    -m 1100 Cards 4 & 3 in NT mode cards 2 & 1 in TE mode.
    -R Re-write zapata-BRI-HFC.conf.
    -s Set the Slave/Master mode for each card.
    Use 1 for Slave mode and 0 for Master mode. Only when built with Florz's patch.
    Specify one or more cards with card 1 as the rightmost digit. Examples:
    -s 1 Card 1 in Slave mode. (Assumes you have more than one card).
    -s 10 Card 2 in Slave mode card 1 in Master mode.
    -s 110 Cards 3 & 2 in Slave mode card 1 in Master mode.
    -s 1110 Cards 4, 3 & 2 in Slave mode card 1 in Master mode.
    -t Specify which card will be the timer_card. (Default 1). Only when built with Florz's patch.
    -V Print script version number and exit.

    You can see another nice thing about this way of getting ISDN cards to work: the HFC chipset makes it possible to use the ISDN card to actually connect an ISDN phone to it and make it work with Asterisk; this is the NT mode.

    We'll focus on the TE mode though, as our objective is to get the Asterisk box to connect to the telco.

    Something like:

    Install-ZAPHFC –R

    Might very well do the trick. , The '-R' also writes the Zapata-BRI-HFC.conf file for you. (found in /etc/asterisk/ and tells the system about your ISDN configuration)

    You can check if things went well by using the ztcfg –vvv command:
    [root@phone html]# ztcfg -vvvvv

    Zaptel Configuration
    ======================

    SPAN 1: CCS/ AMI Build-out: 399-533 feet (DSX-1)

    Channel map:

    Channel 01: Clear channel (Default) (Slaves: 01)
    Channel 02: Clear channel (Default) (Slaves: 02)
    Channel 03: D-channel (Default) (Slaves: 03)
    3 channels configured.


    We're getting close! The card is recognized and we can see the channels…

    Next edit the:
    '/etc/sysconfig/zaptel' file to exclude all the devices that are not actually in the system (in this case, just leave the zaphfc hardware)

    Make sure you have your ISDN line connected and check if things have been installed OK by executing the following from a command prompt:
    for PROC in `ls -1 /proc/zaptel/`;do cat /proc/zaptel/$PROC|head -n 1;done
    You should see all of the ISDN ports you have connected showing "ACTIVATED". If they don't check your cables/ISDN service.

    [root@phone ~]# for PROC in `ls -1 /proc/zaptel/`;do cat /proc/zaptel/$PROC|head -n 1;done
    Span 1: ZTHFC1 "HFC-S PCI A ISDN card 0 [TE] layer 1 ACTIVATED (F7)" AMI/CCS


    If you disconnect your ISDN line you should see:

    Span 1: ZTHFC1 "HFC-S PCI A ISDN card 0 [TE] layer 1 DEACTIVATED (F15)" AMI/CCS



    Possible issues

    You should basically have the card running now. There might still be a few problems though…:

    If, once you have rebooted, you see a lot of lines scrolling over your screen that look like this:

    zaphfc: dropped audio (z1=2331, z2=2314, wanted 8 got 17, dropped 9).

    You might have an interrupt problem. To fix it you should change your grub.conf:
    /etc/grub.conf needs to be edited as follows:

    default=1
    timeout=7
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Red Hat Enterprise Linux AS (2.4.21-20.EL)
    root (hd0,0)
    kernel /vmlinuz-2.4.21-20.EL ro root=LABEL=/ apm=off
    initrd /initrd-2.4.21-20.EL.img
    title Red Hat Enterprise Linux AS (2.4.21-20.ELsmp)
    root (hd0,0)
    kernel /vmlinuz-2.4.21-20.ELsmp ro root=LABEL=/ apm=off
    initrd /initrd-2.4.21-20.ELsmp.img



    With a little luck switching off the Advanced Power Management fixes the issue. If you still get the errors mentioned above the next trick to try is to run install-ZAPHFC with the Florz patch (see the install-ZAPHFC options).

    If you're in the Netherlands you might experience the system complaining about:

    kernel: zaphfc: empty HDLC frame or bad CRC received


    In the Netherlands it is common practice by telecom providers (such as KPN) to 'drop' the ISDN D channel every X minutes (I believe it to be 5 minutes).

    This results in the error described above. In my case I solved the issue by calling the KPN service number and requesting the D channel to the 'up' constantly. It took them 2 hours (great response time, not sure if I was just lucky) to fix this and my problems were resolved.

    Everything is working!
    That should have taken care of most of the issues that stand in the way of the functionality, now only one (but essential) cosmetic thing needs to be done: adding the two new ISDN channels (every ISDN line has two B channels for voice and one D channel for protocol information) to the FOP.

    The FOP is the Flash Operation Panel, and it allows you an overview of what's going on in asterisks, what extensions are calling or being called, and over what trunks.

    Add channels to FOP:
    While you can use the ISDN ZAP channels in FreePBX without issue, FreePBX does not yet write these channels into the FOP configuration files. To do so edit /var/www/html/panel/op_buttons_custom.cfg and add the following section to it:
    [Zap/x]
    Position=z
    Label="Zap x"
    Extension=-1
    Icon=3
    Panel_Context=default

    [Zap/y]
    Position=z+1
    Label="Zap y"
    Extension=-1
    Icon=3
    Panel_Context=default

    Where x & y are the channel numbers for your ISDN card and z is the position number (refer to /var/www/html/panel/op_buttons_additional.cfg). Restart Asterisk (amportal restart) to make the changes effective.
    Things should be working!

    Last steps is to actually create the trunks (the device is ZAP/g0), and make sure there are inbound and outbound routes that lead somewhere defined in FreePBX




    موضوعات مشابه:
    ویرایش توسط patris1 : 2010-02-25 در ساعت 02:22 AM

کلمات کلیدی در جستجوها:

FOP asterisk

asterisk distro hfc

تلفون f99

te-isdn

freepbx panel

trunk freepbx

fop freepbx

instalar asterisk en redhat 2.4.21-20.el

freepbx screen

freepbx apm=off

central pbx asterisk

isdn يافتن سخت افزار (misdn driver not installed)

asterisk isdn f15

asterisk fop isdn always red

trixbox2.8 zaphfc

hfc-s pci a isdn card 0 [te] change to nt

82801ba/bam ac97

freepbx isdn

fax

trixbox check isdn channels

configuration freepbx misdn

trixbox panel flash

hfc-s pci a isdn card 0 [te] layer 1 ac

ISDN يافتن سخت افزار (mISDN Driver not Installed)

flash operaion panel do asterisk

برچسب برای این موضوع

مجوز های ارسال و ویرایش

  • شما نمی توانید موضوع جدید ارسال کنید
  • شما نمی توانید به پست ها پاسخ دهید
  • شما نمی توانید فایل پیوست ضمیمه کنید
  • شما نمی توانید پست های خود را ویرایش کنید
  •