summaryrefslogtreecommitdiff
path: root/lib/megaco/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/megaco/src')
-rw-r--r--lib/megaco/src/text/megaco_text_gen_v3.hrl14
-rw-r--r--lib/megaco/src/text/megaco_text_parser_v3.hrl32
-rw-r--r--lib/megaco/src/text/megaco_text_parser_v3.yrl21
3 files changed, 56 insertions, 11 deletions
diff --git a/lib/megaco/src/text/megaco_text_gen_v3.hrl b/lib/megaco/src/text/megaco_text_gen_v3.hrl
index e440ec6651..8da58fff9a 100644
--- a/lib/megaco/src/text/megaco_text_gen_v3.hrl
+++ b/lib/megaco/src/text/megaco_text_gen_v3.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2019. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2020. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1152,7 +1152,9 @@ enc_ammDescriptor({Tag, Desc}, State) ->
statisticsDescriptor -> enc_StatisticsDescriptor(Desc, State);
_ ->
error({invalid_ammDescriptor_tag, Tag})
- end.
+ end;
+enc_ammDescriptor(Tag, State) when is_atom(Tag) ->
+ enc_ammDescriptor({Tag, []}, State).
enc_AmmsReply(#'AmmsReply'{terminationID = TIDs,
terminationAudit = asn1_NOVALUE}, State) ->
@@ -3208,14 +3210,20 @@ enc_PackagesItem(Val, State)
enc_StatisticsDescriptor({'StatisticsDescriptor',Val}, State) ->
enc_StatisticsDescriptor(Val, State);
-enc_StatisticsDescriptor(List, State) when is_list(List) ->
+enc_StatisticsDescriptor(List, State)
+ when is_list(List) andalso (List =/= []) ->
[
?StatsToken,
?LBRKT_INDENT(State),
enc_list([{List, fun enc_StatisticsParameter/2}], ?INC_INDENT(State)),
?RBRKT_INDENT(State)
+ ];
+enc_StatisticsDescriptor([], State) ->
+ [
+ ?StatsToken
].
+
enc_StatisticsParameter(Val, State)
when is_record(Val, 'StatisticsParameter') ->
PkgdName = ?META_ENC(statistics, Val#'StatisticsParameter'.statName),
diff --git a/lib/megaco/src/text/megaco_text_parser_v3.hrl b/lib/megaco/src/text/megaco_text_parser_v3.hrl
index 7b8fff2080..9d0afaa11b 100644
--- a/lib/megaco/src/text/megaco_text_parser_v3.hrl
+++ b/lib/megaco/src/text/megaco_text_parser_v3.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2019. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2020. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1740,6 +1740,36 @@ do_merge_control_streamParms([{SubTag, SD} | T] = All, LCD) ->
do_merge_control_streamParms([], LCD) ->
LCD.
+
+%% This is to get around the two defs:
+%%
+%% statisticsDescriptor = StatsToken [LBRKT statisticsParameter *(COMMA
+%% statisticsParameter) RBRKT]
+%%
+%% and
+%%
+%% auditReturnParameter = (mediaDescriptor / modemDescriptor / muxDescriptor /
+%% eventsDescriptor / signalsDescriptor /
+%% digitMapDescriptor / observedEventsDescriptor /
+%% eventBufferDescriptor / statisticsDescriptor /
+%% packagesDescriptor / errorDescriptor /
+%% auditReturnItem)
+%% auditReturnItem = (MuxToken / ModemToken / MediaToken /
+%% DigitMapToken / StatsToken / ObservedEventsToken /
+%% PackagesToken)
+%%
+%% In both statisticsDescriptor and auditReturnItem the StatsToken
+%% can occure on its owm => conflict
+
+-ifdef(megaco_parser_inline).
+-compile({inline,[{ensure_arp_statisticsDescriptor,1}]}).
+-endif.
+ensure_arp_statisticsDescriptor([]) ->
+ {auditReturnItem, statsToken};
+ensure_arp_statisticsDescriptor(SPs) ->
+ {statisticsDescriptor, SPs}.
+
+
-ifdef(megaco_parser_inline).
-compile({inline,[{merge_terminationStateDescriptor,1}]}).
-endif.
diff --git a/lib/megaco/src/text/megaco_text_parser_v3.yrl b/lib/megaco/src/text/megaco_text_parser_v3.yrl
index 3e163f2ac6..4954386e03 100644
--- a/lib/megaco/src/text/megaco_text_parser_v3.yrl
+++ b/lib/megaco/src/text/megaco_text_parser_v3.yrl
@@ -760,12 +760,13 @@ auditReturnParameter -> signalsDescriptor : {signalsDescriptor, '$1'} .
auditReturnParameter -> digitMapDescriptor : {digitMapDescriptor, '$1'} .
auditReturnParameter -> observedEventsDescriptor : {observedEventsDescriptor, '$1'} .
auditReturnParameter -> eventBufferDescriptor : {eventBufferDescriptor, '$1'} .
-auditReturnParameter -> statisticsDescriptor : {statisticsDescriptor, '$1'} .
+%% Conflict with 'empty' statisticsDescriptor and auditReturnItem (see below)
+auditReturnParameter -> statisticsDescriptor : ensure_arp_statisticsDescriptor('$1') .
auditReturnParameter -> packagesDescriptor : {packagesDescriptor, '$1'} .
auditReturnParameter -> errorDescriptor : {errorDescriptor, '$1'} .
auditReturnParameter -> auditReturnItem : {auditReturnItem, '$1'} .
-auditDescriptor -> 'AuditToken' 'LBRKT' auditDescriptorBody 'RBRKT' :
+auditDescriptor -> 'AuditToken' 'LBRKT' auditDescriptorBody 'RBRKT' :
merge_auditDescriptor('$3') .
auditDescriptorBody -> auditItem auditItemList : ['$1' | '$2'].
@@ -780,13 +781,16 @@ auditReturnItem -> 'MuxToken' : muxToken .
auditReturnItem -> 'ModemToken' : modemToken .
auditReturnItem -> 'MediaToken' : mediaToken .
auditReturnItem -> 'DigitMapToken' : digitMapToken .
-auditReturnItem -> 'StatsToken' : statsToken .
+%% Conflict with 'empty' statisticsDescriptor:
+%% auditReturnItem -> 'StatsToken' : statsToken .
auditReturnItem -> 'ObservedEventsToken' : observedEventsToken .
auditReturnItem -> 'PackagesToken' : packagesToken .
%% at-most-once, and DigitMapToken and PackagesToken are not allowed
%% in AuditCapabilities command
auditItem -> auditReturnItem : '$1' .
+%% Moved from ari above (conflict with 'empty' statisticsDescriptor)
+auditItem -> 'StatsToken' : statsToken.
auditItem -> 'SignalsToken' : signalsToken.
auditItem -> 'EventBufferToken' : eventBufferToken.
auditItem -> 'EventsToken' : eventsToken .
@@ -1095,11 +1099,13 @@ localParmList -> '$empty': [] .
terminationStateDescriptor -> 'TerminationStateToken'
'LBRKT' terminationStateParm
- terminationStateParms 'RBRKT'
- : merge_terminationStateDescriptor(['$3' | '$4']) .
+ terminationStateParms 'RBRKT' :
+ merge_terminationStateDescriptor(['$3' | '$4']) .
-terminationStateParms -> 'COMMA' terminationStateParm terminationStateParms : ['$2' | '$3'] .
-terminationStateParms -> '$empty' : [] .
+terminationStateParms -> 'COMMA' terminationStateParm terminationStateParms :
+ ['$2' | '$3'] .
+terminationStateParms -> '$empty' :
+ [] .
%% at-most-once per item except for propertyParm
localParm -> 'ReservedGroupToken' 'EQUAL' onOrOff : {group, '$3'} .
@@ -1504,6 +1510,7 @@ statisticsDescriptor -> 'StatsToken'
'LBRKT' statisticsParameter
statisticsParameters 'RBRKT'
: ['$3' | '$4'] .
+statisticsDescriptor -> 'StatsToken' : [] .
statisticsParameters -> 'COMMA' statisticsParameter statisticsParameters : ['$2' | '$3'] .
statisticsParameters -> '$empty' : [] .