.TH megaco_udp 3erl "megaco 4.4.3" "Ericsson AB" "Erlang Module Definition" .SH NAME megaco_udp \- Interface module to UDP transport protocol for Megaco/H.248. .SH DESCRIPTION .LP This module contains the public interface to the UDP/IP version transport protocol for Megaco/H\&.248\&. .SH EXPORTS .LP .B start_transport() -> {ok, TransportRef} .br .RS .LP Types: .RS 3 TransportRef = pid() .br .RE .RE .RS .LP This function is used for starting the UDP/IP transport service\&. Use exit(TransportRef, Reason) to stop the transport service\&. .RE .LP .B open(TransportRef, OptionList) -> {ok, Handle, ControlPid} | {error, Reason} .br .RS .LP Types: .RS 3 TransportRef = pid() | regname() .br OptionList = [option()] .br option() = {port, integer()} | {options, list()} | {receive_handle, receive_handle()} | {module, atom()} | {inet_backend, default | inet | socket} .br Handle = socket_handle() .br receive_handle() = term() .br ControlPid = pid() .br Reason = term() .br .RE .RE .RS .LP This function is used to open an UDP/IP socket\&. .RS 2 .TP 2 .B \fImodule\fR\&: The option makes it possible for the user to provide their own callback module\&. The functions \fIreceive_message/4\fR\& or \fIprocess_received_message/4\fR\& of this module is called when a new message is received\&. Which one depends on the size of the message: .RS 2 .TP 2 .B \fIsmall\fR\&: receive_message .TP 2 .B \fIlarge\fR\&: process_received_message .RE .RS 2 .LP Default value is \fImegaco\fR\&\&. .RE .RE .RE .LP .B close(Handle, Msg) -> ok .br .RS .LP Types: .RS 3 Handle = socket_handle() .br Msg .br .RE .RE .RS .LP This function is used for closing an active UDP socket\&. .RE .LP .B socket(Handle) -> Socket .br .RS .LP Types: .RS 3 Handle = socket_handle() .br Socket = inet_socket() .br .RE .RE .RS .LP 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\&. .RE .LP .B create_send_handle(Handle, Host, Port) -> send_handle() .br .RS .LP Types: .RS 3 Handle = socket_handle() .br Host = {A,B,C,D} | string() .br Port = integer() .br .RE .RE .RS .LP Creates a send handle from a transport handle\&. The send handle is intended to be used by megaco_udp:send_message/2\&. .RE .LP .B send_message(SendHandle, Msg) -> ok .br .RS .LP Types: .RS 3 SendHandle = send_handle() .br Message = binary() | iolist() .br .RE .RE .RS .LP 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 \fInot\fR\& incremented\&. This is done elsewhere in the megaco app\&. .RE .LP .B block(Handle) -> ok .br .RS .LP Types: .RS 3 Handle = socket_handle() .br .RE .RE .RS .LP Stop receiving incoming messages on the socket\&. .RE .LP .B unblock(Handle) -> ok .br .RS .LP Types: .RS 3 Handle = socket_handle() .br .RE .RE .RS .LP Starting to receive incoming messages from the socket again\&. .RE .LP .B upgrade_receive_handle(ControlPid, NewHandle) -> ok .br .RS .LP Types: .RS 3 ControlPid = pid() .br NewHandle = receive_handle() .br receive_handle() = term() .br .RE .RE .RS .LP Update the receive handle of the control process (e\&.g\&. after having changed protocol version)\&. .RE .LP .B get_stats() -> {ok, TotalStats} | {error, Reason} .br .B get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason} .br .B get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason} .br .RS .LP Types: .RS 3 TotalStats = [total_stats()] .br total_stats() = {send_handle(), [stats()]} .br SendHandle = send_handle() .br SendHandleStats = [stats()] .br Counter = udp_stats_counter() .br CounterStats = integer() .br stats() = {udp_stats_counter(), integer()} .br tcp_stats_counter() = medGwyGatewayNumInMessages | medGwyGatewayNumInOctets | medGwyGatewayNumOutMessages | medGwyGatewayNumOutOctets | medGwyGatewayNumErrors .br Reason = term() .br .RE .RE .RS .LP Retreive the UDP related (SNMP) statistics counters\&. .RE .LP .B reset_stats() -> void() .br .B reset_stats(SendHandle) -> void() .br .RS .LP Types: .RS 3 SendHandle = send_handle() .br .RE .RE .RS .LP Reset all TCP related (SNMP) statistics counters\&. .RE