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).
This commit is contained in:
Harald Welte 2013-04-24 12:33:53 +05:30
parent 5d4b3523c7
commit 455b4785b9
1 changed files with 5 additions and 1 deletions

View File

@ -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,