summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-11-08 17:31:25 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-11-08 17:31:25 +0100
commitebd0901daf97c3f6c2dbea5737caf17b4c7d140d (patch)
tree0675fce5f2c4373044e279bcc77427448f4d474c
parent46e26f368414d67d8ee15f66a2686f6394261d39 (diff)
Rename files
-rw-r--r--src/pbx_conn.erl (renamed from src/tapi.erl)2
-rw-r--r--src/pbx_invoke.erl (renamed from src/counter.erl)2
-rw-r--r--src/pbx_sup.erl7
-rw-r--r--src/rose.erl10
4 files changed, 10 insertions, 11 deletions
diff --git a/src/tapi.erl b/src/pbx_conn.erl
index c9ff2b1..af319fb 100644
--- a/src/tapi.erl
+++ b/src/pbx_conn.erl
@@ -1,4 +1,4 @@
--module(tapi).
+-module(pbx_conn).
-behaviour(gen_server).
-define(SERVER, ?MODULE).
diff --git a/src/counter.erl b/src/pbx_invoke.erl
index 2444ce0..034fc1e 100644
--- a/src/counter.erl
+++ b/src/pbx_invoke.erl
@@ -1,4 +1,4 @@
--module(counter).
+-module(pbx_invoke).
-behaviour(gen_server).
-define(SERVER, ?MODULE).
diff --git a/src/pbx_sup.erl b/src/pbx_sup.erl
index 4f753d1..fb0ce9c 100644
--- a/src/pbx_sup.erl
+++ b/src/pbx_sup.erl
@@ -11,8 +11,7 @@ start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
- {ok, {
- {one_for_one, 5, 10}, [
- ?CHILD(tapi, worker),
- ?CHILD(counter, worker)
+ {ok, {{one_for_one, 5, 10},
+ [?CHILD(pbx_conn, worker),
+ ?CHILD(pbx_invoke, worker)
]}}.
diff --git a/src/rose.erl b/src/rose.erl
index 68f2ad6..4956c67 100644
--- a/src/rose.erl
+++ b/src/rose.erl
@@ -14,12 +14,12 @@ return(Id, Op, {ok, Data}) ->
result = #'ReturnResult_result'{opcode = Op, result = Data}}}).
invoke(Op, {ok, Data}) ->
- Id = counter:next(),
+ Id = pbx_invoke:next(),
'Remote-Operations-Generic-ROS-PDUs':encode('ROS', {invoke,
#'Invoke'{invokeId = Id, opcode = Op, argument = Data}}).
dispatch({invoke, #'Invoke'{invokeId = Id, opcode = Op, argument = Data}}) ->
- counter:set(Id),
+ pbx_invoke:set(Id),
case Op of
?MAKECALL ->
ok;
@@ -43,11 +43,11 @@ dispatch({invoke, #'Invoke'{invokeId = Id, opcode = Op, argument = Data}}) ->
end;
dispatch({returnResult, #'ReturnResult'{invokeId = Id, result = Data}}) ->
- counter:set(Id),
+ pbx_invoke:set(Id),
dispatch(Data);
dispatch({returnError, #'ReturnError'{invokeId = Id, errcode = Op, parameter = Data}}) ->
- counter:set(Id),
+ pbx_invoke:set(Id),
case Op of
?ERROR ->
{ok, Error} = error:decode(Data),
@@ -56,7 +56,7 @@ dispatch({returnError, #'ReturnError'{invokeId = Id, errcode = Op, parameter = D
error;
dispatch({reject, #'Reject'{invokeId = Id, problem = Problem}}) ->
- counter:set(Id),
+ pbx_invoke:set(Id),
io:format("Problem: ~p~n", [Problem]),
error;