1megaco_udp(3)              Erlang Module Definition              megaco_udp(3)
2
3
4

NAME

6       megaco_udp   -   Interface   module   to  UDP  transport  protocol  for
7       Megaco/H.248.
8

DESCRIPTION

10       This module contains the public interface to the UDP/IP version  trans‐
11       port protocol for Megaco/H.248.
12

EXPORTS

14       start_transport() -> {ok, TransportRef}
15
16              Types:
17
18                 TransportRef = pid()
19
20              This function is used for starting the UDP/IP transport service.
21              Use exit(TransportRef, Reason) to stop the transport service.
22
23       open(TransportRef, OptionList) -> {ok, Handle,  ControlPid}  |  {error,
24       Reason}
25
26              Types:
27
28                 TransportRef = pid() | regname()
29                 OptionList = [option()]
30                 option()  =  {port,  integer()}  |  {options,  list()} | {re‐
31                 ceive_handle,  receive_handle()}   |   {module,   atom()}   |
32                 {inet_backend, default | inet | socket}
33                 Handle = socket_handle()
34                 receive_handle() = term()
35                 ControlPid = pid()
36                 Reason = term()
37
38              This function is used to open an UDP/IP socket.
39
40                module:
41                  The  option  makes it possible for the user to provide their
42                  own callback  module.  The  functions  receive_message/4  or
43                  process_received_message/4  of  this module is called when a
44                  new message is received. Which one depends on  the  size  of
45                  the message:
46
47                  small:
48                    receive_message
49
50                  large:
51                    process_received_message
52
53                  Default value is megaco.
54
55                inet_backend:
56                  Choose the inet-backend.
57
58                  This option make it possible to use a different inet-backend
59                  ('default', 'inet' or 'socket').
60
61                  Default is default (system default).
62
63       close(Handle, Msg) -> ok
64
65              Types:
66
67                 Handle = socket_handle()
68                 Msg
69
70              This function is used for closing an active UDP socket.
71
72       socket(Handle) -> Socket
73
74              Types:
75
76                 Handle = socket_handle()
77                 Socket = inet_socket()
78
79              This  function  is  used  to  convert  a  socket_handle()  to  a
80              inet_socket().  inet_socket()  is  a  plain socket, see the inet
81              module for more info.
82
83       create_send_handle(Handle, Host, Port) -> send_handle()
84
85              Types:
86
87                 Handle = socket_handle()
88                 Host = {A,B,C,D} | string()
89                 Port = integer()
90
91              Creates a send handle from a transport handle. The  send  handle
92              is intended to be used by megaco_udp:send_message/2.
93
94       send_message(SendHandle, Msg) -> ok
95
96              Types:
97
98                 SendHandle = send_handle()
99                 Message = binary() | iolist()
100
101              Sends  a  message  on  a  socket. The send handle is obtained by
102              megaco_udp:create_send_handle/3. Increments  the  NumOutMessages
103              and  NumOutOctets counters if message successfully sent. In case
104              of a failure to send, the NumErrors counter is not  incremented.
105              This is done elsewhere in the megaco app.
106
107       block(Handle) -> ok
108
109              Types:
110
111                 Handle = socket_handle()
112
113              Stop receiving incoming messages on the socket.
114
115       unblock(Handle) -> ok
116
117              Types:
118
119                 Handle = socket_handle()
120
121              Starting to receive incoming messages from the socket again.
122
123       upgrade_receive_handle(ControlPid, NewHandle) -> ok
124
125              Types:
126
127                 ControlPid = pid()
128                 NewHandle = receive_handle()
129                 receive_handle() = term()
130
131              Update  the  receive  handle  of the control process (e.g. after
132              having changed protocol version).
133
134       get_stats() -> {ok, TotalStats} | {error, Reason}
135       get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason}
136       get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason}
137
138              Types:
139
140                 TotalStats = [total_stats()]
141                 total_stats() = {send_handle(), [stats()]}
142                 SendHandle = send_handle()
143                 SendHandleStats = [stats()]
144                 Counter = udp_stats_counter()
145                 CounterStats = integer()
146                 stats() = {udp_stats_counter(), integer()}
147                 tcp_stats_counter()  =  medGwyGatewayNumInMessages  |   medG‐
148                 wyGatewayNumInOctets  |  medGwyGatewayNumOutMessages  | medG‐
149                 wyGatewayNumOutOctets | medGwyGatewayNumErrors
150                 Reason = term()
151
152              Retreive the UDP related (SNMP) statistics counters.
153
154       reset_stats() -> void()
155       reset_stats(SendHandle) -> void()
156
157              Types:
158
159                 SendHandle = send_handle()
160
161              Reset all TCP related (SNMP) statistics counters.
162
163
164
165Ericsson AB                       megaco 4.5                     megaco_udp(3)
Impressum