diff --git a/ecallmgr/src/ecallmgr_authz.erl b/ecallmgr/src/ecallmgr_authz.erl index e1caf70662f..c5ae295265b 100644 --- a/ecallmgr/src/ecallmgr_authz.erl +++ b/ecallmgr/src/ecallmgr_authz.erl @@ -168,8 +168,9 @@ authorize(AccountId, Props) -> ReqResp = wh_amqp_worker:call(?ECALLMGR_AMQP_POOL ,authz_req(AccountId, Props) ,fun wapi_authz:publish_req/1 - ,fun wapi_authz:resp_v/1), - case ReqResp of + ,fun wapi_authz:resp_v/1 + ,5000), + case ReqResp of {error, _R} -> lager:debug("authz request lookup failed: ~p", [_R]), authz_default(); diff --git a/whistle_apps/apps/jonny5/src/j5_call_cdr.erl b/whistle_apps/apps/jonny5/src/j5_call_cdr.erl index b9a2b23148a..d2f67d5bf63 100644 --- a/whistle_apps/apps/jonny5/src/j5_call_cdr.erl +++ b/whistle_apps/apps/jonny5/src/j5_call_cdr.erl @@ -18,12 +18,12 @@ handle_req(JObj, _Props) -> timer:sleep(crypto:rand_uniform(0, 1000)), CCV = wh_json:get_value(<<"Custom-Channel-Vars">>, JObj, wh_json:new()), case wh_json:get_value(<<"Account-Billing">>, CCV) of - <<"per_minute">> -> reconcile_cost(wh_json:get_value(<<"Account-ID">>, CCV), JObj); - _ -> ok + <<"flat_rate">> -> ok; + _ -> reconcile_cost(wh_json:get_value(<<"Account-ID">>, CCV), JObj) end, case wh_json:get_value(<<"Reseller-Billing">>, CCV) of - <<"per_minute">> -> reconcile_cost(wh_json:get_value(<<"Reseller-ID">>, CCV), JObj); - _ -> ok + <<"flat_rate">> -> ok; + _ -> reconcile_cost(wh_json:get_value(<<"Reseller-ID">>, CCV), JObj) end. -spec reconcile_cost/2 :: ('undefined' | ne_binary(), wh_json:json_object()) -> 'ok'. @@ -60,9 +60,8 @@ reconcile_cost(Ledger, JObj) -> extract_cost(JObj) -> BillingSecs = wh_json:get_integer_value(<<"Billing-Seconds">>, JObj), CCVs = wh_json:get_value(<<"Custom-Channel-Vars">>, JObj), - DefaultRate = whapps_config:get_float(<<"jonny5">>, <<"default_rate">>, ?DEFAULT_RATE), DefaultRateIncr = whapps_config:get_integer(<<"jonny5">>, <<"default_rate_increment">>, 60), - Rate = wh_json:get_float_value(<<"Rate">>, CCVs, DefaultRate), + Rate = wh_json:get_float_value(<<"Rate">>, CCVs, 0.0), RateIncr = wh_json:get_integer_value(<<"Rate-Increment">>, CCVs, DefaultRateIncr), RateMin = wh_json:get_integer_value(<<"Rate-Minimum">>, CCVs, 0), Surcharge = wh_json:get_float_value(<<"Surcharge">>, CCVs, 0.0),