Difference between revisions of "Linux Short Installation Guide"

From berofix - professional SIP gateway
Jump to: navigation, search
(Setup Networking:)
(Discovering and Resetting berofix:)
Line 131: Line 131:
 
The bfdetect tool can be fetched via:
 
The bfdetect tool can be fetched via:
 
 
http://www.beronet.com/downloads/berofix/bfdetect.tar.gz
+
http://www.beronet.com/downloads/berofix/tools/bfdetect.tar.gz
  
 
Simply untar and compile it with:
 
Simply untar and compile it with:

Revision as of 09:08, 16 September 2013

Linux Installation Short Guide

This howto describes the basic steps to bring your new beroFix card into your network, and howto configure it so that you can make SIP to ISDN calls and vice versa. This howto is intended to use Asterisk as SIP Proxy, but you can use most of the setup for other SIP Proxies as well.

So the Steps are:

1. Setup Networking
1.1 Discovering and Resetting berofix
2. Add User for berofix in the Proxy/Registrar
3. Setup SIP/ISDN and Routing in beroFix


After these steps, you should be able to place and receive calls with berofix.


Setup Networking:

beroFix uses a Realtek PCI Network Chip to communicate with the Host PC. Which means it looks like a Network Card when you put it into a PC. This means that you don't have to compile or load any additional driver instead of the Network card driver ( 8139too on Linux). The layout looks basically like:


LAN <----> NIC_LAN (eth0) <-> PC <-> NIC_BEROFIX (eth1) <---> BEROFIX CPU

The PC can directly talk to the beroFix CPU via IP, but to make the beroFix CPU talk to other network Elements an additional Setup is required.

There are 3 common ways to make the Berofix CPU visible to the LAN components:

1. a Ethernet Bridge (recommended) 2. proper Routing 3. NAT


We will focus on howto use a bridge for now, since this makes the easiest setup and allows the most flexibility. It is also possible to use bridges on other operating systems than linux.

You can setup the bridge with the "brctl" utility. This utility is provided by the "bridge-utils" package on debian based systems (like ubuntu).

The beroFix cards have MAC Addresses beginning with "D8:DF:0D" or with "00:50:c2", so you can identify these cards with "ifconfig -a" :

  ifconfig -a 
  
  eth0      Link encap:Ethernet  HWaddr 00:0C:6E:D3:86:C6  
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:797562 errors:0 dropped:0 overruns:0 frame:0
            TX packets:35206 errors:20 dropped:0 overruns:0 carrier:20
            collisions:7447 txqueuelen:1000 
            RX bytes:141351732 (134.8 MiB)  TX bytes:19431622 (18.5 MiB)
            Interrupt:11 Base address:0xc000 
  
  eth1      Link encap:Ethernet  HWaddr 00:50:C2:83:D0:01
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:35124 errors:0 dropped:0 overruns:0 frame:0
            TX packets:276362 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000 
            RX bytes:20636164 (19.6 MiB)  TX bytes:28931756 (27.5 MiB)
            Interrupt:11 Base address:0xa000 
  
  lo        Link encap:Local Loopback  
            inet addr:127.0.0.1  Mask:255.0.0.0
            UP LOOPBACK RUNNING  MTU:16436  Metric:1
            RX packets:9 errors:0 dropped:0 overruns:0 frame:0
            TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0 
            RX bytes:720 (720.0 b)  TX bytes:720 (720.0 b)
  

In this example eth1 is the berofix card.

To setup the bridge, you need to enter a few commands:

  ifconfig eth0 0.0.0.0 up
  ifconfig eth1 0.0.0.0 up
  brctl addbr br0
  brctl addif br0 eth0
  brctl addif br0 eth1
  
  ifconfig br0 10.0.0.3 up 
  

These commands will first remove the ip-addresses from your network card, will create the bridge and add your network and the berofix card to this bridge. In this case the bridge gets the IP 10.0.0.3.

The default IP of the berofix CPU is 10.0.0.2, you can change this later, then you can modify the bridge IP too.

To setup this bridge in a persitant way, you can modify your "/etc/network/interfaces" file on debian like systems (like ubuntu):

  auto lo
  iface lo inet loopback
  
  auto br0
  iface br0 inet static
  	address 10.0.0.3
  	netmask 255.0.0.0
  	gateway 10.0.0.1
     	bridge_ports eth0 eth1
 

Then you can restart your networking with:

  /etc/init.d/networking restart

Now you should be able to communicate with the berofix CPU. You can do this by simply using a webbrowser and browse to the IP of the berofix CPU, simply enter:

  http://10.0.0.2  

In your favourite Webbrowser. You will be prompted to enter a username and passwort, which are user:"admin" password:"admin" by dafault.


Discovering and Resetting berofix:

The following mechanisms require a bridge Setup! See above (1.).


If you ever get lost, while setting up a wrong IP or DHCP without a DHCP Server you can use the bfdetect tool to find and reset the device.

The bfdetect tool can be fetched via:

http://www.beronet.com/downloads/berofix/tools/bfdetect.tar.gz

Simply untar and compile it with:

  tar xzf bfdetect.tar.gz
  cd bfdetect
  make install


now you can discover the berofix device with:

  bfdetect

You'll get a menu with every found berofix, then you can configure it's IP Settings.

Add User for berofix in the Proxy:

Assuming that you use Asterisk as SIP Proxy, you can make a very simple setup for berofix. Simply add the following lines to the "/etc/asterisk/sip.conf":

 [berofix]
 type=friend
 secret=berofix
 host=10.0.0.2
 allow=all
 context=from-sip


In the "/etc/asterisk/extensions.conf" you need to add a context "from-sip" like:

  [from-sip]
  exten => _X.,1,Playback(tt-monkeys)

So every call from berofix will be routed to Playback(tt-monkeys). When you want to send calls to beroFix you can simply use the following dial statement:

  exten => _0X.,1,Dial(SIP/${EXTEN:1}@berofix)
  exten => _0X.,n,hangup


To make this work you need to reload the configs on the asterisk cli:

  asterisk -rx "reload"


No you need to setup these paramters at berofix as well, and you should be able to make basic calls.


Setup SIP/ISDN and Routing in beroFix:

beroFix can be completely configured by your webbrowser. So simply browse to berofix, by entering:

  http://10.0.0.2  

in your webbroswer. Now log in with "admin:admin". You will see a Web GUI with The major Points:

  • ISDN Hardware - modify hardware related Settings (NT/TE, PTP)
  • ISDN - group Ports together
  • SIP - manage SIP Server registrations
  • Dialplan - manage routing

In the first step you should put your isdn ports into groups. In the most simple scenario you can put your 4BRI Ports together in one group named "BRI".

Then create a SIP Server entry, which gets the name "asterisk" Serveraddress: "10.0.0.3", User "berofix", Secret "berofix" Type "proxy" and default "enabled".

Finally you need 2 dialplan entries, one for "SIP-ISDN" and one for "ISDN-SIP".

SIP-ISDN:

From ID: "(.*)" To ID: "g:BRI" Destination: "(.*)" New Destinatoin: "\1" Source: "(.*)" New Source: "\1" Configuration: ""

As you can see, berofix understands regular Expressions Patterns. The Setting above means that every SIP Call is directly routed to the "BRI" group, the dialed number and the callerid are transported transparently.


ISDN-SIP:

From ID: "g:BRI" To ID: "g:asterisk" Destination: "(.*)" New Destinatoin: "\1" Source: "(.*)" New Source: "\1" Configuration: ""

This setup means that every ISDN Call coming from the ISDN Ports of the "BRI" group are routed to Asterisk.


As last step you need to activate the configuration. Do this by clicking on the "activate" icon.


Setting up a Bridge on other OS than debian

Open Suse

Howto setup a bridge on Suse: http://en.opensuse.org/Bridging