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

NAME

6       megaco_tcp   -   Interface   module  to  TPKT  transport  protocol  for
7       Megaco/H.248.
8

DESCRIPTION

10       This module contains the public interface to the TPKT (TCP/IP)  version
11       transport 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 TCP/IP transport service.
21              Use exit(TransportRef, Reason) to stop the transport service.
22
23       listen(TransportRef, ListenPortSpecList) -> ok
24
25              Types:
26
27                 TransportRef = pid() | regname()
28                 OptionListPerPort = [Option]
29                 Option  =  {port,  integer()}  |  {options,  list()}  |  {re‐
30                 ceive_handle,  term()}  |  {inet_backend,  default  |  inet |
31                 socket}
32
33              This function is used for starting new TPKT listening socket for
34              TCP/IP. The option list contains the socket definitions.
35
36       connect(TransportRef, OptionList) -> {ok, Handle, ControlPid} | {error,
37       Reason}
38
39              Types:
40
41                 TransportRef = pid() | regname()
42                 OptionList = [Option]
43                 Option = {host,  IpAddr}  |  {port,  integer()}  |  {options,
44                 list()}  |  {receive_handle,  term()}  |  {module,  atom()} |
45                 {inet_backend, default | inet | socket}
46                 Handle = socket_handle()
47                 ControlPid = pid()
48                 Reason = term()
49
50              This function is used to open a TPKT connection.
51
52                module:
53                  This option makes it possible for the user to provide  their
54                  own  callback  module.  The receive_message/4 or process_re‐
55                  ceived_message/4 functions of this module is called  when  a
56                  new  message is received. Which one is called depends on the
57                  size of the message;
58
59                  small:
60                    receive_message
61
62                  large:
63                    process_received_message
64
65                  Default value is megaco.
66
67       close(Handle) -> ok
68
69              Types:
70
71                 Handle = socket_handle()
72
73              This function is used for closing an active TPKT connection.
74
75       socket(Handle) -> Socket
76
77              Types:
78
79                 Handle = socket_handle()
80                 Socket = inet_socket()
81
82              This  function  is  used  to  convert  a  socket_handle()  to  a
83              inet_socket().  inet_socket()  is  a  plain socket, see the inet
84              module for more info.
85
86       send_message(Handle, Message) -> ok
87
88              Types:
89
90                 Handle = socket_handle()
91                 Message = binary() | iolist()
92
93              Sends a message on a connection.
94
95       block(Handle) -> ok
96
97              Types:
98
99                 Handle = socket_handle()
100
101              Stop receiving incoming messages on the socket.
102
103       unblock(Handle) -> ok
104
105              Types:
106
107                 Handle = socket_handle()
108
109              Starting to receive incoming messages from the socket again.
110
111       upgrade_receive_handle(ControlPid) -> ok
112
113              Types:
114
115                 ControlPid = pid()
116
117              Update the receive handle of the  control  process  (e.g.  after
118              having changed protocol version).
119
120       get_stats() -> {ok, TotalStats} | {error, Reason}
121       get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason}
122       get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason}
123
124              Types:
125
126                 TotalStats = [send_handle_stats()]
127                 total_stats() = {send_handle(), [stats()]}
128                 SendHandle = send_handle()
129                 SendHandleStats = [stats()]
130                 Counter = tcp_stats_counter()
131                 CounterStats = integer()
132                 stats() = {tcp_stats_counter(), integer()}
133                 tcp_stats_counter()   =  medGwyGatewayNumInMessages  |  medG‐
134                 wyGatewayNumInOctets |  medGwyGatewayNumOutMessages  |  medG‐
135                 wyGatewayNumOutOctets | medGwyGatewayNumErrors
136                 Reason = term()
137
138              Retreive the TCP related (SNMP) statistics counters.
139
140       reset_stats() -> void()
141       reset_stats(SendHandle) -> void()
142
143              Types:
144
145                 SendHandle = send_handle()
146
147              Reset all TCP related (SNMP) statistics counters.
148
149
150
151Ericsson AB                       megaco 4.1                     megaco_tcp(3)
Impressum