Skip to content
This repository
Browse code

resolve KAZOO-805: rename handoff to reorder

  • Loading branch information...
commit fc60aba97d2fed55df403439896afd6bebcf8788 1 parent 58ab4b2
bitbashing authored
0  whistle_apps/apps/handoff/Makefile → whistle_apps/apps/reorder/Makefile
File renamed without changes
0  whistle_apps/apps/handoff/doc/README.org → whistle_apps/apps/reorder/doc/README.org
Source Rendered
File renamed without changes
0  whistle_apps/apps/handoff/rebar.config → whistle_apps/apps/reorder/rebar.config
File renamed without changes
6  whistle_apps/apps/handoff/src/handoff.app.src → whistle_apps/apps/reorder/src/reorder.app.src
... ...
@@ -1,12 +1,12 @@
1  
-{application, handoff,
  1
+{application, reorder,
2 2
  [
3  
-  {description, "Skel - A handoffeton application useful for quickly creating services"},
  3
+  {description, "Skel - A reordereton application useful for quickly creating services"},
4 4
   {vsn, "1"},
5 5
   {registered, []},
6 6
   {applications, [
7 7
                   kernel,
8 8
                   stdlib
9 9
                  ]},
10  
-  {mod, { handoff_app, []}},
  10
+  {mod, { reorder_app, []}},
11 11
   {env, []}
12 12
  ]}.
6  whistle_apps/apps/handoff/src/handoff.erl → whistle_apps/apps/reorder/src/reorder.erl
@@ -5,7 +5,7 @@
5 5
 %%% @end
6 6
 %%% @contributors
7 7
 %%%-------------------------------------------------------------------
8  
--module(handoff).
  8
+-module(reorder).
9 9
 
10 10
 -include_lib("whistle/include/wh_types.hrl").
11 11
 
@@ -20,7 +20,7 @@
20 20
 -spec start_link/0 :: () -> startlink_ret().
21 21
 start_link() ->
22 22
     _ = start_deps(),
23  
-    handoff_sup:start_link().
  23
+    reorder_sup:start_link().
24 24
 
25 25
 %%--------------------------------------------------------------------
26 26
 %% @public
@@ -30,7 +30,7 @@ start_link() ->
30 30
 %%--------------------------------------------------------------------
31 31
 -spec stop/0 :: () -> 'ok'.
32 32
 stop() ->
33  
-    application:stop(handoff).
  33
+    application:stop(reorder).
34 34
 
35 35
 %%--------------------------------------------------------------------
36 36
 %% @private
2  whistle_apps/apps/handoff/src/handoff.hrl → whistle_apps/apps/reorder/src/reorder.hrl
@@ -4,7 +4,7 @@
4 4
 -include_lib("whistle/include/wh_log.hrl").
5 5
 -include_lib("whistle/include/wh_databases.hrl").
6 6
 
7  
--define(APP_NAME, <<"handoff">>).
  7
+-define(APP_NAME, <<"reorder">>).
8 8
 -define(APP_VERSION, <<"1.0.0">> ).
9 9
 
10 10
 
4  whistle_apps/apps/handoff/src/handoff_app.erl → whistle_apps/apps/reorder/src/reorder_app.erl
@@ -5,7 +5,7 @@
5 5
 %%% @end
6 6
 %%% @contributors
7 7
 %%%-------------------------------------------------------------------
8  
--module(handoff_app).
  8
+-module(reorder_app).
9 9
 
10 10
 -behaviour(application).
11 11
 
@@ -21,7 +21,7 @@
21 21
 %%--------------------------------------------------------------------
22 22
 -spec start/2 :: (term(), term()) -> {'ok', pid()} | {'error', startlink_err()}.
23 23
 start(_Type, _Args) ->
24  
-    case handoff_sup:start_link() of
  24
+    case reorder_sup:start_link() of
25 25
         {ok, P} -> {ok, P};
26 26
         {error, {already_started, P} } -> {ok, P};
27 27
         {error, _}=E -> E
4  whistle_apps/apps/handoff/src/handoff_handlers.erl → whistle_apps/apps/reorder/src/reorder_handlers.erl
@@ -6,13 +6,13 @@
6 6
 %%% @contributors
7 7
 %%%   James Aimonetti
8 8
 %%%-------------------------------------------------------------------
9  
--module(handoff_handlers).
  9
+-module(reorder_handlers).
10 10
 
11 11
 -export([handle_route_req/2
12 12
          ,handle_route_win/2
13 13
         ]).
14 14
 
15  
--include("handoff.hrl").
  15
+-include("reorder.hrl").
16 16
 
17 17
 -spec handle_route_req/2 :: (wh_json:json_object(), wh_proplist()) -> any().
18 18
 handle_route_req(JObj, Props) ->
39  whistle_apps/apps/handoff/src/handoff_listener.erl → whistle_apps/apps/reorder/src/reorder_listener.erl
@@ -5,7 +5,7 @@
5 5
 %%% @end
6 6
 %%% @contributors
7 7
 %%%-------------------------------------------------------------------
8  
--module(handoff_listener).
  8
+-module(reorder_listener).
9 9
 
10 10
 -behaviour(gen_listener).
11 11
 
@@ -19,17 +19,17 @@
19 19
          ,code_change/3
20 20
         ]).
21 21
 
22  
--include("handoff.hrl").
  22
+-include("reorder.hrl").
23 23
 
24 24
 -record(state, {}).
25 25
 
26  
--define(BINDINGS, [{route, []}
27  
-                   ,{self, []}
  26
+-define(BINDINGS, [{'route', []}
  27
+                   ,{'self', []}
28 28
                   ]).
29  
--define(RESPONDERS, [{ho_route_req, [{<<"dialplan">>, <<"route_req">>}]}]).
30  
--define(QUEUE_NAME, <<"handoff_listerner">>).
31  
--define(QUEUE_OPTIONS, [{exclusive, true}]).
32  
--define(CONSUME_OPTIONS, [{exclusive, true}]).
  29
+-define(RESPONDERS, [{'reorder', [{<<"dialplan">>, <<"route_req">>}]}]).
  30
+-define(QUEUE_NAME, <<"reorder_listerner">>).
  31
+-define(QUEUE_OPTIONS, [{'exclusive', 'false'}]).
  32
+-define(CONSUME_OPTIONS, [{'exclusive', 'false'}]).
33 33
 
34 34
 %%%===================================================================
35 35
 %%% API
@@ -43,12 +43,11 @@
43 43
 %% @end
44 44
 %%--------------------------------------------------------------------
45 45
 start_link() ->
46  
-    gen_listener:start_link(?MODULE, [{bindings, ?BINDINGS}
47  
-                                      ,{responders, ?RESPONDERS}
48  
-                                      ,{queue_name, ?QUEUE_NAME}
49  
-                                      ,{queue_options, ?QUEUE_OPTIONS}
50  
-                                      ,{consume_options, ?CONSUME_OPTIONS}
51  
-                                      ,{basic_qos, 1}
  46
+    gen_listener:start_link(?MODULE, [{'bindings', ?BINDINGS}
  47
+                                      ,{'responders', ?RESPONDERS}
  48
+                                      ,{'queue_name', ?QUEUE_NAME}
  49
+                                      ,{'queue_options', ?QUEUE_OPTIONS}
  50
+                                      ,{'consume_options', ?CONSUME_OPTIONS}
52 51
                                      ], []).
53 52
 
54 53
 %%%===================================================================
@@ -67,7 +66,7 @@ start_link() ->
67 66
 %% @end
68 67
 %%--------------------------------------------------------------------
69 68
 init([]) ->
70  
-    {ok, #state{}}.
  69
+    {'ok', #state{}}.
71 70
 
72 71
 %%--------------------------------------------------------------------
73 72
 %% @private
@@ -84,7 +83,7 @@ init([]) ->
84 83
 %% @end
85 84
 %%--------------------------------------------------------------------
86 85
 handle_call(_Request, _From, State) ->
87  
-    {reply, {error, not_implemented}, State}.
  86
+    {'reply', {'error', 'not_implemented'}, State}.
88 87
 
89 88
 %%--------------------------------------------------------------------
90 89
 %% @private
@@ -97,7 +96,7 @@ handle_call(_Request, _From, State) ->
97 96
 %% @end
98 97
 %%--------------------------------------------------------------------
99 98
 handle_cast(_Msg, State) ->
100  
-    {noreply, State}.
  99
+    {'noreply', State}.
101 100
 
102 101
 %%--------------------------------------------------------------------
103 102
 %% @private
@@ -110,7 +109,7 @@ handle_cast(_Msg, State) ->
110 109
 %% @end
111 110
 %%--------------------------------------------------------------------
112 111
 handle_info(_Info, State) ->
113  
-    {noreply, State}.
  112
+    {'noreply', State}.
114 113
 
115 114
 %%--------------------------------------------------------------------
116 115
 %% @private
@@ -121,7 +120,7 @@ handle_info(_Info, State) ->
121 120
 %% @end
122 121
 %%--------------------------------------------------------------------
123 122
 handle_event(_JObj, _State) ->
124  
-    {reply, []}.
  123
+    {'reply', []}.
125 124
 
126 125
 %%--------------------------------------------------------------------
127 126
 %% @private
@@ -146,7 +145,7 @@ terminate(_Reason, _State) ->
146 145
 %% @end
147 146
 %%--------------------------------------------------------------------
148 147
 code_change(_OldVsn, State, _Extra) ->
149  
-    {ok, State}.
  148
+    {'ok', State}.
150 149
 
151 150
 %%%===================================================================
152 151
 %%% Internal functions
30  whistle_apps/apps/handoff/src/ho_route_req.erl → whistle_apps/apps/reorder/src/reorder_route_req.erl
... ...
@@ -1,14 +1,14 @@
1 1
 %%%-------------------------------------------------------------------
2 2
 %%% @copyright (C) 2011-2012, VoIP INC
3 3
 %%% @doc
4  
-%%% handler for route requests, responds if handoff match
  4
+%%% handler for route requests, responds if reorder match
5 5
 %%% @end
6 6
 %%% @contributors
7 7
 %%%   Karl Anderson
8 8
 %%%-------------------------------------------------------------------
9  
--module(ho_route_req).
  9
+-module(reorder_route_req).
10 10
 
11  
--include("handoff.hrl").
  11
+-include("reorder.hrl").
12 12
 
13 13
 -export([handle_req/2]).
14 14
 
@@ -16,26 +16,26 @@
16 16
 handle_req(JObj, Props) ->
17 17
     Call = whapps_call:from_route_req(JObj),
18 18
     case is_binary(whapps_call:account_id(Call))
19  
-        andalso handoff_should_respond(Call)
  19
+        andalso reorder_should_respond(Call)
20 20
     of
21  
-        true ->
  21
+        'true' ->
22 22
             lager:info("received a request asking if callflows can route this call"),
23  
-            ControllerQ = props:get_value(queue, Props),
  23
+            ControllerQ = props:get_value('queue', Props),
24 24
             send_route_response(JObj, ControllerQ);
25  
-        false ->
26  
-            ok
  25
+        'false' ->
  26
+            'ok'
27 27
     end.
28 28
 
29 29
 %%-----------------------------------------------------------------------------
30 30
 %% @private
31 31
 %% @doc
32  
-%% determine if handoff should respond to a route request
  32
+%% determine if reorder should respond to a route request
33 33
 %% @end
34 34
 %%-----------------------------------------------------------------------------
35  
--spec handoff_should_respond/1 :: (whapps_call:call()) -> boolean().
36  
-handoff_should_respond(Call) ->
37  
-    whapps_call:custom_channel_var(<<"Referred-By">>, Call) =:= undefined
38  
-        andalso (whapps_call:authorizing_type(Call) =:= undefined
  35
+-spec reorder_should_respond/1 :: (whapps_call:call()) -> boolean().
  36
+reorder_should_respond(Call) ->
  37
+    whapps_call:custom_channel_var(<<"Referred-By">>, Call) =:= 'undefined'
  38
+        andalso (whapps_call:authorizing_type(Call) =:= 'undefined'
39 39
                 orelse whapps_call:authorizing_type(Call) =:= <<"resource">>).
40 40
 
41 41
 %%-----------------------------------------------------------------------------
@@ -47,8 +47,8 @@ handoff_should_respond(Call) ->
47 47
 %%-----------------------------------------------------------------------------
48 48
 -spec send_route_response/2 :: (wh_json:object(), ne_binary()) -> 'ok'.
49 49
 send_route_response(JObj, Q) ->
50  
-    ErrorCode = whapps_config:get_binary(<<"handoff">>, <<"error-code">>, <<"604">>),
51  
-    ErrorMsg = whapps_config:get_binary(<<"handoff">>, <<"error-message">>, <<"Misconfigured configured number">>),
  50
+    ErrorCode = whapps_config:get_binary(<<"reorder">>, <<"error-code">>, <<"604">>),
  51
+    ErrorMsg = whapps_config:get_binary(<<"reorder">>, <<"error-message">>, <<"Misconfigured configured number">>),
52 52
     Resp = [{<<"Msg-ID">>, wh_json:get_value(<<"Msg-ID">>, JObj)}
53 53
             ,{<<"Method">>, <<"error">>}
54 54
             ,{<<"Route-Error-Code">>, ErrorCode}
4  whistle_apps/apps/handoff/src/handoff_sup.erl → whistle_apps/apps/reorder/src/reorder_sup.erl
@@ -5,7 +5,7 @@
5 5
 %%% @end
6 6
 %%% @contributors
7 7
 %%%-------------------------------------------------------------------
8  
--module(handoff_sup).
  8
+-module(reorder_sup).
9 9
 
10 10
 -behaviour(supervisor).
11 11
 
@@ -17,7 +17,7 @@
17 17
 %% Helper macro for declaring children of supervisor
18 18
 -define(CHILD(Name, Type), fun(N, cache) -> {N, {wh_cache, start_link, [N]}, permanent, 5000, worker, [wh_cache]};
19 19
                               (N, T) -> {N, {N, start_link, []}, permanent, 5000, T, [N]} end(Name, Type)).
20  
--define(CHILDREN, [{handoff_cache, cache}, {handoff_listener, worker}]).
  20
+-define(CHILDREN, [{reorder_cache, cache}, {reorder_listener, worker}]).
21 21
 
22 22
 %% ===================================================================
23 23
 %% API functions
2  whistle_apps/src/whapps_maintenance.erl
@@ -73,7 +73,7 @@ migrate() ->
73 73
     io:format("updating default kazoo modules~n", []),
74 74
     WhappsUpdates = [fun(L) -> [<<"sysconf">> | lists:delete(<<"sysconf">>, L)] end
75 75
                     ,fun(L) -> [<<"acdc">> | lists:delete(<<"acdc">>, L)] end
76  
-                    ,fun(L) -> [<<"handoff">> | lists:delete(<<"handoff">>, L)] end
  76
+                    ,fun(L) -> [<<"reorder">> | lists:delete(<<"reorder">>, L)] end
77 77
                     ],
78 78
     StartWhapps = whapps_config:get(<<"whapps_controller">>, <<"whapps">>, []),
79 79
     _ = whapps_config:set_default(<<"whapps_controller">>

0 notes on commit fc60aba

Please sign in to comment.
Something went wrong with that request. Please try again.