summaryrefslogtreecommitdiff
path: root/src/pbx_acse.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/pbx_acse.erl')
-rw-r--r--src/pbx_acse.erl40
1 files changed, 11 insertions, 29 deletions
diff --git a/src/pbx_acse.erl b/src/pbx_acse.erl
index 84a3bb3..c3ef94e 100644
--- a/src/pbx_acse.erl
+++ b/src/pbx_acse.erl
@@ -6,40 +6,22 @@
-export([init/1, handle_event/2, handle_call/2, handle_info/2,
terminate/2, code_change/3]).
--export([encode/1, decode/1]).
+-export([encode/1]).
-encode(userinformation) ->
- 'CSTA-application-context-information-csta3':encode(
- 'ACSEUserInformationForCSTA', {newDefinition,
- #'NewACSEUserInformationForCSTA'{cSTAVersion = [versionFive]}});
encode(associate) ->
- {ok, UI} = encode(userinformation),
- AARQ = {aarq, #'AARQ-apdu'{
+ UIforCSTA = #'NewACSEUserInformationForCSTA'{
+ cSTAVersion = [versionFive]},
+ {ok, UI} = 'CSTA-application-context-information-csta3':encode(
+ 'ACSEUserInformationForCSTA', {newDefinition, UIforCSTA}),
+ Ext = #'EXTERNAL'{'direct-reference' = {1, 3, 12, 0, 285, 200},
+ encoding = {'single-ASN1-type', UI}},
+ AARQ = #'AARQ-apdu'{
'protocol-version' = [version1], % required
'application-context-name' = {1, 3, 12, 0, 218},
- 'user-information' = [#'EXTERNAL'{
- 'direct-reference' = {1, 3, 12, 0, 285, 200},
- encoding = {'single-ASN1-type', UI}}]}},
- encode(AARQ);
+ 'user-information' = [Ext]},
+ 'ACSE-1':encode('ACSE-apdu', {aarq, AARQ});
encode(release) ->
- RLRQ = {rlrq, #'RLRQ-apdu'{}},
- encode(RLRQ);
-encode(Data) ->
- 'ACSE-1':encode('ACSE-apdu', Data).
-
-decode({aare, #'AARE-apdu'{result = accepted}}) ->
- ok;
-decode({aare, #'AARE-apdu'{}}) ->
- error;
-decode({rlre, _}) ->
- ok;
-decode({abrt, _}) ->
- error;
-decode({asn1_ExtAlt, Data}) ->
- pbx_rose:decode(Data);
-decode(<<Data/binary>>) ->
- {ok, Pdu} = 'ACSE-1':decode('ACSE-apdu', Data),
- decode(Pdu).
+ 'ACSE-1':encode('ACSE-apdu', {rlrq, #'RLRQ-apdu'{}}).
%%%