aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-05-30 13:09:58 +0200
committerHarald Welte <laforge@gnumonks.org>2013-06-05 11:16:40 +0200
commit54274d40c4583eb76a54a48b1b271726043fc122 (patch)
treec226131948fe62c0190f2ff95264af6213c55b28
parent51c4b5c2791ed304fc868badfe69e369f5834212 (diff)
mangle_tt_sri_sm: don't throw excaption if mangle_tt_sri_sm_pfx environment is not set
-rw-r--r--src/mangle_tt_sri_sm.erl28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/mangle_tt_sri_sm.erl b/src/mangle_tt_sri_sm.erl
index 25db695..a38cc22 100644
--- a/src/mangle_tt_sri_sm.erl
+++ b/src/mangle_tt_sri_sm.erl
@@ -166,21 +166,25 @@ check_for_tcap_op(Comp, Op, MapDec) ->
mangle_tt_sri_sm(from_msc, _Path, ?SCCP_MSGT_UDT, SccpDec = #sccp_msg{parameters=Opts}) ->
CalledParty = proplists:get_value(called_party_addr, Opts),
CalledGT = CalledParty#sccp_addr.global_title,
- {ok, PrefixList} = application:get_env(mgw_nat, mangle_tt_sri_sm_pfx),
- case gt_match_pfx_list(CalledGT, PrefixList) of
- true ->
+ case application:get_env(mgw_nat, mangle_tt_sri_sm_pfx) of
+ {ok, PrefixList} ->
+ case gt_match_pfx_list(CalledGT, PrefixList) of
+ true ->
case check_for_invoke_sri_sm(SccpDec) of
- true ->
- CalledGTNew = CalledGT#global_title{trans_type = 3},
- CalledPartyNew = CalledParty#sccp_addr{global_title = CalledGTNew},
- ParamsOut = lists:keyreplace(called_party_addr, 1, Opts,
- {called_party_addr, CalledPartyNew}),
- SccpDec#sccp_msg{parameters=ParamsOut};
- _ ->
- SccpDec
+ true ->
+ CalledGTNew = CalledGT#global_title{trans_type = 3},
+ CalledPartyNew = CalledParty#sccp_addr{global_title = CalledGTNew},
+ ParamsOut = lists:keyreplace(called_party_addr, 1, Opts,
+ {called_party_addr, CalledPartyNew}),
+ SccpDec#sccp_msg{parameters=ParamsOut};
+ _ ->
+ SccpDec
end;
- _ ->
+ _ ->
SccpDec
+ end;
+ _ ->
+ SccpDec
end;
mangle_tt_sri_sm(_, _, _, SccpIn) ->
SccpIn.