Interface module to TPKT transport protocol for Megaco/H.248.
This module contains the public interface to the TPKT (TCP/IP) version transport protocol for Megaco/H.248.
Summary
Types
Defines the different counters handled by this transport.
An opaque data type representing a TPKT connection.
Functions
Stop receiving incoming messages on the socket.
This function is used for closing an active TPKT connection.
This function is used to open a TPKT connection.
Get all counter values for all known connections.
Get all counter values for a given (connection) handle.
Get the value of a specific counter.
This function is used for starting new TPKT listening socket for TCP/IP. The option list contains the socket definitions.
Reset all counters for all connections.
Reset all counters for the given connection.
Sends a message on a TPKT connection.
This function is used to convert a socket handle() to a inet socket().
This function is used for starting the TCP/IP transport service. Use exit(TransportRef, Reason) to stop the transport service.
Starting to receive incoming messages from the socket again.
Upgrade the receive handle of the control process (e.g. after having changed protocol version).
Types
-type counter() ::
medGwyGatewayNumInMessages | medGwyGatewayNumInOctets | medGwyGatewayNumOutMessages |
medGwyGatewayNumOutOctets | medGwyGatewayNumErrors.
Defines the different counters handled by this transport.
-opaque handle()
An opaque data type representing a TPKT connection.
Functions
block(Handle :: handle()) -> ok
Stop receiving incoming messages on the socket.
close(Handle :: handle()) -> ok
This function is used for closing an active TPKT connection.
Types
TransportRef = pid() | RegName
Opts = [Option]
Result = {ok, Handle, ControlPid} | {error, Reason}
Host = inet:socket_address() | inet:hostname()
Reason = term()
ControlPid = pid()
Option = {inet_backend, default | inet | socket} |
{host, Host} |
{port, PortNum} |
{options, list()} |
{receive_handle, term()} |
{module, atom()}
Handle = handle()
RegName = atom()
PortNum = inet:port_number()
This function is used to open a TPKT connection.
module- This option makes it possible for the user to provide their own callback module. Thereceive_message/4orprocess_received_message/4functions of this module is called when a new message is received. Which one is called depends on the size of the message;small- receive_messagelarge- process_received_message
Default value is megaco.
inet_backend- Choose the inet-backend.This option make it possible to use a different inet-backend ('default', 'inet' or 'socket').
Default is
default(system default).
Types
Result = {ok, TotalStats} | {error, Reason}
Reason = term()
TotalStats = [{Handle, [{Counter, integer()}]}]
Counter = counter()
Handle = handle()
Get all counter values for all known connections.
get_stats(Handle :: handle()) -> Result
Types
Result = {ok, Stats} | {error, Reason}
Reason = term()
Stats = [{Counter, integer()}]
Counter = counter()
Get all counter values for a given (connection) handle.
Types
Handle = handle()
Counter = counter()
Result = {ok, integer()} | {error, Reason}
Reason = term()
Get the value of a specific counter.
listen(TransportRef :: pid() | RegName, Options :: [Option]) -> ok
Types
Option = {inet_backend, default | inet | socket} |
{port, inet:port_number()} |
{options, list()} |
{receive_handle, term()}
RegName = atom()
This function is used for starting new TPKT listening socket for TCP/IP. The option list contains the socket definitions.
inet_backend- Choose the inet-backend.This option make it possible to use a different inet-backend ('default', 'inet' or 'socket').
Default is
default(system default).
reset_stats() -> megaco:void()
Reset all counters for all connections.
reset_stats(Handle :: handle()) -> megaco:void()
Reset all counters for the given connection.
Sends a message on a TPKT connection.
socket(Handle :: handle()) -> Socket
Types
Socket = inet:socket()
This function is used to convert a socket handle() to a inet socket().
Types
TransportRef = pid()
This function is used for starting the TCP/IP transport service. Use exit(TransportRef, Reason) to stop the transport service.
unblock(Handle :: handle()) -> ok
Starting to receive incoming messages from the socket again.
Upgrade the receive handle of the control process (e.g. after having changed protocol version).