summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-01-28 14:09:59 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-28 14:09:59 +0100
commit31da1fd8b04dd6de8915dde487d61a0decbe1b2e (patch)
tree07260d934b38256635b3335cccb4123b1f32afe9
parentf66bbfa97bd4b5232d168899208ca77bb6088843 (diff)
IPA ss7_link: Construct fake mtp3_routing_label{}
In SCCP-over-IPA links, we don't have MTP3 or something else that can transport a routing label. It's a true point-to-point connection and it cannot do MTP-based routing. In order to fit this into our existing SS7 link / linkset code, we locally construct a fake mtp3 routing label with the remote and local point code of the linkset.
-rw-r--r--src/ss7_link_ipa_client.erl12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ss7_link_ipa_client.erl b/src/ss7_link_ipa_client.erl
index c1c4b9d..e4db2ab 100644
--- a/src/ss7_link_ipa_client.erl
+++ b/src/ss7_link_ipa_client.erl
@@ -61,12 +61,13 @@ handle_cast(#primitive{subsystem='MTP', gen_name='TRANSFER', spec_name=request,
reconnect(LoopDat = #loop_dat{link=Link}) ->
#sigtran_link{local = Local, remote = Remote} = Link,
- #sigtran_peer{ip = LocalIp, port = LocalPort} = Local,
- #sigtran_peer{ip = RemoteIp, port = RemotePort} = Remote,
+ #sigtran_peer{ip = LocalIp, port = LocalPort, point_code = LocalPc} = Local,
+ #sigtran_peer{ip = RemoteIp, port = RemotePort, point_code = RemotePc} = Remote,
case ipa_proto:connect(RemoteIp, RemotePort, [], 10000) of
{ok, {Socket, IpaPid}} ->
set_link_state(LoopDat, up),
- ipa_proto:register_stream(Socket, 253, {callback_fn, fun ipa_tx_to_sccp/4, []}),
+ Mtp3Label = #mtp3_routing_label{sig_link_sel=0, origin_pc = RemotePc, dest_pc = LocalPc},
+ ipa_proto:register_stream(Socket, 253, {callback_fn, fun ipa_tx_to_sccp/4, [Mtp3Label]}),
set_link_state(LoopDat, active),
ipa_proto:unblock(Socket),
{ok, LoopDat#loop_dat{ipa_pid=IpaPid, socket=Socket}};
@@ -80,5 +81,6 @@ set_link_state(#loop_dat{link = #sigtran_link{linkset_name = LinksetName, sls =
% Callback that we pass to the ipa_proto, which it will call when it wants to
% send a primitive up the stack to SCCP
-ipa_tx_to_sccp(_Socket, 253, Data, _Args) ->
- ss7_links:mtp3_rx(#mtp3_msg{service_ind=?MTP3_SERV_SCCP, payload=Data}).
+ipa_tx_to_sccp(_Socket, 253, Data, [Mtp3Label]) ->
+ ss7_links:mtp3_rx(#mtp3_msg{service_ind=?MTP3_SERV_SCCP,
+ routing_label=Mtp3Label, payload=Data}).