Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

KAZOO-786 #10

Closed
wants to merge 3 commits into from

3 participants

@jamesaimonetti
Collaborator

Your second diff, "include normalization", won't be included. I'm not sure what build errors you're getting to need that change of path. What errors are you getting? File a bug and issue a pull request against it so we can see why you think its needed. We have no issues with it as is.

I think your first diff is fine though, good to not coerce the types in this case. We are adding the single quotes around atoms to be explicit about their type - if you can adjust your patch to wrap true/false as 'true' and 'false', that'd be great!

@lazedo
Collaborator
@lazedo
Collaborator
@k-anderson
Owner

Howdy,

I am using VIM to edit the views but their format bothers me (some are leading commas others trailing, some even mix this, and we haven't found a way we all agree on for putting JSON in a string). Ultimately we just keep doing what we have been until we come up with a better way, suggestions welcome! What errors did you find?

We calculate it each time because it grew organically. Originally only jonny5 needed the amounts, then the UI started calculating it in the call history display in the browser. When we (backend guys) saw this we said we would send it so it was under our control and the easiest way to support CDRs that didnt have a precomputed amount was to simply do it each time. Its not too expensive as bigcouch only has to run the view on new CDRs (unless you flush the view indexs). Prior to v2.12 the calculation logic was specific to jonny5 (except for the part in whapps_util, which was left over from the our oldest module Trunkstore). We didnt want to make a dependency between jonny5 and the cdr whapp (or duplicate that code). However, now that Peter has built wht_utils the cdr whapp could safely execute the same logic as jonny5, adding a cost to the cdr prior to save. For backward compatibility the view will need to be able to calculate the cost if the precomputed is not present... Anyway we are about to significantly refactor cdr storage and I am sure this will be addressed :)

Calling whapps_maintenance:refresh() will update all views in all account dbs as well as the aggregate dbs (accounts, sip_auth, ect). However since it attempts to write status to a stream (assumed to be the Erlang shell) you need to use blocking_refresh when calling it from the sup tool. IE: sup whapps_maintenance blocking_refresh

Thanks!

@lazedo
Collaborator
@k-anderson
Owner

Ah nice find, thanks! If you want credit in the git history feel free to issue a separate pull request with the corrected view :)

Kazoo keeps cdrs per-leg (channel). If you hit a ring group of four endpoints you will end up with five cdrs (the originating leg and four endpoints). One of the up-coming tasks is to thread the cdrs together so you see them grouped by call or condensed. That hasn't been designed fully yet but should be a simple backend improvement to the API.

@k-anderson
Owner

Thank you for your contribution!

I have cherry-picked the parts change to the view and wh_util. With regards to your include normalization I was not able to compile with those changes. For example in cb_about.erl the include specifies the header is in the local directory but it is actually in the parent. I am not sure how you are able to compile it ;)

If we can find a happy common ground that works for you and still compiles via our makefile I would be will do include it.

For future reference, please submit as pull requests as specific as possible. We would have preferred to have seen this as three separate requests.

@k-anderson k-anderson closed this
@lazedo
Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 66 additions and 66 deletions.
  1. +6 −6 lib/whistle-1.0.0/src/wh_util.erl
  2. +1 −1  whistle_apps/apps/crossbar/priv/couchdb/account/cdrs.json
  3. +1 −1  whistle_apps/apps/crossbar/priv/couchdb/account/transactions.json
  4. +1 −1  whistle_apps/apps/crossbar/src/crossbar.hrl
  5. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_about.erl
  6. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_accounts.erl
  7. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_acls.erl
  8. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_agents.erl
  9. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_api_auth.erl
  10. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_braintree.erl
  11. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_bulk.erl
  12. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_callflows.erl
  13. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_cdrs.erl
  14. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_clicktocall.erl
  15. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_conferences.erl
  16. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_configs.erl
  17. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_connectivity.erl
  18. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_contact_list.erl
  19. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_devices.erl
  20. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_directories.erl
  21. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_events.erl
  22. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_events_srv.erl
  23. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_faxes.erl
  24. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_global_provisioner_templates.erl
  25. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_global_resources.erl
  26. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_groups.erl
  27. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_hotdesks.erl
  28. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_ip_auth.erl
  29. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_killio.erl
  30. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_limits.erl
  31. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_local_provisioner_templates.erl
  32. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_local_resources.erl
  33. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_media.erl
  34. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_menus.erl
  35. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_modules_util.erl
  36. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_noauthn.erl
  37. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_noauthz.erl
  38. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_onboard.erl
  39. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_phone_numbers.erl
  40. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_queues.erl
  41. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_rates.erl
  42. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_registrations.erl
  43. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_schemas.erl
  44. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_servers.erl
  45. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_service_plans.erl
  46. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_services.erl
  47. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_shared_auth.erl
  48. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_signup.erl
  49. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_simple_authz.erl
  50. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_skels.erl
  51. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_templates.erl
  52. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_temporal_rules.erl
  53. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_token_auth.erl
  54. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_transactions.erl
  55. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_user_auth.erl
  56. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_users.erl
  57. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_vmboxes.erl
  58. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_webhooks.erl
  59. +1 −1  whistle_apps/apps/crossbar/src/modules/cb_whitelabel.erl
  60. +1 −1  whistle_apps/apps/crossbar/src/modules/provisioner_contact_list.erl
  61. +1 −1  whistle_apps/apps/crossbar/src/modules/provisioner_util.erl
View
12 lib/whistle-1.0.0/src/wh_util.erl
@@ -690,9 +690,9 @@ a1hash(User, Realm, Password) ->
-spec floor(integer() | float()) -> integer().
floor(X) when X < 0 ->
T = trunc(X),
- case X - T =:= 0 of
- 'true' -> T;
- 'false' -> T - 1
+ case X - T == 0 of
+ true -> T;
+ false -> T - 1
end;
floor(X) -> trunc(X).
@@ -701,9 +701,9 @@ floor(X) -> trunc(X).
ceiling(X) when X < 0 -> trunc(X);
ceiling(X) ->
T = trunc(X),
- case X - T =:= 0 of
- 'true' -> T;
- 'false' -> T + 1
+ case X - T == 0 of
+ true -> T;
+ false -> T + 1
end.
%% returns current seconds
View
2  whistle_apps/apps/crossbar/priv/couchdb/account/cdrs.json
@@ -3,7 +3,7 @@
"language": "javascript",
"views": {
"crossbar_listing": {
- "map": "function (doc) {if (doc.pvt_deleted || doc.pvt_type != 'cdr') return;if (doc.pvt_type == 'cdr' && doc.custom_channel_vars && (doc.custom_channel_vars.account_billing == 'per_minute' || doc.custom_channel_vars.account_billing == 'per_minute_limit') && doc.custom_channel_vars.account_id == doc.pvt_account_id && doc.pvt_vsn && parseInt(doc.pvt_vsn) == 2) {var Secs = (parseInt(doc.billing_seconds) || 0) - (parseInt(doc.custom_channel_vars.billing_seconds_offset) || 0);var Cost = 0;if (Secs >= 1) {var R = parseInt(doc.custom_channel_vars.rate) || 0;var RInc = parseInt(doc.custom_channel_vars.increment) || 60;var RMin = parseInt(doc.custom_channel_vars.rate_minimum) || 0;var Sur = parseInt(doc.custom_channel_vars.surcharge) || 0;if (RInc < 1) {RInc = 60;}if (Secs <= RMin) {Cost = Sur + ((RMin / 60) * R);} else {Cost = Sur + ((RMin / 60) * R) + (Math.ceil((Secs - RMin) / RInc) * ((RInc / 60) * R));}}}if (Cost) {var Discount = (parseInt(doc.custom_channel_vars.discount_percentage) || 0) * 0.01 * Cost;emit(doc.pvt_created, {id: doc._id,caller_id_name: doc.caller_id_name,caller_id_number: doc.caller_id_number,callee_id_name: doc.callee_id_name,callee_id_number: doc.callee_id_number,duration_seconds: doc.duration_seconds,billing_seconds: doc.billing_seconds,timestamp: doc.timestamp,hangup_cause: doc.hangup_cause,other_leg_call_id: doc.other_leg_call_id,owner_id: doc.custom_channel_vars.owner_id,to: doc.to_uri,from: doc.from_uri,inception: doc.custom_channel_vars.inception,cost: Cost - Discount});} else {emit(doc.pvt_created, {id: doc._id,caller_id_name: doc.caller_id_name,caller_id_number: doc.caller_id_number,callee_id_name: doc.callee_id_name,callee_id_number: doc.callee_id_number,duration_seconds: doc.duration_seconds,billing_seconds: doc.billing_seconds,timestamp: doc.timestamp,hangup_cause: doc.hangup_cause,other_leg_call_id: doc.other_leg_call_id,owner_id: doc.custom_channel_vars.owner_id,to: doc.to_uri,from: doc.from_uri,inception: doc.custom_channel_vars.inception});}}"
+ "map": "function (doc) {if (doc.pvt_deleted || doc.pvt_type != 'cdr') return;if (doc.pvt_type == 'cdr' && doc.custom_channel_vars && (doc.custom_channel_vars.account_billing == 'per_minute' || doc.custom_channel_vars.account_billing == 'per_minute_limit') && doc.custom_channel_vars.account_id == doc.pvt_account_id && doc.pvt_vsn && parseInt(doc.pvt_vsn) == 2) {var Secs = (parseInt(doc.billing_seconds) || 0) - (parseInt(doc.custom_channel_vars.billing_seconds_offset) || 0);var Cost = 0;if (Secs >= 1) {var R = parseInt(doc.custom_channel_vars.rate) || 0;var RInc = parseInt(doc.custom_channel_vars.rate_increment) || 60;var RMin = parseInt(doc.custom_channel_vars.rate_minimum) || 0;var Sur = parseInt(doc.custom_channel_vars.surcharge) || 0;if (RInc < 1) {RInc = 60;}if (Secs <= RMin) {Cost = Sur + ((RMin / 60) * R);} else {Cost = Sur + ((RMin / 60) * R) + (Math.ceil((Secs - RMin) / RInc) * ((RInc / 60) * R));}}}if (Cost) {var Discount = (parseInt(doc.custom_channel_vars.discount_percentage) || 0) * 0.01 * Cost;emit(doc.pvt_created, {id: doc._id,caller_id_name: doc.caller_id_name,caller_id_number: doc.caller_id_number,callee_id_name: doc.callee_id_name,callee_id_number: doc.callee_id_number,duration_seconds: doc.duration_seconds,billing_seconds: doc.billing_seconds,timestamp: doc.timestamp,hangup_cause: doc.hangup_cause,other_leg_call_id: doc.other_leg_call_id,owner_id: doc.custom_channel_vars.owner_id,to: doc.to_uri,from: doc.from_uri,inception: doc.custom_channel_vars.inception,cost: Cost - Discount});} else {emit(doc.pvt_created, {id: doc._id,caller_id_name: doc.caller_id_name,caller_id_number: doc.caller_id_number,callee_id_name: doc.callee_id_name,callee_id_number: doc.callee_id_number,duration_seconds: doc.duration_seconds,billing_seconds: doc.billing_seconds,timestamp: doc.timestamp,hangup_cause: doc.hangup_cause,other_leg_call_id: doc.other_leg_call_id,owner_id: doc.custom_channel_vars.owner_id,to: doc.to_uri,from: doc.from_uri,inception: doc.custom_channel_vars.inception});}}"
},
"listing_by_owner" : {
"map": "function(doc) { if(doc.pvt_deleted || !doc.custom_channel_vars.owner_id || doc.pvt_type != 'cdr') return; emit([doc.custom_channel_vars.owner_id, doc.pvt_created], {'id':doc._id, 'caller_id_name': doc.caller_id_name, 'caller_id_number': doc.caller_id_number, 'callee_id_name': doc.callee_id_name, 'callee_id_number': doc.callee_id_number, 'duration_seconds': doc.duration_seconds, 'timestamp': doc.timestamp, 'hangup_cause':doc.hangup_cause, 'other_leg_call_id':doc.other_leg_call_id, 'call_direction':doc.call_direction, 'to': doc.to_uri, 'from': doc.from_uri, 'inception':doc.custom_channel_vars.inception})}"
View
2  whistle_apps/apps/crossbar/priv/couchdb/account/transactions.json
@@ -18,7 +18,7 @@
"map": "function(doc) { if ( (doc.pvt_type != 'credit' && doc.pvt_type != 'debit') || doc.pvt_deleted) return; emit(doc.pvt_created, doc._id); }"
},
"reconcile_by_callid": {
- "map": "function (doc) {if (doc.pvt_deleted || (doc.pvt_type != 'cdr' && doc.pvt_type != 'credit' && doc.pvt_type != 'debit') || !doc.pvt_vsn || parseInt(doc.pvt_vsn) != 2) return;if (doc.pvt_type == 'cdr' && doc.custom_channel_vars && (doc.custom_channel_vars.account_billing == 'per_minute' || doc.custom_channel_vars.account_billing == 'per_minute_limit') && doc.custom_channel_vars.account_id == doc.pvt_account_id) {var Secs = (parseInt(doc.billing_seconds) || 0) - (parseInt(doc.custom_channel_vars.billing_seconds_offset) || 0);var Cost = 0;if (Secs >= 1) {var R = parseInt(doc.custom_channel_vars.rate) || 0;var RInc = parseInt(doc.custom_channel_vars.increment) || 60;var RMin = parseInt(doc.custom_channel_vars.rate_minimum) || 0;var Sur = parseInt(doc.custom_channel_vars.surcharge) || 0;if (RInc < 1) {RInc = 60;}if (Secs <= RMin) {Cost = Sur + ((RMin / 60) * R);} else {Cost = Sur + ((RMin / 60) * R) + (Math.ceil((Secs - RMin) / RInc) * ((RInc / 60) * R));}}if (Cost) {var Discount = (parseInt(doc.custom_channel_vars.discount_percentage) || 0) * 0.01 * Cost;emit(doc._id, Cost - Discount);}} else if (doc.pvt_code && parseInt(doc.pvt_code) == 1001 && doc.call_id) {var modifier = (doc.pvt_type == 'credit' ? 1 : -1);var amount = doc.pvt_amount;emit(doc.call_id, amount * modifier);}}",
+ "map": "function (doc) {if (doc.pvt_deleted || (doc.pvt_type != 'cdr' && doc.pvt_type != 'credit' && doc.pvt_type != 'debit') || !doc.pvt_vsn || parseInt(doc.pvt_vsn) != 2) return;if (doc.pvt_type == 'cdr' && doc.custom_channel_vars && (doc.custom_channel_vars.account_billing == 'per_minute' || doc.custom_channel_vars.account_billing == 'per_minute_limit') && doc.custom_channel_vars.account_id == doc.pvt_account_id) {var Secs = (parseInt(doc.billing_seconds) || 0) - (parseInt(doc.custom_channel_vars.billing_seconds_offset) || 0);var Cost = 0;if (Secs >= 1) {var R = parseInt(doc.custom_channel_vars.rate) || 0;var RInc = parseInt(doc.custom_channel_vars.rate_increment) || 60;var RMin = parseInt(doc.custom_channel_vars.rate_minimum) || 0;var Sur = parseInt(doc.custom_channel_vars.surcharge) || 0;if (RInc < 1) {RInc = 60;}if (Secs <= RMin) {Cost = Sur + ((RMin / 60) * R);} else {Cost = Sur + ((RMin / 60) * R) + (Math.ceil((Secs - RMin) / RInc) * ((RInc / 60) * R));}}if (Cost) {var Discount = (parseInt(doc.custom_channel_vars.discount_percentage) || 0) * 0.01 * Cost;emit(doc._id, Cost - Discount);}} else if (doc.pvt_code && parseInt(doc.pvt_code) == 1001 && doc.call_id) {var modifier = (doc.pvt_type == 'credit' ? 1 : -1);var amount = doc.pvt_amount;emit(doc.call_id, amount * modifier);}}",
"reduce": "_sum"
}
}
View
2  whistle_apps/apps/crossbar/src/crossbar.hrl
@@ -7,7 +7,7 @@
-include_lib("whistle/include/wh_log.hrl").
-include_lib("whistle/include/wh_databases.hrl").
--include("src/crossbar_types.hrl").
+-include("crossbar_types.hrl").
-define(CONFIG_CAT, <<"crossbar">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_about.erl
@@ -16,7 +16,7 @@
,validate/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
%%%===================================================================
%%% API
View
2  whistle_apps/apps/crossbar/src/modules/cb_accounts.erl
@@ -23,7 +23,7 @@
-export([is_unique_realm/2]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(SERVER, ?MODULE).
View
2  whistle_apps/apps/crossbar/src/modules/cb_acls.erl
@@ -17,7 +17,7 @@
,validate/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(ECALLMGR, <<"ecallmgr">>).
-define(ECALLMGR_ACLS, <<"acls">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_agents.erl
@@ -27,7 +27,7 @@
,validate/1, validate/2, validate/3
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(MOD_CONFIG_CAT, <<(?CONFIG_CAT)/binary, ".queues">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_api_auth.erl
@@ -25,7 +25,7 @@
,put/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(AGG_VIEW_FILE, <<"views/accounts.json">>).
-define(AGG_VIEW_API, <<"accounts/listing_by_api">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_braintree.erl
@@ -20,7 +20,7 @@
,delete/3
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-include_lib("braintree/include/braintree.hrl").
-define(CUSTOMER_PATH_TOKEN, <<"customer">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_bulk.erl
@@ -19,7 +19,7 @@
,delete/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
%%%===================================================================
%%% API
View
2  whistle_apps/apps/crossbar/src/modules/cb_callflows.erl
@@ -19,7 +19,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(MOD_CONFIG_CAT, <<(?CONFIG_CAT)/binary, ".callflows">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_cdrs.erl
@@ -20,7 +20,7 @@
,validate/1, validate/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(MOD_CONFIG_CAT, <<(?CONFIG_CAT)/binary, ".cdrs">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_clicktocall.erl
@@ -26,7 +26,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CONNECT_CALL, <<"connect">>).
-define(HISTORY, <<"history">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_conferences.erl
@@ -21,7 +21,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"conferences/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_configs.erl
@@ -21,7 +21,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
%%%===================================================================
%%% API
View
2  whistle_apps/apps/crossbar/src/modules/cb_connectivity.erl
@@ -20,7 +20,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"trunkstore/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_contact_list.erl
@@ -17,7 +17,7 @@
,validate/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
%%%===================================================================
%%% API
View
2  whistle_apps/apps/crossbar/src/modules/cb_devices.erl
@@ -27,7 +27,7 @@
,get_all_acl_ips/0
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(QUICKCALL_URL, [{<<"devices">>, [_, <<"quickcall">>, _]}
,{?WH_ACCOUNTS_DB, [_]}
View
2  whistle_apps/apps/crossbar/src/modules/cb_directories.erl
@@ -19,7 +19,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(PVT_FUNS, [fun add_pvt_type/2]).
-define(CB_LIST, <<"directories/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_events.erl
@@ -46,7 +46,7 @@
,delete/1, delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(DEFAULT_USER, <<"events_user">>).
-define(EVENT_DOC_ID(User), <<"event_sub_", User/binary>>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_events_srv.erl
@@ -35,7 +35,7 @@
%% gen_listener handler callback
-export([handle_req/2]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(RESPONDERS, [{?MODULE, [{<<"*">>, <<"*">>}]}]). % all matching event cat/name combos go to here
-define(BINDINGS, []).
View
2  whistle_apps/apps/crossbar/src/modules/cb_faxes.erl
@@ -21,7 +21,7 @@
,delete/3
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(OUTGOING, <<"outgoing">>).
-define(INCOMING, <<"incoming">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_global_provisioner_templates.erl
@@ -33,7 +33,7 @@
,delete/3
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(MOD_CONFIG_CAT, <<(?CONFIG_CAT)/binary, ".provisioner_templates">>).
-define(CB_LIST, <<"provisioner_templates/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_global_resources.erl
@@ -21,7 +21,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"global_resources/crossbar_listing">>).
-define(GLOBAL_RESOURCE_DB, <<"offnet">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_groups.erl
@@ -20,7 +20,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"groups/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_hotdesks.erl
@@ -18,7 +18,7 @@
,validate/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(VIEW_FILE, <<"views/hotdesks.json">>).
-define(CB_LIST, <<"hotdesks/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_ip_auth.erl
@@ -20,7 +20,7 @@
,put/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(AGG_VIEW_FILE, <<"views/accounts.json">>).
-define(AGG_VIEW_IP, <<"accounts/listing_by_ip">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_killio.erl
@@ -19,7 +19,7 @@
,post/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(PVT_TYPE, <<"skel">>).
-define(PVT_FUNS, [fun add_pvt_type/2]).
View
2  whistle_apps/apps/crossbar/src/modules/cb_limits.erl
@@ -17,7 +17,7 @@
,reconcile_services/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-include_lib("whistle/src/wh_json.hrl").
-define(CB_LIST, <<"limits/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_local_provisioner_templates.erl
@@ -33,7 +33,7 @@
,delete/3
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(MOD_CONFIG_CAT, <<(?CONFIG_CAT)/binary, ".provisioner_templates">>).
-define(CB_LIST, <<"provisioner_templates/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_local_resources.erl
@@ -20,7 +20,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"local_resources/crossbar_listing">>).
-define(MOD_CONFIG_CAT, <<(?CONFIG_CAT)/binary, ".local_resources">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_media.erl
@@ -23,7 +23,7 @@
,delete/2, delete/3
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(SERVER, ?MODULE).
-define(BIN_DATA, <<"raw">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_menus.erl
@@ -21,7 +21,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"menus/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_modules_util.erl
@@ -15,7 +15,7 @@
,is_superduper_admin/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-spec pass_hashes(ne_binary(), ne_binary()) -> {ne_binary(), ne_binary()}.
pass_hashes(Username, Password) ->
View
2  whistle_apps/apps/crossbar/src/modules/cb_noauthn.erl
@@ -16,7 +16,7 @@
,authenticate/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
%%%===================================================================
%%% API
View
2  whistle_apps/apps/crossbar/src/modules/cb_noauthz.erl
@@ -16,7 +16,7 @@
,authorize/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
%%%===================================================================
%%% API
View
2  whistle_apps/apps/crossbar/src/modules/cb_onboard.erl
@@ -20,7 +20,7 @@
,put/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(OB_CONFIG_CAT, <<(?CONFIG_CAT)/binary, ".onboard">>).
-define(DEFAULT_FLOW, "{\"data\": { \"id\": \"~s\" }, \"module\": \"user\", \"children\": { \"_\": { \"data\": { \"id\": \"~s\" }, \"module\": \"voicemail\", \"children\": {}}}}").
View
2  whistle_apps/apps/crossbar/src/modules/cb_phone_numbers.erl
@@ -24,7 +24,7 @@
,populate_phone_numbers/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-include_lib("whistle_number_manager/include/wh_number_manager.hrl").
View
2  whistle_apps/apps/crossbar/src/modules/cb_queues.erl
@@ -46,7 +46,7 @@
,delete/2, delete/3
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(MOD_CONFIG_CAT, <<(?CONFIG_CAT)/binary, ".queues">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_rates.erl
@@ -18,7 +18,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(PVT_FUNS, [fun add_pvt_type/2]).
-define(PVT_TYPE, <<"rate">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_registrations.erl
@@ -15,7 +15,7 @@
,lookup_regs/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(MASK_REG_FIELDS, [<<"Account-DB">>, <<"Account-ID">>, <<"App-Name">>
,<<"App-Version">>, <<"Event-Category">>, <<"Event-Name">>
View
2  whistle_apps/apps/crossbar/src/modules/cb_schemas.erl
@@ -18,7 +18,7 @@
,validate/1, validate/2, validate/3
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(VALIDATION_PATH_TOKEN, <<"validation">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_servers.erl
@@ -24,7 +24,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(SERVER_CONF, [code:lib_dir(crossbar, priv), "/servers/servers.conf"]).
-define(SERVER_CONFIG_CATEGORY, <<"crossbar.servers">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_service_plans.erl
@@ -20,7 +20,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"service_plans/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_services.erl
@@ -18,7 +18,7 @@
,post/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(PVT_TYPE, <<"service">>).
-define(PVT_FUNS, [fun add_pvt_type/2]).
View
2  whistle_apps/apps/crossbar/src/modules/cb_shared_auth.erl
@@ -30,7 +30,7 @@
,put/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
%%%===================================================================
%%% API
View
2  whistle_apps/apps/crossbar/src/modules/cb_signup.erl
@@ -29,7 +29,7 @@
%% cleanup process
-export([start_link/0, init_it/0]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(SIGNUP_DB, <<"signups">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_simple_authz.erl
@@ -18,7 +18,7 @@
,authorize/1
]).
--include("../../src/crossbar.hrl").
+-include("crossbar.hrl").
-define(SERVER, ?MODULE).
-define(VIEW_SUMMARY, <<"accounts/listing_by_id">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_skels.erl
@@ -32,7 +32,7 @@
,finish_request/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"skels/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_templates.erl
@@ -20,7 +20,7 @@
,account_created/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(DB_PREFIX, "template/").
View
2  whistle_apps/apps/crossbar/src/modules/cb_temporal_rules.erl
@@ -18,7 +18,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"temporal_rules/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_token_auth.erl
@@ -23,7 +23,7 @@
%% cleanup proc
-export([start_link/0, init/1]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CHILDSPEC, {?MODULE, {?MODULE, 'start_link', []}, 'permanent', 5000, 'worker', [?MODULE]}).
View
2  whistle_apps/apps/crossbar/src/modules/cb_transactions.erl
@@ -14,7 +14,7 @@
,validate/1, validate/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
%% 1 month
-define(FETCH_DEFAULT, 60*60*24*30).
View
2  whistle_apps/apps/crossbar/src/modules/cb_user_auth.erl
@@ -18,7 +18,7 @@
,put/1, put/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(ACCT_MD5_LIST, <<"users/creds_by_md5">>).
-define(ACCT_SHA1_LIST, <<"users/creds_by_sha">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_users.erl
@@ -24,7 +24,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(SERVER, ?MODULE).
View
2  whistle_apps/apps/crossbar/src/modules/cb_vmboxes.erl
@@ -22,7 +22,7 @@
,delete/2, delete/4
]).
--include("../../src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"vmboxes/crossbar_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_webhooks.erl
@@ -19,7 +19,7 @@
,delete/2
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(CB_LIST, <<"webhooks/crossbar_listing">>).
-define(CB_USERS_LIST, <<"webhooks/users_listing">>).
View
2  whistle_apps/apps/crossbar/src/modules/cb_whitelabel.erl
@@ -22,7 +22,7 @@
,delete/1
]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-define(WHITELABEL_ID, <<"whitelabel">>).
-define(LOGO_REQ, <<"logo">>).
View
2  whistle_apps/apps/crossbar/src/modules/provisioner_contact_list.erl
@@ -12,7 +12,7 @@
-export([build/1]).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-record(contact, {id
,callflow
View
2  whistle_apps/apps/crossbar/src/modules/provisioner_util.erl
@@ -10,7 +10,7 @@
%%%-------------------------------------------------------------------
-module(provisioner_util).
--include("src/crossbar.hrl").
+-include("crossbar.hrl").
-export([get_mac_address/1]).
-export([get_old_mac_address/1]).
Something went wrong with that request. Please try again.