Asterisk ss7 setup

Setting up chan_ss7 between two Asterisk boxes


This page describes how to set up two Asterisk boxes with an SS7 link between them run by chan_ss7. This makes it possible to test and develop with chan_ss7 on a private SS7 test network, without the need for expensive SS7 test equipment.

Pre-requisites are two machines, each equipped with a properly installed zaptel E1 card, and each installed with a working Asterisk.

This guide assumes version 1.0 of chan_ss7.

Configuring the zaptel devices


The zaptel cards (for example Digium TE110P or TE410P) must be installed in each machine, and the appropriate driver must be installed.

To configure the cards, edit /etc/zaptel.conf appropriately. Since most of the work is done in userspace in chan_zap, a very basic configuration should be sufficient. On host A, something like this should be sufficient:

span=1,1,0,ccs,hdb3
bchan=1-31

and on host B:

span=1,0,0,ccs,hdb3
bchan=1-31


Note that host A is set up as sync source, while host B is not (the second number in the span= line). Also note that all timeslots are configured as bchan, including the signalling timeslot 16; this is because the signalling is handled entirely in userspace in chan_ss7.

After editing the config files, run ztcfg on both hosts to install the configuration.

wtih chan_ss7 1.3 and DAHDI there is HW MTP2 support

/etc/dahdi/system.conf
span=1,1,0,ccs,hdb3
mtp2=16
bchan=1-15,17-31

Tested HW MTP2 with Digium TE220 and Sangoma AFT A101 cards and it works like a charm. On Sangoma do not forget to set TDMV_DCHAN = 0 in /etc/wanpipe/wanpipe1.conf since signaling is handled by chan_ss7 as mentioned above.

Configuring Asterisk


On each host, Asterisk must be installed and configured appropriately. It is probably a good idea to hook up at least one of the hosts to some kind of phone (eg. with SIP), to make testing easier, but it is also possible to use call files or another approach. The important thing is that there is a way to generate a call on one (or both) of the hosts.

Now create the configuration file for chan_ss7, in /etc/asterisk/ss7.conf:

On host A and host B:

[linkset-siuc]

; The linkset is enabled
enabled => yes

; The end-of-pulsing (ST) is not used to determine when incoming address is complete
enable_st => no

; Reply incoming call with CON rather than ACM and ANM
use_connect => yes

; The CIC hunting policy is even CIC numbers, most recently used
hunting_policy => even_mru

; Incoming calls are placed in the ss7 context in the asterisk dialplan
context => ss7

; The language for this context is da
language => da

[link-l1]

; This link belongs to linkset siuc
linkset => siuc

; The speech/audio circuit channels on this link
channels => 1-15,17-31

; The signalling channel
schannel => 16

; The first CIC
firstcic => 1

; The link is enabled
enabled => yes

[link-l2]
linkset => siuc
channels => 1-15,17-31
schannel => 16
firstcic => 1
enabled => yes

[host-A]
; chan_ss7 auto-configures by matching the machines host name with the host-<name>
; section in the configuration file, in this case 'gentoo1'. The same
; configuration file can thus be used on several hosts.

; The host is enabled
enabled => yes

; The point code for this SS7 signalling point is 0x1
opc => 0x1

; The destination point (peer) code is 0x2 for linkset siuc
dpc => siuc:0x2

Syntax
links => link-name:digium-connector-no
; The links on the host is 'l1', connected to span/connector #1
links => l1:1

[host-B]
enabled => yes
opc => 0x2
dpc => siuc:0x1
links => l2:1


This sets up host A with destination point code 1, and host B with destination point code 2 (since this is a closed private SS7 network, these fake point codes are ok). 30 voice circuits are configured (timeslot 16 is used for signalling and is not available for voice). Incoming calls arrive in the dialplan in context ss7 on both hosts.

Compile and install the module chan_ss7.so as described in the README in the chan_ss7 source distribution.

Just to make things clear, module chan_dahdi is not required to be loaded in Asterisk.

Connect the two Asterisk boxes


Now obtain (or make yourself) an T1/PRI Crossover Cable (which also works for E1). Note that this is NOT the same as an Ethernet crosscable! The E1 cross cable connects pins as follows:

1 <----> 4
2 <----> 5
4 <----> 1
5 <----> 2

Using this cable, connect the E1 ports on the two machines (use the first port if multiple ports are installed). Check that the LED turns green, indicating a valid signal on the link.


Start chan_ss7


Now start Asterisk on each host (or if Asterisk is already running, type load chan_ss7.so in the console on each host to load the module). If all is well, chan_ss7 should now start the initial alignment procedure (which takes around two seconds), and then initialize the link by sending GROUP RESET on the voice circuits. congratulations! You now have a running SS7 network.

Playing with the setup


It is now possible to call back and forth between the two boxes using SS7. The syntax for an SS7 channel is SS7/<number>, for example SS7/004533447788. Thus, in the dialplan on one host you may write

Dial(SS7/004533447788)

and when that dialplan is executed, an incoming call on the other host will enter the dialplan in context `ss7' with extension 004533447788. So remember to setup the remote dialplan to handle that context/entension!

A quick test would be to setup a dialplan on host A to accept an incoming SIP call and issue the above Dial command. Then on host B, set up context `ss7' to play an announcement. Now it should be possible to call host A, get routed over SS7 to host B, and hear the announcement.

Now go on to play with chan_ss7, try connecting it to other non-Asterisk SS7 equipment, extend the code to handle whatever needs you have that are not served with the current code, and send in the patches!

Setting up chan_ss7 between two Asterisk boxes


This page describes how to set up two Asterisk boxes with an SS7 link between them run by chan_ss7. This makes it possible to test and develop with chan_ss7 on a private SS7 test network, without the need for expensive SS7 test equipment.

Pre-requisites are two machines, each equipped with a properly installed zaptel E1 card, and each installed with a working Asterisk.

This guide assumes version 1.0 of chan_ss7.

Configuring the zaptel devices


The zaptel cards (for example Digium TE110P or TE410P) must be installed in each machine, and the appropriate driver must be installed.

To configure the cards, edit /etc/zaptel.conf appropriately. Since most of the work is done in userspace in chan_zap, a very basic configuration should be sufficient. On host A, something like this should be sufficient:

span=1,1,0,ccs,hdb3
bchan=1-31

and on host B:

span=1,0,0,ccs,hdb3
bchan=1-31


Note that host A is set up as sync source, while host B is not (the second number in the span= line). Also note that all timeslots are configured as bchan, including the signalling timeslot 16; this is because the signalling is handled entirely in userspace in chan_ss7.

After editing the config files, run ztcfg on both hosts to install the configuration.

wtih chan_ss7 1.3 and DAHDI there is HW MTP2 support

/etc/dahdi/system.conf
span=1,1,0,ccs,hdb3
mtp2=16
bchan=1-15,17-31

Tested HW MTP2 with Digium TE220 and Sangoma AFT A101 cards and it works like a charm. On Sangoma do not forget to set TDMV_DCHAN = 0 in /etc/wanpipe/wanpipe1.conf since signaling is handled by chan_ss7 as mentioned above.

Configuring Asterisk


On each host, Asterisk must be installed and configured appropriately. It is probably a good idea to hook up at least one of the hosts to some kind of phone (eg. with SIP), to make testing easier, but it is also possible to use call files or another approach. The important thing is that there is a way to generate a call on one (or both) of the hosts.

Now create the configuration file for chan_ss7, in /etc/asterisk/ss7.conf:

On host A and host B:

[linkset-siuc]

; The linkset is enabled
enabled => yes

; The end-of-pulsing (ST) is not used to determine when incoming address is complete
enable_st => no

; Reply incoming call with CON rather than ACM and ANM
use_connect => yes

; The CIC hunting policy is even CIC numbers, most recently used
hunting_policy => even_mru

; Incoming calls are placed in the ss7 context in the asterisk dialplan
context => ss7

; The language for this context is da
language => da

[link-l1]

; This link belongs to linkset siuc
linkset => siuc

; The speech/audio circuit channels on this link
channels => 1-15,17-31

; The signalling channel
schannel => 16

; The first CIC
firstcic => 1

; The link is enabled
enabled => yes

[link-l2]
linkset => siuc
channels => 1-15,17-31
schannel => 16
firstcic => 1
enabled => yes

[host-A]
; chan_ss7 auto-configures by matching the machines host name with the host-<name>
; section in the configuration file, in this case 'gentoo1'. The same
; configuration file can thus be used on several hosts.

; The host is enabled
enabled => yes

; The point code for this SS7 signalling point is 0x1
opc => 0x1

; The destination point (peer) code is 0x2 for linkset siuc
dpc => siuc:0x2

Syntax
links => link-name:digium-connector-no
; The links on the host is 'l1', connected to span/connector #1
links => l1:1

[host-B]
enabled => yes
opc => 0x2
dpc => siuc:0x1
links => l2:1


This sets up host A with destination point code 1, and host B with destination point code 2 (since this is a closed private SS7 network, these fake point codes are ok). 30 voice circuits are configured (timeslot 16 is used for signalling and is not available for voice). Incoming calls arrive in the dialplan in context ss7 on both hosts.

Compile and install the module chan_ss7.so as described in the README in the chan_ss7 source distribution.

Just to make things clear, module chan_dahdi is not required to be loaded in Asterisk.

Connect the two Asterisk boxes


Now obtain (or make yourself) an T1/PRI Crossover Cable (which also works for E1). Note that this is NOT the same as an Ethernet crosscable! The E1 cross cable connects pins as follows:

1 <----> 4
2 <----> 5
4 <----> 1
5 <----> 2

Using this cable, connect the E1 ports on the two machines (use the first port if multiple ports are installed). Check that the LED turns green, indicating a valid signal on the link.


Start chan_ss7


Now start Asterisk on each host (or if Asterisk is already running, type load chan_ss7.so in the console on each host to load the module). If all is well, chan_ss7 should now start the initial alignment procedure (which takes around two seconds), and then initialize the link by sending GROUP RESET on the voice circuits. congratulations! You now have a running SS7 network.

Playing with the setup


It is now possible to call back and forth between the two boxes using SS7. The syntax for an SS7 channel is SS7/<number>, for example SS7/004533447788. Thus, in the dialplan on one host you may write

Dial(SS7/004533447788)

and when that dialplan is executed, an incoming call on the other host will enter the dialplan in context `ss7' with extension 004533447788. So remember to setup the remote dialplan to handle that context/entension!

A quick test would be to setup a dialplan on host A to accept an incoming SIP call and issue the above Dial command. Then on host B, set up context `ss7' to play an announcement. Now it should be possible to call host A, get routed over SS7 to host B, and hear the announcement.

Now go on to play with chan_ss7, try connecting it to other non-Asterisk SS7 equipment, extend the code to handle whatever needs you have that are not served with the current code, and send in the patches!

Created by: knielsen, Last modification: Fri 30 of Jul, 2010 (15:08 UTC) by cetanu
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+