Asterisk, Redfone & Airtel

I figured i would put up a post explaining some of the basic config needed to get a Redfone foneBridge working with Asterisk and Indian Telco Airtel​.

At our organization we had for the longest time a Hardware PBX that provided a fixed number of Analog phones. Although this worked for a long time, it was inflexible and a pain to maintain.

Our LA office had shifted to using Asterisk a while back and we knew that was the direction we needed to go in as well. Switching to a VOIP system like Asterisk would enable our international locations to route calls over our private VPN's and share a set of common dialing prefixes.​

Knowing that Asterisk was the chosen software PBX, the next step was to figure out how to hook up our external ​telco line to Asterisk. At our Mumbai office we had an Airtel E1 digital line that gave with 16 voice lines and we had about 100 Direct In Dial numbers. The process of figuring out the right config settings to get Asterisk to recognize the Airtel line involved a lot of trail an error. Part of why im putting up this blog post is to hopefully help anyone out there who is going to try something similar.

First things first, the Redfone foneBridge is a really a rock solid piece of equipment, its extremely easy to setup, with minimal config. The foneBridge has 2 kinds of ports. The first one being an E1/T1 port (RJ45 connector) and the second being a regular ethernet port. ​

When i had to build the cable for the E1 line i went through a lot of iterations and following different cable types, im a little foggy on what wire layout finally worked for the E1 line, but i believe it was just a straight ethernet wire layout.​

I recommend buying the foneBridge with the hardware Echo Cancellation built in as it is a vast improvement over any sort of software based echo cancellation that might exist in Asterisk.​

Redfone with 2 Ethernet & 2 E1/T1 ports

​The foneBridge's Ethernet ports are not running IP, they are actually running a TDMoE protocol which means you cannot connect it to a switch, and it is recommended to connect it directly to the network port on the machine running Asterisk. I recommend keeping the cable run between the ethernet port and machine short, as the TDMoE protocol is fairly sensitive to latency.

Once you have the cabling hooked up to the Asterisk server you need to build and load the kernel modules from the dahdi-linux-redfone package which is available from the Redfone website.  You also need to install libpri & the dahdi-tools package.

You also need to download the fonulator utility from the Redfone website. This helps you query and setup the redfone device for your Telco. The first config file you need to setup is the /etc/redfone.conf file. Below is a dump of my settings. The config file is pretty easy to setup.

[globals]
# IP-address of the IP Configuration port
# Factory defaults are; FB1=192.168.1.254 FB2=192.168.1.253
fb=192.168.1.254

# Which port to use for TDMoE Traffic (1 or 2)
port=1

# Which Asterisk server destination MAC address for TDMoE Traffic?
server=00:90:27:A9:F7:D7

# Determines which span is to derive timing from telco
# priorities=0,1,2,3

# E1 PRI SPAN - Airtel
[span1]
framing=ccs
encoding=hdb3

Once you have this setup, you should be able to query the redfone device using the fonulator utility

ins35 /etc/init.d# fonulator -vq
Detecting foneBRIDGE
Span 1 configured as: E1,HDB3
Span 2 configured as: E1,HDB3
SW ver: 2.1.1
SW Compile date: Jul  1 2008 22:03:02
SW Build: 62
Flash Date: 4/27/2009 12:6:11
SYSID Timestamp: 5/23/2008 6:20:21
DSP Status: Available

Next you need to modify the /etc/dahdi/system.conf file to specify the spans and channels. Below is a dump of the settings that i used

# spans
dynamic=ethmf,eth1/00:50:c2:65:D6:52/0,31,2
dynamic=ethmf,eth1/00:50:c2:65:D6:52/1,31,1

# Channels
bchan=1-15,17-31
dchan=16
bchan=32-46,48-62
dchan=47

alaw=1-62

# Tonezone
loadzone=in
defaultzone=in

​And finally to hook all of this up into your asterisk config, you need to setup the /etc/asterisk/chan_dahdi.conf file. The settings that i used for Airtel, looked something like this.

;Airtel
group=2
context=autoatt
switchtype=national
signalling=pri_cpe
musiconhold=default
channel=1-15,17-31
useincomingcalleridondahditransfer = yes

Based on the above config, all incoming calls will be dropped into the autoatt context, and in the extension.conf file i can send calls to my airtel lines by a simple dial statement like Dial(DAHDI/G2/<phoneno>)

Thats about it...​