1megaco_udp(3) Erlang Module Definition megaco_udp(3)
2
3
4
6 megaco_udp - Interface module to UDP transport protocol for
7 Megaco/H.248.
8
10 This module contains the public interface to the UDP/IP version trans‐
11 port protocol for Megaco/H.248.
12
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()}
31 |{receive_handle, receive_handle()} |{module, atom()}
32 Handle = socket_handle()
33 receive_handle() = term()
34 ControlPid = pid()
35 Reason = term()
36
37 This function is used to open an UDP/IP socket.
38
39 The module option makes it possible for the user to provide
40 their own callback module. The functions receive_message/4 or
41 process_received_message/4 of this module is called when a new
42 message is received (which one depends on the size of the mes‐
43 sage; small - receive_message, large - process_received_mes‐
44 sage). Default value is megaco.
45
46 close(Handle, Msg) -> ok
47
48 Types:
49
50 Handle = socket_handle()
51 Msg
52
53 This function is used for closing an active UDP socket.
54
55 socket(Handle) -> Socket
56
57 Types:
58
59 Handle = socket_handle()
60 Socket = inet_socket()
61
62 This function is used to convert a socket_handle() to a
63 inet_socket(). inet_socket() is a plain socket, see the inet
64 module for more info.
65
66 create_send_handle(Handle, Host, Port) -> send_handle()
67
68 Types:
69
70 Handle = socket_handle()
71 Host = {A,B,C,D} | string()
72 Port = integer()
73
74 Creates a send handle from a transport handle. The send handle
75 is intended to be used by megaco_udp:send_message/2.
76
77 send_message(SendHandle, Msg) -> ok
78
79 Types:
80
81 SendHandle = send_handle()
82 Message = binary() | iolist()
83
84 Sends a message on a socket. The send handle is obtained by
85 megaco_udp:create_send_handle/3. Increments the NumOutMessages
86 and NumOutOctets counters if message successfully sent. In case
87 of a failure to send, the NumErrors counter is not incremented.
88 This is done elsewhere in the megaco app.
89
90 block(Handle) -> ok
91
92 Types:
93
94 Handle = socket_handle()
95
96 Stop receiving incoming messages on the socket.
97
98 unblock(Handle) -> ok
99
100 Types:
101
102 Handle = socket_handle()
103
104 Starting to receive incoming messages from the socket again.
105
106 upgrade_receive_handle(ControlPid, NewHandle) -> ok
107
108 Types:
109
110 ControlPid = pid()
111 NewHandle = receive_handle()
112 receive_handle() = term()
113
114 Update the receive handle of the control process (e.g. after
115 having changed protocol version).
116
117 get_stats() -> {ok, TotalStats} | {error, Reason}
118 get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason}
119 get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason}
120
121 Types:
122
123 TotalStats = [total_stats()]
124 total_stats() = {send_handle(), [stats()]}
125 SendHandle = send_handle()
126 SendHandleStats = [stats()]
127 Counter = udp_stats_counter()
128 CounterStats = integer()
129 stats() = {udp_stats_counter(), integer()}
130 tcp_stats_counter() = medGwyGatewayNumInMessages | medG‐
131 wyGatewayNumInOctets | medGwyGatewayNumOutMessages | medG‐
132 wyGatewayNumOutOctets | medGwyGatewayNumErrors
133 Reason = term()
134
135 Retreive the UDP related (SNMP) statistics counters.
136
137 reset_stats() -> void()
138 reset_stats(SendHandle) -> void()
139
140 Types:
141
142 SendHandle = send_handle()
143
144 Reset all TCP related (SNMP) statistics counters.
145
146
147
148Ericsson AB megaco 3.18.6 megaco_udp(3)