aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/user_tests_SUITE_data/src/gcp.hrl
blob: aac87d8b6b12b62848a05c4d46f030c8f404349b (plain) (blame)
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
%%% #0.    BASIC INFORMATION
%%% ----------------------------------------------------------
%%% %CCaseFile:	gcp.hrl %
%%% Author:      EAB/UPD/AV
%%% Description: Internal include file.
%%% ----------------------------------------------------------
-hrl_id('9/190 55-CNA 113 033 Ux').
-hrl_vsn('/main/R1A/21').
-hrl_date('2005-05-31').
-hrl_author('uabasve').
%%% %CCaseTemplateFile:	module.hrl %
%%% %CCaseTemplateId: 17/002 01-FEA 202 714 Ux, Rev: /main/4 %
%%%
%%% Copyright (C) 2000-2005 by Ericsson Telecom AB
%%% SE-126 25  STOCKHOLM
%%% SWEDEN, tel int + 46 8 719 0000
%%% 
%%% The program may be used and/or copied only with the written
%%% permission from Ericsson Telecom AB, or in accordance with
%%% the terms and conditions stipulated in the agreement/contract
%%% under which the program has been supplied.
%%%   
%%% All rights reserved
%%%
%%% ----------------------------------------------------------
%%% #1.    REVISION LOG
%%% ----------------------------------------------------------
%%% Rev        Date       Name        What
%%% -----      -------    --------    ------------------------
%%% R1A/1      05-02-07   uabasve    Copied from EAS R7A/9
%%% R1A/2      05-02-08   ejojmjn    Removed SAAL
%%% R1A/3-     05-03-18   uabasve    Clean.
%%% ----------------------------------------------------------
%%% 
%%% #2.    CODE
%%% #---------------------------------------------------------
%%% #2.1   DEFINITION OF CONSTANTS
%%% #---------------------------------------------------------

%% Keys into gcpVariables for various options/values.
-define(TRAFFIC_DESCRIPTOR_KEY, traffic_descriptor).

%% H.248 version at link creation.
-define(INITIAL_H248_VERSION, 1).

%% Exceptions for use within a module. ?MODULE is just extra protection
%% against catching something unexpected.
-define(THROW(Reason), throw({error, ?MODULE, ?LINE, Reason})).
-define(CATCH(Expr),   try Expr
                       catch throw: ?FAILURE(Reason) -> {error, Reason}
                       end).
-define(FAILURE(T), {error, ?MODULE, _, T}).

%% The SendHandle used by a GCP transport process must be a tuple
%% of length >= 2 whose first two elements are the pid of the
%% transport process and index (aka #gcpLinkTable.key) of the link
%% upon which incoming data has arrived.
-define(SH_PID(SendHandle),  element(1, SendHandle)).
-define(SH_LINK(SendHandle), element(2, SendHandle)).
-define(SH_SET_PID(SendHandle, Pid), setelement(1, SendHandle, Pid)).

%% Megaco process that CH and OM servers monitor. This needs to be
%% replaced by a documented method.
-define(MEGACO_APP, megaco_config).

%% The message that gcpI:send_reply sends to the process that's waiting
%% for an action reply.
-define(ACTION_REPLY_MESSAGE(ActionReplies, Result),
        {reply, ActionReplies, Result}).

%%% #---------------------------------------------------------
%%% #2.2   DEFINITION OF RECORDS
%%% #---------------------------------------------------------

-record(mg, {pref}).
-record(mgc, {mgid}).

%% User configuration that gets mapped into megaco user info by
%% gcpLib:make_user_info/1. GCP exposes only a subset of what's
%% possible to set in megaco.
-record(user_config,
        {reply_timer          = 30000, %% ms to wait for reply ack
         %% Incoming transactions:
         pending_timer        = 10000, %% ms until outgoing transaction pending
         sent_pending_limit   = 5,     %% nr of outgoing pendings before 506
         %% Outgoing transactions:
         recv_pending_limit   = infinity,%% nr of incoming pendings before fail
         request_timer        = 3000,  %% ms to wait for response before resend
         request_retries      = 5,     %% nr unanswered sends before fail
         long_request_timer   = 15000, %% ms to wait for reply after pending
         long_request_retries = 5}).   %% nr of pendings/timeouts before fail

%% Record passed into transport implementations at transport start.
%% Expected to be passed back to gcpTransportI.
-record(receive_handle,
        {megaco_receive_handle,  %% passed to megaco:receive_message
         receive_message}).      %% gcpLinkTable.receive_message

%%% ---------------------------------------------------------------------------
%%% # gcpRegistrationTable
%%%
%%% Record containing defined MGC's/MG's (aka megaco users).
%%% ---------------------------------------------------------------------------

-record(gcpRegistrationTable,
        {key,                    %% user reference (aka MG/MGC id)
         role,                   %% mg | mgc
         mid,                    %% H.248 mid of the MGC/MG
         version,                %% of H.248
         callback,               %% {Module, ExtraArgs}
         config = #user_config{}}).

%%% ----------------------------------------------------------
%%% # gcpLinkTable
%%% ----------------------------------------------------------

-record(gcpLinkTable,
        {key,                    %% link reference
         endpoint,               %% #mgc{} | #mg{}
         user,                   %% registration table key
         chid,                   %% call handler of transport
         admin_state,            %% up | down
         op_state,               %% up | down | pending | disabled
         restart = auto,         %% auto | user
         encoding_mod,           %% module implementing megaco_encoder
         encoding_config,        %% as passed to encoding_mod
         transport_start,        %% {M,F,ExtraArgs} for transport start
         transport_data,         %% arbitrary, passed to transport_mod
         send_message,           %% {default|sysrpc|transport|module, Module}
         receive_message,        %% local | {M,F,ExtraArgs} for decode node
         tried = false,          %% Only for links owned by a MG.
                                 %% Used to indicate that a setup attempt
                                 %% has been performed on this link.
         t95_period = 350000}).

%%% ----------------------------------------------------------
%%% # gcpActiveLinkTable
%%% ----------------------------------------------------------

-record(gcpActiveLinkTable,
        {key,                    %% {mg|mgc, MgId}
         link,                   %% link reference
         chid,                   %% CH the link is tied to
         node,                   %% node the link is on
         conn_handle,            %% record megaco_conn_handle
         send_handle,            %% {TransportPid, LinkIdx, ...}
         version = ?INITIAL_H248_VERSION}).

%%% ----------------------------------------------------------
%%% # gcpVariables
%%% ----------------------------------------------------------

-record(gcpVariables,
        {key,
         value}).

%%% ----------------------------------------------------------
%%% # gcpReplyData
%%% ----------------------------------------------------------

-record(gcpReplyData,
        {callback,               %% {Module, Args}
         mgid,
         user_data,              %% As passed by the user on send
         prio,
         timestamp}).