The following functions should be exported from a
megaco_encoder
callback module:
Module:encode_message(EncodingConfig, Version, Message) -> {ok, Bin} | Error
Types:
EncodingConfig = list()
Version = integer()
Message = megaco_message()
Bin = binary()
Error = term()
Encode a megaco message.
Module:decode_message(EncodingConfig, Version, Bin) -> {ok, Message} | Error
Types:
EncodingConfig = list()
Version = integer() | dynamic
Message = megaco_message()
Bin = binary()
Error = term()
Decode a megaco message.
Note that if the Version argument is dynamic
, the
decoder should try to figure out the actual version from the
message itself and then use the proper decoder, e.g. version 1.
If on the other hand the Version argument is an integer,
it means that this is the expected version of the message and
the decoder for that version should be used.