auditToken megaco
Peter-Henry Mander
erlang@REDACTED
Thu Sep 25 08:32:58 CEST 2003
Hi Carlos,
May I suggest reading _both_ the ASN.1 and ABNF grammars, having two
descriptions helped me a lot when I was struggling to build the proper
data structures.
The ASN.1 AuditDescriptor grammar tells me that it is a sequence of
tokens, nothing more.
I think you may need to look at auditReply where the events are returned
as:-
auditReturnParameter = (mediaDescriptor / modemDescriptor /
muxDescriptor / eventsDescriptor / signalsDescriptor /
digitMapDescriptor / observedEventsDescriptor /
eventBufferDescriptor / statisticsDescriptor /
packagesDescriptor / errorDescriptor / auditItem)
The descriptors will contain the information returned from an audit request.
/aside
Also note that in the extract below there's a _comment_ that auditItem
set of tokens may appear in two different constructs, but are not used
the same way. The ABNF *should* have specified auditItem as it is, and
*additionally* specified auditCapabilitiesItem which excludes
DigitMapToken and PackagesToken, to be used in the AuditCapabilities
command only.
So _you_must_read_the_comments_ in case there's a special case not
written in ABNF or ASN.1 (This has been a bugbear for me. No wonder
interops are so fraught!)
;;;;;;;;;;;;;;;;;;;; extract of ABNF
commandRequest = ( ammRequest /
subtractRequest /
auditRequest /
notifyRequest /
serviceChangeRequest)
auditRequest = (AuditValueToken / AuditCapToken ) EQUAL
TerminationID LBRKT auditDescriptor RBRKT
AuditValueToken = ("AuditValue" / "AV")
AuditCapToken = ("AuditCapability" / "AC")
;;;;;;;;;;;;;;;;;;;; this indicates that an auditDescriptor
;;;;;;;;;;;;;;;;;;;; is a comma list in text format
auditDescriptor = AuditToken LBRKT [ auditItem
*(COMMA auditItem) ] RBRKT
AuditToken = ("Audit" / "AT")
;at-most-once, and DigitMapToken and PackagesToken are not allowed
;in AuditCapabilities command
auditItem = ( MuxToken / ModemToken / MediaToken /
SignalsToken / EventBufferToken /
DigitMapToken / StatsToken / EventsToken /
ObservedEventsToken / PackagesToken )
MuxToken = ("Mux" / "MX")
ModemToken = ("Modem" / "MD")
MediaToken = ("Media" / "M")
SignalsToken = ("Signals" / "SG")
EventBufferToken = ("EventBuffer" / "EB")
DigitMapToken = ("DigitMap" / "DM")
StatsToken = ("Statistics" / "SA")
EventsToken = ("Events" / "E")
ObservedEventsToken = ("ObservedEvents" / "OE")
PackagesToken = ("Packages" / "PG")
Carlos Rodríguez Alcalá Villagra wrote:
>
> *Hi to make this command :*
> MEGACO/1 [172.16.0.1]:2944
> Transaction = 1 {
> Context = - {
> AuditCapabilities = ui {
> Audit{Events}
> }}}
> |-----------------------------------------------------------------------------|
>
>
>
> *I wrote this code:*
> ******************************
>
> auditcapabilities(ConnHandle, Events)->
> AUD=#'AuditDescriptor'{auditToken=Audit},
> TermId=ui,
> AUR=#'AuditRequest'{terminationID = TermId, auditDescriptor = AUD},
> CR = #'CommandRequest'{command = {auditCapabilities, AUR}},
> AR = #'ActionRequest'{contextId = ?megaco_null_context_id,
> commandRequests = [CR]},
> io:format("AR:~p~n", [AR]),
> {ProtocolVersion, UserReply}=megaco:call(ConnHandle, [AR], [])
>
> ****************************
>
> *but, auditToken should also be a structure to be able to load Event,
> rigth?*
>
> * Because, in the RFC3015 page 89 is written: *
>
> AuditDescriptor ::= SEQUENCE
> {
> auditToken BIT STRING
> {
> muxToken(0), modemToken(1), mediaToken(2),
> eventsToken(3), signalsToken(4),
> digitMapToken(5), statsToken(6),
> observedEventsToken(7),
> packagesToken(8), eventBufferToken(9)
> } OPTIONAL,
> ...
> }
>
> *thanks for your time*
>
More information about the erlang-questions
mailing list