1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
<TITLE>megaco_udp</TITLE>
<SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
<STYLE TYPE="text/css">
<!--
.REFBODY { margin-left: 13mm }
.REFTYPES { margin-left: 8mm }
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
<IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>megaco_udp</H1>
</CENTER>
<H3>MODULE</H3>
<DIV CLASS=REFBODY>
megaco_udp
</DIV>
<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
Interface module to UDP transport protocol for Megaco/H.248.
</DIV>
<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>
<P> This module contains the public interface to the UDP/IP version
transport protocol for Megaco/H.248.
</DIV>
<H3>EXPORTS</H3>
<P><A NAME="start_transport/0"><STRONG><CODE>start_transport() -> {ok, TransportRef}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>TransportRef = pid()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> This function is used for starting the UDP/IP transport service.
Use exit(TransportRef, Reason) to stop the transport service.
</DIV>
<P><A NAME="open/2"><STRONG><CODE>open(TransportRef, OptionList) -> {ok, Handle, ControlPid} |
{error, Reason}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>TransportRef = pid() | regname()</CODE></STRONG><BR>
<STRONG><CODE>OptionList = [option()]</CODE></STRONG><BR>
<STRONG><CODE>option() = {port, integer()}
|{options, list()}
|{receive_handle, receive_handle()}
|{module, atom()}</CODE></STRONG><BR>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
<STRONG><CODE>receive_handle() = term()</CODE></STRONG><BR>
<STRONG><CODE>ControlPid = pid()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>This function is used to open an UDP/IP socket.
<P>The <CODE>module</CODE> option makes it possible for the user to provide
their own callback module. The functions <CODE>receive_message/4</CODE> or
<CODE>process_received_message/4</CODE> of this module is called when a new
message is received (which one depends on the size of the message;
small - receive_message, large - process_received_message).
Default value is <STRONG>megaco</STRONG>.
</DIV>
<P><A NAME="close/2"><STRONG><CODE>close(Handle, Msg) -> ok</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
<STRONG><CODE>Msg</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> This function is used for closing an active UDP socket.
</DIV>
<P><A NAME="socket/1"><STRONG><CODE>socket(Handle) -> Socket</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
<STRONG><CODE>Socket = inet_socket()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> This function is used to convert a socket_handle() to
a inet_socket(). inet_socket() is a plain socket,
see the inet module for more info.
</DIV>
<P><A NAME="create_send_handle/3"><STRONG><CODE>create_send_handle(Handle, Host, Port) -> send_handle()</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
<STRONG><CODE>Host = {A,B,C,D} | string()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> Creates a send handle from a transport handle. The send
handle is intended to be used by megaco_udp:send_message/2.
</DIV>
<P><A NAME="send_message/2"><STRONG><CODE>send_message(SendHandle, Msg) -> ok</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>SendHandle = send_handle()</CODE></STRONG><BR>
<STRONG><CODE>Message = binary() | iolist()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> Sends a message on a socket. The send handle is obtained by
megaco_udp:create_send_handle/3. Increments the NumOutMessages
and NumOutOctets counters if message successfully sent. In case
of a failure to send, the NumErrors counter is <STRONG>not</STRONG>
inremented. This is done elsewhere in the megaco app.
</DIV>
<P><A NAME="block/1"><STRONG><CODE>block(Handle) -> ok</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> Stop receiving incoming messages on the socket.
</DIV>
<P><A NAME="unblock/1"><STRONG><CODE>unblock(Handle) -> ok</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> Starting to receive incoming messages from the socket again.
<A NAME="upgrade_receive_handle"><!-- Empty --></A>
</DIV>
<P><A NAME="upgrade_receive_handle/2"><STRONG><CODE>upgrade_receive_handle(ControlPid, NewHandle) -> ok</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>ControlPid = pid()</CODE></STRONG><BR>
<STRONG><CODE>NewHandle = receive_handle()</CODE></STRONG><BR>
<STRONG><CODE>receive_handle() = term()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> Update the receive handle of the control process (e.g. after
having changed protocol version).
<A NAME="stats"><!-- Empty --></A>
</DIV>
<P><A NAME="get_stats/0"><STRONG><CODE>get_stats() -> {ok, TotalStats} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="get_stats/1"><STRONG><CODE>get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="get_stats/2"><STRONG><CODE>get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>TotalStats = [total_stats()]</CODE></STRONG><BR>
<STRONG><CODE>total_stats() = {send_handle(), [stats()]}</CODE></STRONG><BR>
<STRONG><CODE>SendHandle = send_handle()</CODE></STRONG><BR>
<STRONG><CODE>SendHandleStats = [stats()]</CODE></STRONG><BR>
<STRONG><CODE>Counter = udp_stats_counter()</CODE></STRONG><BR>
<STRONG><CODE>CounterStats = integer()</CODE></STRONG><BR>
<STRONG><CODE>stats() = {udp_stats_counter(), integer()}</CODE></STRONG><BR>
<STRONG><CODE>tcp_stats_counter() = medGwyGatewayNumInMessages |
medGwyGatewayNumInOctets | medGwyGatewayNumOutMessages |
medGwyGatewayNumOutOctets | medGwyGatewayNumErrors</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> Retreive the UDP related (SNMP) statistics counters.
</DIV>
<P><A NAME="reset_stats/0"><STRONG><CODE>reset_stats() -> void()</CODE></STRONG></A><BR>
<A NAME="reset_stats/1"><STRONG><CODE>reset_stats(SendHandle) -> void()</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>SendHandle = send_handle()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> Reset all TCP related (SNMP) statistics counters.
</DIV>
<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Lars Thorsn - support@erlang.ericsson.se<BR>
</DIV>
<CENTER>
<HR>
<SMALL>megaco 3.5<BR>
Copyright © 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>
|