1megaco_encoder(3) Erlang Module Definition megaco_encoder(3)
2
3
4
6 megaco_encoder - Megaco encoder behaviour.
7
9 The following functions should be exported from a megaco_encoder call‐
10 back module:
11
13 megaco_message() = #'MegacoMessage{}'
14 transaction() = {transactionRequest, transaction_request()} |
15 {transactionPending, transaction_reply()} |
16 {transactionReply, transaction_pending()} |
17 {transactionResponseAck, transaction_response_ack()} |
18 {segmentReply, segment_reply()}
19 transaction_request() = #'TransactionRequest'{}
20 transaction_pending() = #'TransactionPending'{}
21 transaction_reply() = #'TransactionReply'{}
22 transaction_response_ack() = [transaction_ack()]
23 transaction_ack() = #'TransactionAck'{}
24 segment_reply() = #'SegmentReply'{}
25 action_request() = #'ActionRequest'{}
26 action_reply() = #'ActionReply'{}
27
28
30 Module:encode_message(EncodingConfig, Version, Message) -> {ok, Bin} |
31 Error
32
33 Types:
34
35 EncodingConfig = list()
36 Version = integer()
37 Message = megaco_message()
38 Bin = binary()
39 Error = term()
40
41 Encode a megaco message.
42
43 Module:decode_message(EncodingConfig, Version, Bin) -> {ok, Message} |
44 Error
45
46 Types:
47
48 EncodingConfig = list()
49 Version = integer() | dynamic
50 Message = megaco_message()
51 Bin = binary()
52 Error = term()
53
54 Decode a megaco message.
55
56 Note that if the Version argument is dynamic, the decoder should
57 try to figure out the actual version from the message itself and
58 then use the proper decoder, e.g. version 1.
59 If on the other hand the Version argument is an integer, it
60 means that this is the expected version of the message and the
61 decoder for that version should be used.
62
63 Module:decode_mini_message(EncodingConfig, Version, Bin) -> {ok, Mes‐
64 sage} | Error
65
66 Types:
67
68 EncodingConfig = list()
69 Version = integer() | dynamic
70 Message = megaco_message()
71 Bin = binary()
72 Error = term()
73
74 Perform a minimal decode of a megaco message.
75
76 The purpose of this function is to do a minimal decode of Megaco
77 message. A successfull result is a 'MegacoMessage' in which only
78 version and mid has been initiated. This function is used by the
79 megaco_messenger module when the decode_message/3 function fails
80 to figure out the mid (the actual sender) of the message.
81
82 Note again that a successfull decode only returns a partially
83 initiated message.
84
85 Module:encode_transaction(EncodingConfig, Version, Transaction) -> OK |
86 Error
87
88 Types:
89
90 EncodingConfig = list()
91 Version = integer()
92 Transaction = transaction()
93 OK = {ok, Bin}
94 Bin = binary()
95 Error = {error, Reason}
96 Reason = not_implemented | OtherReason
97 OtherReason = term()
98
99 Encode a megaco transaction. If this, for whatever reason, is
100 not supported, the function should return the error reason
101 not_implemented.
102
103 This functionality is used both when the transaction sender is
104 used and for segmentation. So, for either of those to work, this
105 function must be fully supported!
106
107 Module:encode_action_requests(EncodingConfig, Version, ARs) -> OK |
108 Error
109
110 Types:
111
112 EncodingConfig = list()
113 Version = integer()
114 ARs = action_requests()
115 action_requests() = [action_request()]
116 OK = {ok, Bin}
117 Bin = binary()
118 Error = {error, Reason}
119 Reason = not_implemented | OtherReason
120 OtherReason = term()
121
122 Encode megaco action requests. This function is called when the
123 user calls the function encode_actions/3. If that function is
124 never used or if the codec cannot support this (the encoding of
125 individual actions), then return with error reason not_imple‐
126 mented.
127
128 Module:encode_action_reply(EncodingConfig, Version, AR) -> OK | Error
129
130 Types:
131
132 EncodingConfig = list()
133 Version = integer()
134 AR = action_reply()
135 OK = {ok, Bin}
136 Bin = binary()
137 Error = {error, Reason}
138 Reason = not_implemented | OtherReason
139 OtherReason = term()
140
141 Encode a megaco action reply. If this, for whatever reason, is
142 not supported, the function should return the error reason
143 not_implemented.
144
145 This function is used when segmentation has been configured. So,
146 for this to work, this function must be fully supported!
147
148
149
150Ericsson AB megaco 3.18.3 megaco_encoder(3)