From 455b4785b9ae75eb134aa6ca625c309283446a12 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 24 Apr 2013 12:33:53 +0530 Subject: fix isup_party_nat00_internationalize() for empty number Avoid running into an exception in case the calling party is an empty number "[]" (I guess call screening is applied). --- src/mgw_nat.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mgw_nat.erl b/src/mgw_nat.erl index 944543c..c67730a 100644 --- a/src/mgw_nat.erl +++ b/src/mgw_nat.erl @@ -341,7 +341,11 @@ isup_party_nat00_internationalize(PartyNum) -> #party_number{phone_number = DigitsIn, nature_of_addr_ind = Nature} = PartyNum, case Nature of ?ISUP_ADDR_NAT_NATIONAL -> - {Pfx, Remain} = lists:split(2, DigitsIn), + if length(DigitsIn) < 2 -> + {Pfx, Remain} = {DigitsIn, []}; + true -> + {Pfx, Remain} = lists:split(2, DigitsIn) + end, if Pfx == [0, 0] -> DigitsOut = Remain, NatureOut = ?ISUP_ADDR_NAT_INTERNATIONAL, -- cgit v1.2.3