summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-12-08 00:56:54 +0100
committerHarald Welte <laforge@gnumonks.org>2011-12-08 00:56:54 +0100
commit683ed23bbd103372fa326f0a523dba5645271ef4 (patch)
tree9620d1d252d339bf7fbb4f34ae5e5ba8883500e8
parentba0ada720fc0bb838b1d5f05060677cc33c90901 (diff)
SCCP: support encoding of non-integer pointcodes (auto conversion)
-rw-r--r--src/sccp_codec.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sccp_codec.erl b/src/sccp_codec.erl
index b3989e6..39f25a2 100644
--- a/src/sccp_codec.erl
+++ b/src/sccp_codec.erl
@@ -269,13 +269,16 @@ encode_gt(#global_title{gti = GTind, phone_number = PhoneNum,
{GTind, <<TransType:8, NumPlan:4, Enc:4, 0:1, Nature:7, PhoneBin/binary>>}
end.
-encode_pc(PointCode) ->
+encode_pc(PointCode) when is_integer(PointCode) ->
case PointCode of
undef ->
{0, <<>>};
_ ->
{1, <<PointCode:16/little>>}
- end.
+ end;
+encode_pc(PcRec) ->
+ PcInt = osmo_util:pointcode2int(PcRec),
+ encode_pc(PcInt).
encode_ssn(SSN) ->
case SSN of