summaryrefslogtreecommitdiff
path: root/lib/megaco/doc/src/megaco_udp.xml
blob: 4352cc0430066f21844aa97d9dfd338b8ae9a62e (plain)
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
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2000</year><year>2013</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      The contents of this file are subject to the Erlang Public License,
      Version 1.1, (the "License"); you may not use this file except in
      compliance with the License. You should have received a copy of the
      Erlang Public License along with this software. If not, it can be
      retrieved online at http://www.erlang.org/.
    
      Software distributed under the License is distributed on an "AS IS"
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
      the License for the specific language governing rights and limitations
      under the License.
    
    </legalnotice>

    <title>megaco_udp</title>
    <prepared>Lars Thors&eacute;n</prepared>
    <responsible>Lars Thors&eacute;n</responsible>
    <docno></docno>
    <approved>Lars Thors&eacute;n</approved>
    <checked></checked>
    <date>2007-06-15</date>
    <rev>%VSN%</rev>
    <file>megaco_udp.xml</file>
  </header>
  <module>megaco_udp</module>
  <modulesummary>Interface module to UDP transport protocol for Megaco/H.248.</modulesummary>
  <description>
    <p>This module contains the public interface to the UDP/IP version
      transport protocol for Megaco/H.248.</p>
  </description>
  <funcs>
    <func>
      <name>start_transport() -> {ok, TransportRef}</name>
      <fsummary></fsummary>
      <type>
        <v>TransportRef = pid()</v>
      </type>
      <desc>
        <p>This function is used for starting the UDP/IP transport service.
          Use exit(TransportRef, Reason) to stop the transport service.</p>
      </desc>
    </func>
    <func>
      <name>open(TransportRef, OptionList) ->  {ok, Handle, ControlPid} |  {error, Reason}</name>
      <fsummary></fsummary>
      <type>
        <v>TransportRef = pid() | regname()</v>
        <v>OptionList = [option()]</v>
        <v>option() = {port, integer()} |{options, list()} |{receive_handle, receive_handle()} |{module, atom()}</v>
        <v>Handle = socket_handle()</v>
        <v>receive_handle() = term()</v>
        <v>ControlPid = pid()</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>This function is used to open an UDP/IP socket.</p>
        <p>The <c><![CDATA[module]]></c> option makes it possible for the user to provide
          their own callback module. The functions <c><![CDATA[receive_message/4]]></c> or
          <c><![CDATA[process_received_message/4]]></c> 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 <em>megaco</em>.</p>
      </desc>
    </func>
    <func>
      <name>close(Handle, Msg) -> ok</name>
      <fsummary></fsummary>
      <type>
        <v>Handle = socket_handle()</v>
        <v>Msg</v>
      </type>
      <desc>
        <p>This function is used for closing an active UDP socket.</p>
      </desc>
    </func>
    <func>
      <name>socket(Handle) -> Socket</name>
      <fsummary></fsummary>
      <type>
        <v>Handle = socket_handle()</v>
        <v>Socket = inet_socket()</v>
      </type>
      <desc>
        <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.</p>
      </desc>
    </func>
    <func>
      <name>create_send_handle(Handle, Host, Port) -> send_handle()</name>
      <fsummary></fsummary>
      <type>
        <v>Handle = socket_handle()</v>
        <v>Host = {A,B,C,D} | string()</v>
        <v>Port = integer()</v>
      </type>
      <desc>
        <p>Creates a send handle from a transport handle.  The send
          handle is intended to be used by megaco_udp:send_message/2.</p>
      </desc>
    </func>
    <func>
      <name>send_message(SendHandle, Msg) -> ok</name>
      <fsummary></fsummary>
      <type>
        <v>SendHandle = send_handle()</v>
        <v>Message = binary() | iolist()</v>
      </type>
      <desc>
        <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 <em>not</em>
          incremented. This is done elsewhere in the megaco app.</p>
      </desc>
    </func>
    <func>
      <name>block(Handle) -> ok</name>
      <fsummary></fsummary>
      <type>
        <v>Handle = socket_handle()</v>
      </type>
      <desc>
        <p>Stop receiving incoming messages on the socket.</p>
      </desc>
    </func>
    <func>
      <name>unblock(Handle) -> ok</name>
      <fsummary></fsummary>
      <type>
        <v>Handle = socket_handle()</v>
      </type>
      <desc>
        <p>Starting to receive incoming messages from the socket again.</p>
        <marker id="upgrade_receive_handle"></marker>
      </desc>
    </func>
    <func>
      <name>upgrade_receive_handle(ControlPid, NewHandle) -> ok</name>
      <fsummary></fsummary>
      <type>
        <v>ControlPid = pid()</v>
        <v>NewHandle = receive_handle()</v>
        <v>receive_handle() = term()</v>
      </type>
      <desc>
        <p>Update the receive handle of the control process (e.g. after
          having changed protocol version).</p>
        <marker id="stats"></marker>
      </desc>
    </func>
    <func>
      <name>get_stats() -> {ok, TotalStats} | {error, Reason}</name>
      <name>get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason}</name>
      <name>get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason}</name>
      <fsummary></fsummary>
      <type>
        <v>TotalStats = [total_stats()]</v>
        <v>total_stats() = {send_handle(), [stats()]}</v>
        <v>SendHandle = send_handle()</v>
        <v>SendHandleStats = [stats()]</v>
        <v>Counter = udp_stats_counter()</v>
        <v>CounterStats = integer()</v>
        <v>stats() = {udp_stats_counter(), integer()}</v>
        <v>tcp_stats_counter() = medGwyGatewayNumInMessages |  medGwyGatewayNumInOctets | medGwyGatewayNumOutMessages | medGwyGatewayNumOutOctets | medGwyGatewayNumErrors</v>
        <v>Reason = term()</v>
      </type>
      <desc>
        <p>Retreive the UDP related (SNMP) statistics counters.</p>
      </desc>
    </func>
    <func>
      <name>reset_stats() -> void()</name>
      <name>reset_stats(SendHandle) -> void()</name>
      <fsummary></fsummary>
      <type>
        <v>SendHandle = send_handle()</v>
      </type>
      <desc>
        <p>Reset all TCP related (SNMP) statistics counters.</p>
      </desc>
    </func>
  </funcs>

</erlref>