Skip to content

Commit

Permalink
KAZOO-3891: move wnm_util:classify_number/1 calls to knm_converters:c…
Browse files Browse the repository at this point in the history
…lassify/1
  • Loading branch information
fenollp committed Mar 3, 2016
1 parent 00412b4 commit 275f802
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion applications/callflow/src/module/cf_disa.erl
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ should_restrict_call_by_account(Call, Number) ->
case kz_account:fetch(whapps_call:account_id(Call)) of
{'error', _} -> 'false';
{'ok', JObj} ->
Classification = wnm_util:classify_number(Number),
Classification = knm_converters:classify(Number),
lager:info("classified number as ~p", [Classification]),
wh_json:get_value([<<"call_restriction">>, Classification, <<"action">>], JObj) =:= <<"deny">>
end.
2 changes: 1 addition & 1 deletion applications/callflow/src/module/cf_dynamic_cid.erl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ should_restrict_call(Call, Number) ->
case cf_endpoint:get(Call) of
{'error', _} -> 'false';
{'ok', JObj} ->
Classification = wnm_util:classify_number(Number),
Classification = knm_converters:classify(Number),
lager:info("classified number as ~s", [Classification]),
wh_json:get_value([<<"call_restriction">>, Classification, <<"action">>], JObj) =:= <<"deny">>
end.
Expand Down
2 changes: 1 addition & 1 deletion applications/cccp/src/cccp_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ is_number_restricted(Number, DocId, AccountDb) ->
case kz_datamgr:open_cache_doc(AccountDb, DocId) of
{'error', _} -> 'false';
{'ok', JObj} ->
Classification = wnm_util:classify_number(Number),
Classification = knm_converters:classify(Number),
wh_json:get_value([<<"call_restriction">>, Classification, <<"action">>], JObj) =:= <<"deny">>
end.

Expand Down
2 changes: 1 addition & 1 deletion applications/doodle/src/doodle_route_win.erl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ maybe_closed_group_restriction(JObj, Call) ->
-spec maybe_classification_restriction(wh_json:object(), whapps_call:call()) -> boolean().
maybe_classification_restriction(JObj, Call) ->
Number = whapps_call:request_user(Call),
Classification = wnm_util:classify_number(Number),
Classification = knm_converters:classify(Number),
lager:debug("classified number as ~s, testing for call restrictions", [Classification]),
wh_json:get_value([<<"call_restriction">>, Classification, <<"action">>], JObj) =:= <<"deny">>.

Expand Down
2 changes: 1 addition & 1 deletion applications/hotornot/src/hon_rater.erl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ maybe_get_rate_discount(JObj, AccountId) ->
'undefined';
{'ok', Def} ->
Number = wh_json:get_value(<<"To-DID">>, JObj),
Classification = wnm_util:classify_number(Number),
Classification = knm_converters:classify(Number),
lager:debug("~s number discount percentage: ~p", [Classification, Def]),
wh_json:get_value([<<"pvt_discounts">>, Classification, <<"percentage">>], Def)
end.
Expand Down
2 changes: 1 addition & 1 deletion applications/jonny5/src/j5_request.erl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ from_jobj(JObj) ->
,billing_seconds = wh_json:get_integer_value(<<"Billing-Seconds">>, JObj, 0)
,answered_time = wh_json:get_integer_value(<<"Answered-Seconds">>, JObj, 0)
,timestamp = wh_json:get_integer_value(<<"Timestamp">>, JObj, wh_util:current_tstamp())
,classification = wnm_util:classify_number(Number)
,classification = knm_converters:classify(Number)
,number = Number
,request_jobj = JObj
,request_ccvs = CCVs
Expand Down
2 changes: 1 addition & 1 deletion applications/trunkstore/src/ts_from_onnet.erl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ maybe_onnet_data(State) ->
end,
SrvOptions = wh_json:get_value([<<"server">>, <<"options">>], Options, wh_json:new()),
case knm_converters:is_reconcilable(ToDID)
orelse wnm_util:classify_number(ToDID) =:= <<"emergency">>
orelse knm_converters:classify(ToDID) =:= <<"emergency">>
orelse wh_json:is_true(<<"hunt_non_reconcilable">>, SrvOptions, 'false')
orelse whapps_config:get_is_true(?TS_CONFIG_CAT, <<"default_hunt_non_reconcilable">>, 'false')
of
Expand Down
2 changes: 1 addition & 1 deletion applications/trunkstore/src/ts_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ maybe_restrict_call(#ts_callflow_state{acctid=AccountId
}
,Command) ->
Number = props:get_value(<<"To-DID">>, Command),
Classification = wnm_util:classify_number(Number),
Classification = knm_converters:classify(Number),
lager:debug("Trunkstore classified number as ~p", [Classification]),
Username = wh_json:get_value([<<"Custom-Channel-Vars">>,<<"Username">>], RRObj),
Realm = wh_json:get_value([<<"Custom-Channel-Vars">>,<<"Realm">>], RRObj),
Expand Down
2 changes: 1 addition & 1 deletion core/whistle_apps/src/whapps_call.erl
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ maybe_format_caller_id(Call, Format) ->
-spec maybe_format_caller_id_str(ne_binary(), api_object()) -> ne_binary().
maybe_format_caller_id_str(Cid, 'undefined') -> Cid;
maybe_format_caller_id_str(Cid, Format) ->
Class = wnm_util:classify_number(Cid),
Class = knm_converters:classify(Cid),
lager:debug("checking for caller id reformating rules for ~s numbers", [Class]),
case wh_json:get_ne_value(Class, Format) of
'undefined' -> maybe_reformat_caller_id(Cid, wh_json:get_ne_value(<<"all">>, Format));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ update_number_quantities(Services, JObj) ->
Number = wh_doc:id(JObj),
ModuleName = wh_json:get_atom_value(?PVT_MODULE_NAME, JObj),
case is_number_billable(Number, ModuleName)
andalso wnm_util:classify_number(Number)
andalso knm_converters:classify(Number)
of
'false' -> Services;
'undefined' -> Services;
Expand Down

0 comments on commit 275f802

Please sign in to comment.