summaryrefslogtreecommitdiffstats
path: root/src/sccp_codec.erl
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-01-23 14:13:05 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-23 14:13:05 +0100
commitc923a2ab0b4d127d5f43f4fe7c42815dc0436d0a (patch)
tree56ab5c25045f87ca0a94d18157c03c94e7d1edf4 /src/sccp_codec.erl
parent9ebf3164f627ebe29d65ae1fdfb37de753c627fc (diff)
sccp codec: ensure correct encoding of 'undefined' point code
Diffstat (limited to 'src/sccp_codec.erl')
-rw-r--r--src/sccp_codec.erl9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/sccp_codec.erl b/src/sccp_codec.erl
index eb07fb6..2ec50cf 100644
--- a/src/sccp_codec.erl
+++ b/src/sccp_codec.erl
@@ -274,13 +274,10 @@ 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(undefined) ->
+ {0, <<>>};
encode_pc(PointCode) when is_integer(PointCode) ->
- case PointCode of
- undefined ->
- {0, <<>>};
- _ ->
- {1, <<PointCode:16/little>>}
- end;
+ {1, <<PointCode:16/little>>};
encode_pc(PcRec) ->
PcInt = osmo_util:pointcode2int(PcRec),
encode_pc(PcInt).