1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
5%%
6%% Licensed under the Apache License, Version 2.0 (the "License");
7%% you may not use this file except in compliance with the License.
8%% You may obtain a copy of the License at
9%%
10%%     http://www.apache.org/licenses/LICENSE-2.0
11%%
12%% Unless required by applicable law or agreed to in writing, software
13%% distributed under the License is distributed on an "AS IS" BASIS,
14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15%% See the License for the specific language governing permissions and
16%% limitations under the License.
17%%
18%% %CopyrightEnd%
19%%
20
21%%
22%%-----------------------------------------------------------------
23%% Purpose: Define the protocol options for Megaco/H.248 IP connections
24%%-----------------------------------------------------------------
25
26%%----------------------------------------------------------------------
27%% IP options
28%%----------------------------------------------------------------------
29-record(megaco_udp,
30	{port,
31	 options   = [],
32	 socket,
33	 receive_handle,
34	 module    = megaco,
35	 serialize = false  % false: Spawn a new process for each message
36	}).
37
38
39-define(GC_MSG_LIMIT,1000).
40-define(HEAP_SIZE(S),5000 + 2*(S)).
41
42
43%%----------------------------------------------------------------------
44%% Event Trace
45%%----------------------------------------------------------------------
46
47-define(udp_report(Level, UdpRec, From, To, Label, Contents),
48	megaco:report_event(Level, From, To, Label,
49			    [{line, ?MODULE, ?LINE}, UdpRec | Contents])).
50
51-define(udp_debug(UdpRec, Label, Contents),
52	?udp_report_debug(UdpRec,
53			  megaco_udp,
54			  megaco_udp,
55			  Label,
56			  Contents)).
57
58-define(udp_report_important(C, From, To, Label, Contents),
59	?udp_report(20, C, From, To, Label, Contents)).
60-define(udp_report_verbose(C,   From, To, Label, Contents),
61	?udp_report(40, C, From, To, Label, Contents)).
62-define(udp_report_debug(C,     From, To, Label, Contents),
63	?udp_report(60, C, From, To, Label, Contents)).
64-define(udp_report_trace(C,     From, To, Label, Contents),
65	?udp_report(80, C, From, To, Label, Contents)).
66