summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-11-02 18:35:16 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-11-02 18:35:16 +0100
commitd54bf3eddaacd2fee22f168899db8cf8f0fe364c (patch)
tree8a95ccbe375a3631a8539be5712a19a628ca707c
parent75cc3e63b7d3fd4bd3d480aec6a835a84d3aad53 (diff)
Generalize DeviceID
-rw-r--r--src/button.erl2
-rw-r--r--src/escape.erl6
-rw-r--r--src/make_call.erl6
-rw-r--r--src/monitor.erl5
-rw-r--r--src/snapshot.erl4
-rw-r--r--src/tda.erl12
6 files changed, 13 insertions, 22 deletions
diff --git a/src/button.erl b/src/button.erl
index 006fd45..917ac50 100644
--- a/src/button.erl
+++ b/src/button.erl
@@ -12,4 +12,4 @@ encode(Device) ->
'CSTA-get-button-information':encode('GetButtonInformationArgument',
#'GetButtonInformationArgument'{
device = #'DeviceID'{
- deviceIdentifier = {deviceNumber, Device}}}).
+ deviceIdentifier = Device }}).
diff --git a/src/escape.erl b/src/escape.erl
index d7ad50a..f1104a8 100644
--- a/src/escape.erl
+++ b/src/escape.erl
@@ -9,12 +9,6 @@
decode(Data) ->
'CSTA-escape-service':decode('EscapeArgument', Data).
-lines(co) ->
- lines(networkInterface);
-
-lines(ext) ->
- lines(station);
-
lines(Device) ->
'CSTA-escape-service':encode('EscapeArgument', #'EscapeArgument'{
privateData = {private,
diff --git a/src/make_call.erl b/src/make_call.erl
index 3e60172..46d1dc8 100644
--- a/src/make_call.erl
+++ b/src/make_call.erl
@@ -10,7 +10,5 @@ decode(Data) ->
encode(From, To) ->
'CSTA-make-call':encode('MakeCallArgument', #'MakeCallArgument'{
- callingDevice = #'DeviceID'{
- deviceIdentifier = {dialingNumber, From}},
- calledDirectoryNumber = #'DeviceID'{
- deviceIdentifier = {dialingNumber, To}}}).
+ callingDevice = #'DeviceID'{ deviceIdentifier = From },
+ calledDirectoryNumber = #'DeviceID'{ deviceIdentifier = To }}).
diff --git a/src/monitor.erl b/src/monitor.erl
index 36ef0f6..5e0da47 100644
--- a/src/monitor.erl
+++ b/src/monitor.erl
@@ -3,7 +3,6 @@
-export([decode/1, encode/1]).
-include("CSTA-monitor-start.hrl").
-%-include("CSTA-status-reporting.hrl").
-include("CSTA-device-identifiers.hrl").
decode(Data) ->
@@ -12,5 +11,5 @@ decode(Data) ->
encode(Device) ->
'CSTA-monitor-start':encode('MonitorStartArgument',
#'MonitorStartArgument'{
- monitorObject = {deviceObject, #'DeviceID'{
- deviceIdentifier = {deviceNumber, Device}}}}).
+ monitorObject = {deviceObject, #'DeviceID'{
+ deviceIdentifier = Device }}}).
diff --git a/src/snapshot.erl b/src/snapshot.erl
index 4e53cb3..6eb5464 100644
--- a/src/snapshot.erl
+++ b/src/snapshot.erl
@@ -11,5 +11,5 @@ decode(Data) ->
encode(Device) ->
'CSTA-snapshot-device':encode('SnapshotDeviceArgument',
#'SnapshotDeviceArgument'{
- snapshotObject = #'DeviceID'{
- deviceIdentifier = {deviceNumber, Device}}}).
+ snapshotObject = #'DeviceID'{
+ deviceIdentifier = Device }}).
diff --git a/src/tda.erl b/src/tda.erl
index fe1589b..dd6e3ae 100644
--- a/src/tda.erl
+++ b/src/tda.erl
@@ -14,25 +14,25 @@ stop() ->
?MODULE ! acse:release().
ext() ->
- ?MODULE ! rose:invoke(?ESCAPE, escape:lines(ext)).
+ ?MODULE ! rose:invoke(?ESCAPE, escape:lines(station)).
co() ->
- ?MODULE ! rose:invoke(?ESCAPE, escape:lines(co)).
+ ?MODULE ! rose:invoke(?ESCAPE, escape:lines(networkInterface)).
send(Reply) ->
?MODULE ! Reply.
snapshot(Device) ->
- ?MODULE ! rose:invoke(?SNAPSHOT, snapshot:encode(Device)).
+ ?MODULE ! rose:invoke(?SNAPSHOT, snapshot:encode({dialingNumber, Device})).
button(Device) ->
- ?MODULE ! rose:invoke(?BUTTON, button:encode(Device)).
+ ?MODULE ! rose:invoke(?BUTTON, button:encode({deviceNumber, Device})).
monitor(Device) ->
- ?MODULE ! rose:invoke(?MONITOR, monitor:encode(Device)).
+ ?MODULE ! rose:invoke(?MONITOR, monitor:encode({dialingNumber, Device})).
make_call(From, To) ->
- ?MODULE ! rose:invoke(?MAKECALL, make_call:encode(From, To)).
+ ?MODULE ! rose:invoke(?MAKECALL, make_call:encode({dialingNumber, From}, {dialingNumber, To})).
client({dial, Host, Port}) ->
io:format("Dial ~p:~p~n", [Host, Port]),