summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-12-08 12:02:02 +0100
committerHarald Welte <laforge@gnumonks.org>2011-12-08 12:02:02 +0100
commiteecba250384b3eeef3a66f444deaed2934f19563 (patch)
tree0c2d5feb7199a2d4fa461133a8bd425413bbbb85
parent7ad37a2220e160f0a209b75d6c8ddc7ac3d08c3a (diff)
M3UA / MTP3: accept #mtp3_routing_label{} with tuple/record point codes
-rw-r--r--src/m3ua_codec.erl6
-rw-r--r--src/mtp3_codec.erl8
2 files changed, 9 insertions, 5 deletions
diff --git a/src/m3ua_codec.erl b/src/m3ua_codec.erl
index a01eec1..a1b03f8 100644
--- a/src/m3ua_codec.erl
+++ b/src/m3ua_codec.erl
@@ -89,9 +89,11 @@ encode_m3ua_opts([{Iei, Attr}|Tail], Bin) ->
encode_m3ua_opt(?M3UA_IEI_PROTOCOL_DATA, Mtp3) when is_record(Mtp3, mtp3_msg) ->
#mtp3_msg{network_ind = Ni, service_ind = Si,
routing_label = #mtp3_routing_label{sig_link_sel = Sls,
- origin_pc = Opc,
- dest_pc = Dpc},
+ origin_pc = OpcIn,
+ dest_pc = DpcIn},
payload = Payload, m3ua_mp = Mp} = Mtp3,
+ Opc = osmo_util:pointcode2int(OpcIn),
+ Dpc = osmo_util:pointcode2int(DpcIn),
case Mp of
undefined -> MpD = 0;
_ -> MpD = Mp
diff --git a/src/mtp3_codec.erl b/src/mtp3_codec.erl
index 0ab39ab..df5b6b1 100644
--- a/src/mtp3_codec.erl
+++ b/src/mtp3_codec.erl
@@ -38,10 +38,12 @@ parse_mtp3_msg(DataBin) when is_binary(DataBin) ->
payload = Payload}.
-encode_mtp3_routing_label(#mtp3_routing_label{sig_link_sel = Sls, origin_pc = Opc,
- dest_pc = Dpc}) ->
+encode_mtp3_routing_label(#mtp3_routing_label{sig_link_sel = Sls, origin_pc = OpcIn,
+ dest_pc = DpcIn}) ->
+ Opc = osmo_util:pointcode2int(OpcIn),
+ Dpc = osmo_util:pointcode2int(DpcIn),
<<Sls:4/big, Opc:14/big, Dpc:14/big>>.
-
+
encode_mtp3_msg(#mtp3_msg{network_ind = NetInd, service_ind = ServiceInd,
routing_label = RoutLbl, payload = Payload}) ->
RoutLblBin = encode_mtp3_routing_label(RoutLbl),