From eecba250384b3eeef3a66f444deaed2934f19563 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 8 Dec 2011 12:02:02 +0100 Subject: M3UA / MTP3: accept #mtp3_routing_label{} with tuple/record point codes --- src/m3ua_codec.erl | 6 ++++-- src/mtp3_codec.erl | 8 +++++--- 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), <>. - + encode_mtp3_msg(#mtp3_msg{network_ind = NetInd, service_ind = ServiceInd, routing_label = RoutLbl, payload = Payload}) -> RoutLblBin = encode_mtp3_routing_label(RoutLbl), -- cgit v1.2.3