aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-06-18 19:33:50 +0200
committerHarald Welte <laforge@gnumonks.org>2013-06-18 19:33:50 +0200
commitd9b9aaa9cddab4527baa1bf7eb47ec379ae16627 (patch)
tree55108ded156a0dec6d7df014e5cf225aa142cc1b
parentf6259f4ff4842e295f5111424a9eaf2be0b553b2 (diff)
support local_out messages with GT but not pointcode
We cannot determine the MTP3 DPC from simply looking at the CalledParty GT address, as there is no PC in the GT. We have to use the result of the routing decision as MTP3 DPC in this case!
-rw-r--r--src/sccp_routing.erl8
-rw-r--r--src/sccp_scrc.erl21
2 files changed, 16 insertions, 13 deletions
diff --git a/src/sccp_routing.erl b/src/sccp_routing.erl
index 46f23a0..07cb6cb 100644
--- a/src/sccp_routing.erl
+++ b/src/sccp_routing.erl
@@ -147,7 +147,7 @@ route_local_out_action(1, SccpMsg, CalledParty) ->
% the message to SCLC or unless the message is discarded by the
% traffic limitation mechanism;
{ok, LsName} = ss7_routes:route_dpc(Pc),
- {remote, SccpMsg, LsName}
+ {remote, SccpMsg, LsName, Pc}
end;
% Acccording to 2.3.2 Action (2)
@@ -172,7 +172,7 @@ route_local_out_action(2, SccpMsg, CalledParty) ->
% unless the message is discarded by the traffic
% limitation mechanism
{ok, LsName} = ss7_routes:route_dpc(Dpc),
- {remote, SccpMsg, LsName}
+ {remote, SccpMsg, LsName, Dpc}
end
end;
@@ -192,7 +192,7 @@ route_local_out_action(3, SccpMsg, CalledParty) ->
% the message to SCLC or unless the message is discarded by the
% traffic limitation mechanism;
{ok, LsName} = ss7_routes:route_dpc(Pc),
- {remote, SccpMsg, LsName}
+ {remote, SccpMsg, LsName, Pc}
end;
% Acccording to 2.3.2 Action (4)
@@ -243,7 +243,7 @@ route_cr_connless(Mtp3Msg, SccpMsg) when is_record(SccpMsg, sccp_msg) ->
%route_main(SccpMsg),
%LsName = ss7_routes:route_dpc(),
%LsName = undefined,
- %{remote, SccpMsg, LsName}.
+ %{remote, SccpMsg, LsName, undefined}.
% CR or connectionless message, coming in from MTP
diff --git a/src/sccp_scrc.erl b/src/sccp_scrc.erl
index 01833ba..966de9a 100644
--- a/src/sccp_scrc.erl
+++ b/src/sccp_scrc.erl
@@ -181,9 +181,9 @@ idle(#primitive{subsystem = 'N', gen_name = 'UNITDATA',
idle(#primitive{subsystem = 'MTP', gen_name = 'TRANSFER',
spec_name = indication, parameters = Mtp3}, LoopDat) ->
case sccp_routing:route_mtp3_sccp_in(Mtp3) of
- {remote, SccpMsg2, LsName} ->
+ {remote, SccpMsg2, LsName, Dpc} ->
io:format("routed to remote?!?~n"),
- {ok, M3} = create_mtp3_out(SccpMsg2, LsName),
+ {ok, M3} = create_mtp3_out(SccpMsg2, LsName, Dpc),
% generate a MTP-TRANSFER.req primitive to the lower layer
send_mtp_transfer_down(M3, LsName),
LoopDat1 = LoopDat;
@@ -247,11 +247,7 @@ send_mtp_transfer_down(Mtp3) when is_record(Mtp3, mtp3_msg) ->
send_mtp_transfer_down(Mtp3, LsName) when is_record(Mtp3, mtp3_msg) ->
ss7_links:mtp3_tx(Mtp3, LsName).
-create_mtp3_out(SccpMsg, LsName) when is_record(SccpMsg, sccp_msg) ->
- CalledParty = proplists:get_value(called_party_addr,
- SccpMsg#sccp_msg.parameters),
- % we _have_ to have a destination point code here
- Dpc = CalledParty#sccp_addr.point_code,
+create_mtp3_out(SccpMsg, LsName, Dpc) when is_record(SccpMsg, sccp_msg) ->
case Dpc of
undefined ->
{error, dpc_undefined};
@@ -275,11 +271,18 @@ create_mtp3_out(SccpMsg, LsName) when is_record(SccpMsg, sccp_msg) ->
end
end.
+create_mtp3_out(SccpMsg, LsName) when is_record(SccpMsg, sccp_msg) ->
+ CalledParty = proplists:get_value(called_party_addr,
+ SccpMsg#sccp_msg.parameters),
+ % we _have_ to have a destination point code here
+ Dpc = CalledParty#sccp_addr.point_code,
+ create_mtp3_out(SccpMsg, LsName, Dpc).
+
send_sccp_local_out(LoopDat, SccpMsg) when is_record(SccpMsg, sccp_msg) ->
case sccp_routing:route_local_out(SccpMsg) of
- {remote, SccpMsg2, LsName} ->
+ {remote, SccpMsg2, LsName, Dpc} ->
% FIXME: get to MTP-TRANSFER.req
- {ok, M3} = create_mtp3_out(SccpMsg2, LsName),
+ {ok, M3} = create_mtp3_out(SccpMsg2, LsName, Dpc),
% generate a MTP-TRANSFER.req primitive to the lower layer
send_mtp_transfer_down(M3, LsName),
LoopDat;