Configuring a Redfone Fonebridge2 with Elastix (Part 1)


In this two-part article you will find everything you need to know in order to configure your Redfone Fonebridge2 with Elastix 1.5.2-2. Part 1 goes through setting up a single Elastix appliance (or server) with a Redfone Fonebridge2 as an external T1/E1 interface. Part 2 explains how to implement high availability with the Redfone Fonebridge2 and a secondary (backup) Elastix appliance (or server). After going through both parts of this article you will be able to setup a high availability environment on your own. In this way, if one Elastix server or appliance were to fail, the calls will still flow to a backup Elastix server or appliance.


SCHEMATIC DIAGRAM


Our objective in Part 1 of this article is to setup an Elastix appliance or server with a Fonebridge2 device. The following is the diagram of the solution that we are looking to accomplish.



That is, a call originates from extension 509 in the Elastix appliance. The call then gets routed to the Fonebridge2 device and out of span 1. Afterwards, the call gets received through span 2 of the same Fonebridge2 and back into the appliance. Once the call is back in the Elastix appliance, it should terminate by ringing extension 503.




EQUIPMENT REQUIRED


For the purposes of this article, we will be using the following devices:


1) One (1) Redfone Fonebridge2 Dual Port T1/E1



2) Two (2) Elastix Appliances ELX-025 loaded with Elastix 1.5.2-2 Stable, with two (2) network interfaces each:



In Part 1 of this article we will only use one (1) Elastix appliance. In Part 2 we will use both Elastix appliances in order to setup a high availability environment.




CONNECTING THE DEVICES


For the purposes of this article we will use a single Redfone Fonebridge2 to act as both the Telco T1/E1 provider and also as the receiver T1/E1 device. We do this for lab testing since it does not require an actual T1/E1 trunk from the Telco. In order to do this, we will create a loopback between the two ports (labeled T1/E1 1 and 2) of the Fonebridge2 (one to simulate the T1/E1 from the Telco and the other to receive the calls from the simulated T1/E1). The cable used for this loopback needs to be crossover. A pin-out diagram for the cable is provided below for your reference.



Now we need to connect the Redfone Fonebridge2 to our Elastix appliance. For this, we connect the port on the Fonebridge2 labeled "Ethernet FB1" to the second network interface of the Elastix appliance (Ethernet 1). Please remember that the first network interface of the Elastix appliance, Ethernet 0, is reserved for connecting the appliance to the network (and IP phones). Here is a picture of how the setup will look so far including the loopback connection. The picture does not show the connectivity of the appliance to the network through Ethernet 0.



The Fonebridge2 comes with two (2) Ethernet interfaces. "Ethernet FB1" is preconfigured with as 192.168.1.254/24, and "Ethernet FB2" is preconfigured as 192.168.1.253/24. Due to this, we will configure the second network interface (Ethernet 1) in the Elastix appliance as 192.168.1.200/24 (We use 200 here, but you could choose any unused IP address in the range).




COMMUNICATING WITH THE FONEBRIDGE2


If you are using an Elastix appliance everything should be ready for you to start configuring (make sure you have a secondary network card). If you are using a server of your own, please make sure to have Elastix 1.5.2-2 Stable installed properly with two network interfaces. The actual installation of Elastix is outside the scope of this document. For more information on this please visit www.elastix.org


1) We now need to install the "fonulator" utility provided by Redfone. For this, we issue the following command:


[root@elastix~]# rpm -ivh http://support.red-fone.com/downloads/fonulator/fonulator-2.0.0-36.i386.rpm



Please confirm that the "fonulator" was installed successfully by issuing the following command:


[root@elastix~]# fonulator -V



2) We need to download and configure a sample redfone.conf file as follows.


[root@elastix~]# cd /etc/
[root@elastix etc]# wget http://support.red-fone.com/downloads/fonulator/redfone.conf



Using your preferred text editor you need to modify the redfone.conf sample file according to your needs. Here is what we have for our redfone.conf configuration.



Please note in this file that we are using the directive "fb=192.168.1.254" because we are using a single Elastix appliance. In Part 2 of this article, when we setup high availability with (2) two Elastix appliances, we will use the "FB1=" and "FB2=" directives instead.


3) Download the "fonulator script" as follows.


[root@elastix etc]# cd init.d/
[root@elastix init.d]# wget http://support.red-fone.com/downloads/fonulator/old/fonulator_initd_script
[root@elastix init.d]# mv fonulator_initd_script fonulator
[root@elastix init.d]# chmod +x fonulator



4) Now we need to download the "dahdi init script" for use with the Fonebridge2.


[root@elastix init.d]# mv dahdi /opt/dahdi.old
[root@elastix init.d]# wget http://support.red-fone.com/downloads/elastix/dahdi
[root@elastix init.d]# chmod 755 dahdi



Here we need to modify the shutdown sequence for some services to prevent a current bug. If the network services are shutdown before dahdi, you will see a kernel panic. This will happen during Elastix shutdown or restart. In order to avoid this issue, you need to modify the sequence by issuing the commands below. Surely this bug will go away in future versions and you won't have to do this any longer.


[root@elastix init.d]# cd /etc/rc0.d/
[root@elastix rc0.d]# mv K92dahdi K90dahdi
[root@elastix rc0.d]# mv K90network K92network
[root@elastix rc0.d]# cd ../rc6.d/
[root@elastix rc6.d]# mv K92dahdi K90dahdi
[root@elastix rc6.d]# mv K90network K92network



5) At this point, we need to test the communication between our Elastix appliance and the Fonebridge2 by using the "fonulator".


[root@elastix rc6.d]# fonulator -vq





CONFIGURING DAHDI AND ELASTIX/ASTERISK


At this point we need to configure the Elastix appliance (or server) to use the external Redfone Fonebridge2 to communicate telephonically with the outside world.


1) Let's start by editing the system.conf file for dahdi. Feel free to use the text editor of your choice. We will be using the "vim" editor. The configuration depicted below is used for an E1 trunk. If you will be configuring a T1, this file will need to change accordingly. Basically, this file is telling dahdi to target the external Fonebridge2's IP address using the ethmf technology to connect calls.




Please note that the provided above is only a sample file for our setup.


2) Next we must tell dahdi how to treat the T1/E1 spans in the Fonebridge2. We do this by modifying (or creating if it does not exist yet) the dahdi-channels file. The following picture shows our sample configuration. Please keep in mind that we are defining this for an E1. If you are using a T1 you'll need to modify it accordingly. Also note that the group 1 (corresponding to span 1 of the Fonebridge2) will be configured as CPE and group 2 (corresponding to span 2 of the Fonebridge2) will be configured to emulate an E1 from the Telco. Remember we are doing a loopback on the Fonebridge2. Again, we will be using "vim" as our text editor but feel free to use whatever you are comfortable with.


[root@elastix dahdi]# vim ../asterisk/dahdi-channels.conf



Please make sure to set the permissions and ownership correctly:


[root@elastix dahdi]# chmod 664 /etc/asterisk/dahdi-channels.conf
[root@elastix dahdi]# chown asterisk:asterisk /etc/asterisk/dahdi-channels.conf


3) We must now restart Asterisk for the changes to the configuration files to take effect. We perform this by issuing the following commands:


[root@elastix dahdi]# amportal stop
[root@elastix dahdi]# service asterisk stop
[root@elastix dahdi]# amportal start



4) Finally, we need to make sure that all channels in the Fonebridge2 have been configured correctly. We verify the channels as follows.


[root@elastix dahdi]# lsdahdi



If we have done everything correctly up to now, we will notice that the LEDs on the Fonebridge2 are now lit up signaling the correct configuration of our devices.





TESTING THE ELASTIX / FONEBRIDGE2 SETUP


In this section we will make sure that all of our work has been effective by making calls according to our initial schematic diagram.


1) First, we create the two (2) SIP extensions that we'll need. In this case extension 503 belonging to "Jorge" and extension 509 belonging to "Mauro" are created:



We can verify that both extensions have been created properly by using the CLI functionality from the Elastix interface:



2) Now we must define the g1 trunk since we are using a group 1 in our dahdi-channels.conf file earlier in this article. We do this by creating a group within Elastix as follows:



3) Now we need to add an outgoing route and assign group 1 (g1) to it. This will basically tell Elastix to send all calls out through the g1 trunk (associated to span 1 of the Fonebridge2).



4) In the same manner we must tell Elastix to be ready to receive calls. We do this by creating an incoming route. In our case, we will send all received calls to extension 503.




5) We can finally proceed to make a call from extension 509 to extension 503. We do this by dialing 1503 (remember that we set our outgoing route to respond to "1|XXX". The result should be that a call is connected from extension 509 to extension 503. You can verify that it all went well by looking at the console report shown below.




If you have reached this point successfully, congratulations! You are now ready to implement a high availability environment with Elastix and the Redfone Fonebridge2 in Part 2 of this article.



Alfredo Zambrano

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Enter the above security code (required)

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.