No subject
Micael Karlberg
micael.karlberg@REDACTED
Mon Nov 3 18:07:06 CET 2003
Hi,
mwilligs@REDACTED writes:
> I have this code:
>
> cre_SubtractRequest(TerminationID, AuditDescriptor)->
> #'SubtractRequest'{terminationID=[#megaco_term_id{id=TerminationID}],
> auditDescriptor=AuditDescriptor}.
>
> cre_AuditDescriptor(AuditToken)->
> #'AuditDescriptor'{auditToken=AuditToken}.
>
> I want to build this megaco command in Erlang:
>
> Context = 1
> {
> substract = Epha {Audit{Statistics}}
> }
>
> But I don't know how to use a token
>
> If my code is ok, how can I make to insert the token "Statistics" in my
> megaco command?
There is no statistics token for auditToken in AuditDescriptor.
The auditToken in the AuditDescriptor is either a the atom
asn1_NOVALUE or a list of tokens (statistics is not one of them),
so:
cre_AuditDescriptor(AuditToken) when atom(AuditToken) ->
#'AuditDescriptor'{auditToken = [AuditToken]};
cre_AuditDescriptor(Tokens) when list(Tokens) ->
#'AuditDescriptor'{auditToken = [Tokens]}.
If I read chapter 7.2.3, of RFC3525 correctly (yes, I know we
do not yet support this rfc), there is no need to specify
statistics. It is the default.
"By default, the Statistics parameter is returned to report
information collected on the Termination or Terminations specified in
the Command. The information reported applies to the Termination's
or Terminations' existence in the Context from which it or they are
being subtracted.
The AuditDescriptor is optional. If present, the command will return
only those descriptors as specified in the AuditDescriptor, which may
be empty. If omitted, the Statistics descriptor is returned, by
default. Possible return values are the same as those to Add."
>
> Thanks in advance
/BMK
More information about the erlang-questions
mailing list