How to build Signaling Gateway using Mobicent jSS7 stack and Sangoma T1/E1/J1 card

Open Source Java SS7 stack allows Java applications to communicate with legacy SS7 communications equipment. jSS7 builds on the Mobicents SS7 project. jss7

Requirements:
1. Server running on Ubuntu 14.04.01 (kernel 3.13.0-32)
2. Mobicent jSS7 stack
3. Sangoma T1/E1/J1 card (for this tutorial I am using A101 card)

Signalling/E1 Requiremetns:

OPC (Sangoma Card)=e.g 888
DCP (Telco Switch) = e.g 999
Timeslot=1
Slc= 0
NI=2
GT=123456789 (Global Title to be assigned to your SGW, provided by the Operator)

Installation

1. Preparing your Operating system for software packages
After installing your Ubuntu operating system, you must prepare your server with the following software requirements before continuing.

$ $ apt-get -y install gcc g++ automake autoconf libtool make libncurses5-dev flex bison patch libtool autoconf linux-headers-$(uname -r) libxml2-dev cmake

$ apt-get install -y build-essential pkg-config libjansson-dev sqlite autoconf automake libtool libxml2-dev libncurses5-dev unixodbc unixodbc-dev libasound2-dev libogg-dev libvorbis-dev libneon27-dev libsrtp0-dev libspandsp-dev uuid uuid-dev libgnutls-dev

$ apt-get install libsctp-dev libsctp1 libsctp1:i386

2. Downloading Software Packages

Download all your software in /usr/src/ directory.

Change directory to /usr/src:

$ cd /usr/src

– Copy&paste each of the lines below (one by one) in your command line (in /usr/src) to automatically download each software package (.tgz files)

$ wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete.9.2+2.9.2.tar.gz

$ wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4.15.tar.gz

3. Installing Software Packages and Drivers

DAHDI Installation

tar xvzf dahdi-linux-complete.9.2+2.9.2.tar.gz
cd dahdi-linux-complete.9.2+2.9.2
make
make install
make config

If there are any error messages while trying to the above commands, you are missing system dependencies listed in previous steps

LibPRI Installation

cd /usr/src
tar xvfz libpri-1.4.15.tar.gz
cd libpri-1.4.15
make
make install

If there are any error messages while trying to the above commands, you are missing system dependencies listed in previous steps

Install Java – 32 bit version!

apt-get install openjdk-7-jdk:i386 openjdk-7-jre:i386 openjdk-7-jre-headless:i386

4. Install the Sangoma Wanpipe driver which will controls & configures the Sangoma card

Sangoma Driver Installation

Download the latest official release of the Sangoma Wanpipe Driver

cd /usr/src
wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-7.0.10.tgz
tar xvfz wanpipe-7.0.10.tgz
cd wanpipe-/
./Setup install

You will notice the Wanpipe driver installation splash screen next.

Press ‘y’ to continue

wan1

You will be presented with a dependency check with pass/fail results. If there are any failures, you must exist and install missing dependency manually.

Press [enter] to continue

dep

Press [enter] on the following screen for default kernel source location.

If there are any error messages that result, that means you are missing your Linux kernel development packages. This also means that during the ‘Preparing your Operating system for software packages’ step above has failed to download your kernel-devel packages. If this happens you must search online for the kernel-devel packages for your kernel, then download and install using (rpm -i…)

kernel

Press [enter] to continue

Next you will be presented with 7 different options on how to install the Wanpipe driver.

Select option 2 to install the Wanpipe driver

options

You will be asked to provide the location of your DAHDI software package.

If you have downloaded and installed DAHDI in /usr/src/, simply press the number pertaining to the location.

In the example below, Press 1.

location

In this example, the user has dahdi version 2.7.0 installed on their system

If your DAHDI installation lives in another directory, press ‘m’ then manually enter the full path.

If you have multiple DAHDI versions on your system, select the correct one.
(to find out which version of dahdi is installed on your system simply type dahdi_cfg -vvv command in another Linux window)

The Wanpipe driver will now start to compile on your Linux operating system.

Press ‘y’ to proceed

y

Press [enter] to continue

enter

Press [enter] to continue

a108

continue to press [enter] as seen below

continue

press [enter] to continue

You should end up with the following screen. If you see error messages, then you are missing system dependencies.

complete

continue to press [enter] when asked.

Press ‘y’ to install Wanpipe start scripts

startup

The following screen indicates that the Wanpipe driver has completed installation on your server and is now ready to start Configuring your Sangoma hardware on your system

final

If your Sangoma hardware was NOT detected by your system, or if the Wanpipe driver failed to install properly, the following screen will appear.

error

5. Configure the Sangoma Card

$ wancfg_dahdi

########################################################################
# Sangoma Wanpipe #
# Dahdi/Zaptel/SMG/TDMAPI/BOOT Configuration Script #
# v2.39 #
# Sangoma Technologies Inc. #
# Copyright(c) 2013. #
########################################################################

Would you like to generate /etc/asterisk/chan_dahdi.conf
1. YES
2. NO
[1-2]:2

——————————————————-
Configuring T1/E1 cards [A101/A102/A104/A108/A116/T116]
——————————————————-
A101 detected on slot:4 bus:2

———————————————————–
Configuring port 1 on A101 slot:4 bus:2.
———————————————————–

Select media type for AFT-A101 on port 1 [slot:4 bus:2 span:1]
1. T1
2. E1
3. Unused
4. Exit
[1-4]: 2

Configuring port 1 on AFT-A101 as E1, line coding:HDB3, framing:CRC4
1. YES – Keep these settings
2. NO – Configure line coding and framing
[1-2, ENTER=’YES’]:1

Select clock for AFT-101 on port 1 [slot:4 bus:2 span:1]
1. NORMAL
2. MASTER
[1-2]:1

Select signalling type for AFT-101 on port 1 [slot:4 bus:2 span:1]
1. Zaptel/Dahdi – PRI CPE
2. Zaptel/Dahdi – PRI NET
3. Zaptel/Dahdi – E & M
4. Zaptel/Dahdi – E & M Wink
5. Zaptel/Dahdi – FXS – Loop Start
6. Zaptel/Dahdi – FXS – Ground Start
7. Zaptel/Dahdi – FXS – Kewl Start
8. Zaptel/Dahdi – FX0 – Loop Start
9. Zaptel/Dahdi – FX0 – Ground Start
10. Zaptel/Dahdi – FX0 – Kewl Start
11. Sangoma SMG/sangoma_prid- PRI CPE
12. Sangoma SMG/sangoma_prid- PRI NET
[1-12]:1

Port 1 on AFT-A101 configuration complete…
Press any key to continue:

T1/E1 card configuration complete.
Press any key to continue:

——————————————–
Configuring ISDN BRI cards [A500/B500/B700]
——————————————–

No Sangoma ISDN BRI cards detected

Press any key to continue:
————————————
Configuring GSM cards [W400]
————————————

No Sangoma GSM cards detected

Press any key to continue:

###################################################################
# SUMMARY #
###################################################################

1 T1/E1 port(s) detected, 1 configured
0 ISDN BRI port(s) detected, 0 configured
0 analog card(s) detected, 0 configured
0 GSM card(s) detected, 0 configured
0 usb device(s) detected, 0 configured

Configurator will create the following files:
1. Wanpipe config files in /etc/wanpipe
2. Dahdi config file /etc/dahdi/system.conf

Your original configuration files will be saved to:
1. /etc/dahdi/system.conf.bak

Your configuration has been saved in /etc/wanpipe/debug-2014-10-17.tgz.
When requesting support, email this file to techdesk@sangoma.com

###################################################################
Configuration Complete! Please select following:
1. YES – Continue
2. NO – Exit
[1-2]: 1

Dahdi and Wanpipe configuration complete: choose action
1. Save cfg: Restart Asterisk & Wanpipe now
2. Save cfg: Restart Asterisk & Wanpipe when convenient
3. Save cfg: Stop Asterisk & Wanpipe now
4. Save cfg: Stop Asterisk & Wanpipe when convenient
5. Save cfg: Save cfg only (Not Recommended!!!)
6. Do not save cfg: Exit
[1-6]:3

Save the changes and stop the running wanpipe. We would need to do some small change manually later that was not offered on the configuration prompts

If you see the following screen below, simply press option 2 (YES) to proceed

no problem

Select option 1 to start Wanpipe on system boot. If your server ever reboots unintentionally, you will want the driver to automatically start in order to have your server back in production without manual intervention

start

Select option 1 (YES) to have ‘dahdi_cfg’ run after the Wanpipe driver starts. This step configures on Wanpipe ports for dahdi

yes

You have now fully installed and configured your Sangoma Hardware for your server!

6. Verify your installation of the Sangoma Wanpipe driver

# wanrouter hwprobe

——————————-
| Wanpipe Hardware Probe Info |
——————————-
1 . AFT-A101-SH : SLOT=4 : BUS=2 : IRQ=11 : CPU=A : PORT=1 : HWEC=0 : V=39

Sangoma Card Count: A101-2=1

7. Additional Steps

Remove echo cancelling on the E1 since this is not necessary and to reduce the load on the cards. comment out the line **,,echocanceller=mg2,1-15,17-31″** and restart wanrouter

vi /etc/dahdi/system.conf

wanrouter stop/start

Verify if the Card can detect the physical E1. The status should show **,,connected”**

wanrouter status

Devices currently active:
wanpipe1

Wanpipe Config:

Device name | Protocol Map | Adapter | IRQ | Slot/IO | If’s | CLK | Baud rate |
wanpipe1 | N/A | A101/1D/2/2D/4/4D/8/8D/16/16D| 16 | 4 | 1 | N/A | 0 |

Wanrouter Status:

Device name | Protocol | Station | Status |
wanpipe1 | AFT TE1 | N/A | Connected |

Verify if the dahdi driver can also see the Sangoma card

dahdi_scan

[1]
active=yes
alarms=OK
description=wanpipe1 card 0
name=WPE1/0
manufacturer=Sangoma Technologies
devicetype=A101
location=SLOT=4, BUS=2
basechan=1
totchans=31
irq=0
type=digital-E1
syncsrc=0
lbo=0 db (CSU)/0-133 feet (DSX-1)
coding_opts=HDB3
framing_opts=CCS,CRC4
coding=HDB3
framing=CCS/CRC4

cat /proc/dahdi/1

Span 1: WPE1/0 “wanpipe1 card 0” (MASTER) CCS/HDB3/CRC4

1 WPE1/0/1 Clear
2 WPE1/0/2 Clear
3 WPE1/0/3 Clear
4 WPE1/0/4 Clear
5 WPE1/0/5 Clear
6 WPE1/0/6 Clear
7 WPE1/0/7 Clear
8 WPE1/0/8 Clear
9 WPE1/0/9 Clear
10 WPE1/0/10 Clear
11 WPE1/0/11 Clear
12 WPE1/0/12 Clear
13 WPE1/0/13 Clear
14 WPE1/0/14 Clear
15 WPE1/0/15 Clear
16 WPE1/0/16 Hardware-assisted HDLC
17 WPE1/0/17 Clear
18 WPE1/0/18 Clear
19 WPE1/0/19 Clear
20 WPE1/0/20 Clear
21 WPE1/0/21 Clear
22 WPE1/0/22 Clear
23 WPE1/0/23 Clear
24 WPE1/0/24 Clear
25 WPE1/0/25 Clear
26 WPE1/0/26 Clear
27 WPE1/0/27 Clear
28 WPE1/0/28 Clear
29 WPE1/0/29 Clear
30 WPE1/0/30 Clear
31 WPE1/0/31 Clear

NOTE: dadhi and wanpipe offers different tools to check, verify or troubleshoot the sangoma card. Feel free to explore the commands below

wanrouter

wanpipemon

dahdi_

dahdi_cfg dahdi_map dahdi_span_assignments dahdi_tool
dahdi_genconf dahdi_monitor dahdi_span_types dahdi_waitfor_span_assignments
dahdi_hardware dahdi_registration dahdi_speed
dahdi_maint dahdi_scan dahdi_test

8. Setting up the Signalling MTP2/MTP3

Since Sangoma 101 card does not have an on board MTP2/MTP3. We would be using Telestax to configure the signalling stack of the signalling gateway.

Copy the pre – compiled Telestax folder to /usr/src

/usr/src/TelScale-jss7-6.1.3.GA

Run the telestax core

/usr/src/TelScale-jss7-6.1.3.GA/ss7/TelScale-ss7-sgw/bin/run.sh &

Open another terminal interface and connect to Telestax CLI interface

/usr/src/TelScale-jss7-6.1.3.GA/ss7/shell/bin/ss7-cli.sh

version=6.1.3.GA-TelScale,name=TelScale CLI,prefix=telscale,vendor=TeleStax
telscale> connect
Connected to TelScale CLI 6.1.3.GA-TelScale TeleStax
telscale(local)>

NOTE: pressing the table keys shows you the different commands to choose from

telscale(local)>
m3ua sccp sctp linkset history disconnect

Create linkset to establish MTP2/MTP3. You would need the details provided by the operator

telscale(local)> linkset create dahdi opc 888 apc 999 ni 2 dahdilinkset1

telscale(local)> linkset show
dahdilinkset1 dahdi opc=888 apc=999 ni=2 state=UNAVAILABLE

Next is we need to create the link/s within the linkset

telscale(local)> linkset link create span 1 code 0 channel 1 dahdilinkset1 link1

telscale(local)>linkset link show
dahdilinkset1 dahdi opc=888 apc=999 ni=2 state=UNAVAILABLE
link1 span=1 channelId=1 code=0 state=UNAVAILABLE

Please use the –help option to get the details and description of the different parameters. The _ChannelId_ would be the agreed timeslot with the carrier on which the clocking will be coming from. _code 0_ will be corresponding to sls 0

telscale(local)>linkset link create –help

We are now ready to enable the MTP links

telscale(local)> linkset link activate dahdilinkset1 link1

telscale(local)> linkset activate dahdilinkset1

Upon activation if therere is successful MTP2/MTP3 connection you will see the status as established

telscale(local)>linkset show
dahdilinkset1 dahdi opc=888 apc=999 ni=2 state=AVAILABLE
link1 span=1 channelId=1 code=0 state=AVAILABLE

Customize logging of telestax

vi /usr/src/TelScale-jss7-6.1.3.GA/ss7/TelScale-ss7-sgw/conf/log4j.xml

adjust this part on whatever logging you want


the logging will look like this assuming the physical E1 was correctly setup by the carrier.

tail -f /var/log/syslog /var/log/telestax.log

12:29:51,442 INFO [link1-0] State changed in link. NOT_ALIGNED –> ALIGNED
12:29:51,478 INFO [link1-0] State changed in link. ALIGNED –> PROVING
12:29:51,998 DEBUG [link1-0] (link1-0) Aligned ready
12:29:51,998 INFO [link1-0] State changed in link. PROVING –> ALIGNED_READY
12:29:52,017 DEBUG [link1-0] (link1-0) MTP now IN_SERVICE, Notifing layer 3
12:29:52,018 INFO [link1-0] State changed in link. ALIGNED_READY –> IN_SERVICE
12:29:52,018 DEBUG [Mtp3] (link1-0) Sending TRA(Traffic Restart Allowed) message
12:29:52,020 DEBUG [Mtp3] (link1-0) Starting link test procedure(SLTM/SLTA)
12:29:52,021 DEBUG [Mtp3] (link1-0) SLTM sent, try number = 1
12:29:52,062 DEBUG [Mtp3] (link1-0) Received SLTM
12:29:52,062 DEBUG [Mtp3] (link1-0) Responding with SLTA
12:29:52,077 DEBUG [Mtp3] (link1-0) Received SLTA
12:29:52,078 DEBUG [Mtp3] (link1-0) SLTM acknowledged, Link test passed
12:29:52,078 INFO [Mtp3] (link1-0) Link now IN_SERVICE
12:29:52,122 DEBUG [Mtp3] (link1-0) Signalling network management
12:29:52,122 DEBUG [Mtp3] (link1-0) Signalling network management
2014-10-17 12:30:36,330 DEBUG [Mtp3] (pool-4-thread-8) (link1-0) Received SLTM
2014-10-17 12:30:36,330 DEBUG [Mtp3] (pool-4-thread-8) (link1-0) Responding with SLTA

And dahdi should be able to see the signaling timeslot with status _In use_

cat /proc/dahdi/1

Span 1: WPE1/0 “wanpipe1 card 0” (MASTER) CCS/HDB3/CRC4

1 WPE1/0/1 Clear (In use)
2 WPE1/0/2 Clear
3 WPE1/0/3 Clear
4 WPE1/0/4 Clear
5 WPE1/0/5 Clear
6 WPE1/0/6 Clear
7 WPE1/0/7 Clear
8 WPE1/0/8 Clear
9 WPE1/0/9 Clear
10 WPE1/0/10 Clear
11 WPE1/0/11 Clear
12 WPE1/0/12 Clear
13 WPE1/0/13 Clear
14 WPE1/0/14 Clear
15 WPE1/0/15 Clear
16 WPE1/0/16 Hardware-assisted HDLC
17 WPE1/0/17 Clear
18 WPE1/0/18 Clear
19 WPE1/0/19 Clear
20 WPE1/0/20 Clear
21 WPE1/0/21 Clear
22 WPE1/0/22 Clear
23 WPE1/0/23 Clear
24 WPE1/0/24 Clear
25 WPE1/0/25 Clear
26 WPE1/0/26 Clear
27 WPE1/0/27 Clear
28 WPE1/0/28 Clear
29 WPE1/0/29 Clear
30 WPE1/0/30 Clear
31 WPE1/0/31 Clear

9. Setup M3UA Connection from the Server (SGW) to your SCTP Server. Assuming you have already setup the VPN connection.

Next is to create the Signalling connection to the SCTP server using again the jSS7 Stax

telscale(local)> sctp association create Assoc1 CLIENT 1.1.1.1 2905 2.2.2.2 2906

Verify it was successful

telscale(local)>sctp association show

ASSOCIATION SCTP name=Assoc1 started=true peerIp=1.1.1.1 peerPort=2905 hostIp=2.2.2.2 hostPort2906 type=CLIENT

Then we create the m3ua connection to the SCTP server, we need to create an AS and ASP profile to be linked to the SCTP profile

telscale(local)> m3ua asp create ASP1 Assoc1

telscale(local)> m3ua as create AS1 AS mode SE rc 1 traffic-mode override

telscale(local)> m3ua as add AS1 ASP1

telscale(local)> m3ua asp start ASP1

telscale(local)>m3ua asp show

ASP name=ASP1 aspid=3 sctpAssoc=Assoc1 started=true
Assigned to :
AS name=AS1 functionality=AS mode=SE localFSMState=ACTIVE

You should also see the Assoc with the STP server gets established

tail -f /var/log/telestax.log

2014-10-17 15:08:12,365 INFO [ShellServer] (pool-4-thread-8) received command : m3ua asp start ASP1
2014-10-17 15:08:12,366 INFO [AssociationImpl] (pool-4-thread-8) Started Association=Association [name=Assoc1, associationType=CLIENT, ipChannelType=SCTP, hostAddress=192.168.200.10, hostPort=2906, peerAddress=192.168.200.10, peerPort=2905, serverName=, extraHostAddress=[]]
2014-10-17 15:08:42,437 INFO [AssociationHandler] (Thread-1) New association setup for Association=Assoc1 with 5 outbound streams, and 5 inbound streams.
2014-10-17 15:08:42,437 DEBUG [FSM] FSM.name=ASP1_LOCAL old state=DOWN, current state=UP_SENT Transition to=commup
2014-10-17 15:08:42,438 DEBUG [AssociationImpl] messageInfo is null for Association=Assoc1
2014-10-17 15:08:42,437 DEBUG [FSM] (Thread-1) FSM.name=ASP1_LOCAL old state=DOWN, current state=UP_SENT Transition to=commup
2014-10-17 15:08:42,438 DEBUG [AssociationImpl] (Thread-1) messageInfo is null for Association=Assoc1
2014-10-17 15:08:42,438 DEBUG [AssociationImpl] Tx : Ass=Assoc1 PayloadData [dataLength=16, complete=true, unordered=true, payloadProtocolId=3, streamNumber=0, data=Start: 0 (0x00) End: 15 (0x0F) length: 16 (0x10) 00: 01 00 03 01 00 00 00 10 00 11 00 08 00 00 00 03 | …….. …….. ]
2014-10-17 15:08:42,438 DEBUG [AssociationImpl] (Thread-1) Tx : Ass=Assoc1 PayloadData [dataLength=16, complete=true, unordered=true, payloadProtocolId=3, streamNumber=0, data= Start: 0 (0x00) End: 15 (0x0F) Length: 16 (0x10) 00: 01 00 03 01 00 00 00 10 00 11 00 08 00 00 00 03 | …….. …….. ]
2014-10-17 15:08:42,452 DEBUG [AssociationImpl] Rx : Ass=Assoc1 PayloadData [dataLength=8, complete=true, unordered=false, payloadProtocolId=3, streamNumber=0, data=
2014-10-17 15:08:44,479 DEBUG [FSM] FSM.name=AS1_PEER old state=INACTIVE, current state=ACTIVE Transition to=ntfyasactive
2014-10-17 15:08:44,479 DEBUG [FSM] (Thread-1) FSM.name=AS1_PEER old state=INACTIVE, current state=ACTIVE Transition to=ntfyasactive

Next is to define the routing from MTP3 to M3UA

telscale(local)> m3ua route add AS1 888 999 -1

telscale(local)>m3ua route show

888:999:-1 AS1,

The route above indicates that traffic to DPC 888 from OPC 999 will be routed to AS1


NOTE: Traffic flow from M3UA to MTP3 will happen provided that the OPC and DPC of the M3UA traffic matches the reverse OPC and DPC of the defined linkset!

NOTE: Alternatively if you do not want to configure the SG Telestax via CLI you can opt to edit the configuration files found under directory /usr/src/TelScale-jss7-6.1.3.GA/ss7/TelScale-ss7-sgw/ss7 . Provided you have to shutdown the Telestax core before you make the changes, and start it again after making the changes

FacebookTwitterGoogle+Share

Leave a Comment

Your email address will not be published. Required fields are marked *