JBoss.orgCommunity Documentation
The Signaling Connection Control Part (SCCP) is defined in ITU-T Recommendations Q.711-Q.716. SCCP sits on top of Message Transfer Part 3 (MTP3) in the SS7 protocol stack. The SCCP provides additional network layer functions to provide transfer of noncircuit-related (NCR) signaling information, application management procedures and alternative and more flexible methods of routing.
Routing rules are persisted within file. By default its
sccp-routing.txt
.
This file is managed by
SCCP
stack and
SS7 Service
, it is not encouraged practice to edit this file by hand. However for complete rerefence, you can find structure of this file below:
sequence;pattern;translation;mtpinfo
Fields within
pattern
,
translation
and
mtp
,
separated by
#
, empty value is indicated by single
space
. Each part of routing entry is separated by
;
.
is simple sequence number, each entry increases it by 1.
is simply
SCCP
like regular expresion. Destination address of message is matched against this to check which rule should be triggered.
Table 6.1. pattern content
Name | Type | Description |
---|---|---|
translation type | java.lang.Integer | Network specific ID which determines how global title analysis is performed. |
numbering plan | enum | Determines which numbering plan is used for global title. It can have one of following values: UNKNOWN, ISDN_TELEPHONY, DATA, TELEX, MERITIME_MOBILE, LAND_MOBILE, ISDN_MOBILE |
nature of address | enum | Determines type of address. It can have one of following values: SPARE, SUBSCRIBER, UNKNOWN, NATIONAL, INTERNATIONAL |
digits | java.lang.String | Simply digits of number, ie: +91 417688345892 |
sub-system number | java.lang.Integer | local subsystem number, used to route between local services in SS7, ie. between HLR and VLR. |
has the same structure as
pattern
. If
pattern
matches, destintion address is changed to
translation
.
mtpinfo
indicates which link should be chosen when routing to remote location. In case routing is performed localy, its not present.
Table 6.2. mtpinfo content
Name | Type | Description |
---|---|---|
name | java.lang.String | |
adjacent point code | java.lang.Integer | point code of remote, mtp link. |
origin point code | java.lang.Integer | polint code of local, mtp link. |
signaling link selector | java.lang.Integer | number indicating TDM multiplexed link. |
Example file entry looks as follows:
Example 6.1. sccp-routing.txt example entry
0; #ISDN_MOBILE#NATIONAL#9023629581# ; #ISDN_MOBILE#INTERNATIONAL#79023629581# ;linkset#14083#14155#0
is set to 0, since its only rule in a file(or first).
matches natioan mobile number with following digits: 9023629581
changes destination to international mobile with following digits: 79023629581
. Since no sub-system number is present, this rule requires mtpinfo
to indicate target.
indicates link through which message will be sent to next hop. Link:
Belongs to linkset with name equal to linkset
.
Adjacent point code is equal to 14083
.
Origin point code is equal to 14155
.
Signaling link selector is equal to 0
. Note that this value may be overriden by transport layer.
The org.mobicents.protocols.ss7.sccp.SccpStack
is responsible for taking the
config file and turning it into org.mobicents.protocols.ss7.sccp.Router
.
All the sccp messages sent bu SCCP User Part are routed as per the rule configured in Router
The SCCP User Part gets handle to SccpStack
by doing JNDI look-up as
explained in Section 6.4, “Access Point”
SccpStack
exposes org.mobicents.protocols.ss7.sccp.SccpProvider
that interacts directly with SccpStack. This interface defines the methods that will be used by SCCP User Part to send
org.mobicents.protocols.ss7.sccp.message.SccpMessage
and register
org.mobicents.protocols.ss7.sccp.SccpListener
's to listen for incoming SCCP messages.
SCCP User Part registers SccpListener for specific local org.mobicents.protocols.ss7.sccp.parameter.SccpAddress
.
For every incoming SccpMessage, if the called party address matches with this local SccpAddress, the corresponding SccpListner is called.
SccpProvider also exposes org.mobicents.protocols.ss7.sccp.message.MessageFactory
and
org.mobicents.protocols.ss7.sccp.parameter.ParameterFactory
to create new concrete SccpMessage viz.,
org.mobicents.protocols.ss7.sccp.message.UnitData
or
org.mobicents.protocols.ss7.sccp.message.XUnitData
passing the corresponding parameters created by leveraging
ParameterFactory.
The UML class diagram looks like
SS7 Service
provides user with access point to SCCP
protocol/stack.
To get handle to SccpStack
do the JNDI look-up passing the
JNDI name configured in SS7 service as explained in Section 3.2.4, “Configuring SS7Service”
private static SccpProvider getSccpProvider() throws NamingException {
// no arg is ok, if we run in JBoss
InitialContext ctx = new InitialContext();
try {
String providerJndiName = "/mobicents/ss7/sccp";
return ((SccpStack) ctx.lookup(providerJndiName)).getSccpProvider();
} finally {
ctx.close();
}
}
Below is SCCP User Part example listening for incoming SCCP message and sending back new message
public class Test implements SccpListener {
private SccpProvider sccpProvider;
private SccpAddress localAddress;
private static SccpProvider getSccpProvider() throws NamingException {
// no arg is ok, if we run in JBoss
InitialContext ctx = new InitialContext();
try {
String providerJndiName = "/mobicents/ss7/sccp";
return ((SccpStack) ctx.lookup(providerJndiName)).getSccpProvider();
} finally {
ctx.close();
}
}
public void start() throws Excetpion {
this.sccpProvider = getSccpProvider();
int translationType = 0;
int subSystemNumber = 0;
GlobalTitle gt = GlobalTitle.getInstance(translationType,
NumberingPlan.ISDN_MOBILE, NatureOfAddress.NATIONAL, "1234");
localAddress = new SccpAddress(gt, 0);
this.sccpProvider.registerSccpListener(localAddress, this);
}
public void stop() {
this.sccpProvider.deregisterSccpListener(localAddress);
}
public void onMessage(SccpMessage message) {
if (message.getType() == MessageType.UDT) {
throw new IlleagalArgumentException("Dont like UDT");
} else if (message.getType() == MessageType.XUDT) {
XUnitData xudt = (XUnitData) message;
localAddress = ((XUnitData) message).getCalledPartyAddress();
SccpAddress remoteAddress = ((XUnitData) message)
.getCallingPartyAddress();
// now decode content
byte[] data = xudt.getData();
// some data encoded in
CallRequest cr = new CallRequest(data);
byte[] answerData;
if (cr.getCallee().equals(this.localAddress)) {
EstablihsCallAnswer eca = new EstablihsCallAnswer(cr);
answerData = eca.encode();
} else {
TearDownCallAnswer tdca = new TearDownCallAnswer(cr);
answerData = tdca.encode();
}
HopCounter hc = this.sccpProvider.getParameterFactory()
.createHopCounter(5);
XUnitData sccpAnswer = this.sccpProvider
.getMessageFactory()
.createXUnitData(hc, xudt.getProtocolClass(),
message.getCallingPartyAddress(), this.localAddress);
this.sccpProvider.send(sccpAnswer);
}
}
}