blob: adcb8b5d212deee9edee8a6f867dd75e77139958 [file] [log] [blame]
Daniel Willmannfa870f52018-01-17 12:37:14 +01001module MGCP_Emulation {
2
Harald Weltea02515f2018-01-26 10:33:23 +01003/* MGCP Emulation, runs on top of MGCP_CodecPort. It multiplexes/demultiplexes
4 * the individual connections, so there can be separate TTCN-3 components handling
5 * each of the connections.
6 *
7 * The MGCP_Emulation.main() function processes MGCP primitives from the MGCP
8 * socket via the MGCP_CodecPort, and dispatches them to the per-connection components.
9 *
10 * For each new inbound connection, the MgcpOps.create_cb() is called. It can create
11 * or resolve a TTCN-3 component, and returns a component reference to which that inbound
12 * connection is routed/dispatched.
13 *
14 * If a pre-existing component wants to register to handle a future inbound call, it can
15 * do so by registering an "expect" with the expected destination phone number. This is e.g. useful
16 * if you are simulating BSC + MGCP, and first trigger a connection from BSC side in a
17 * component which then subsequently should also handle the MGCP emulation.
18 *
19 * Inbound Unit Data messages (such as are dispatched to the MgcpOps.unitdata_cb() callback,
20 * which is registered with an argument to the main() function below.
21 *
22 * (C) 2017-2018 by Harald Welte <laforge@gnumonks.org>
23 * (C) 2018 by sysmocom - s.f.m.c. GmbH, Author: Daniel Willmann
24 * All rights reserved.
25 *
26 * Released under the terms of GNU General Public License, Version 2 or
27 * (at your option) any later version.
28 */
29
Daniel Willmannfa870f52018-01-17 12:37:14 +010030import from MGCP_CodecPort all;
31import from MGCP_CodecPort_CtrlFunct all;
32import from MGCP_Types all;
33import from MGCP_Templates all;
34import from Osmocom_Types all;
35import from IPL4asp_Types all;
36
37type component MGCP_ConnHdlr {
38 port MGCP_Conn_PT MGCP;
Harald Weltebb5a1212018-01-26 10:34:44 +010039 /* procedure based port to register for incoming connections */
40 port MGCPEM_PROC_PT MGCP_PROC;
Daniel Willmannfa870f52018-01-17 12:37:14 +010041}
42
43/* port between individual per-connection components and this dispatcher */
44type port MGCP_Conn_PT message {
45 inout MgcpCommand, MgcpResponse;
46} with { extension "internal" };
47
Harald Welte9601c812018-01-26 18:58:20 +010048/* represents a single MGCP Endpoint */
49type record EndpointData {
Harald Weltebb5a1212018-01-26 10:34:44 +010050 MGCP_ConnHdlr comp_ref,
Harald Welte9601c812018-01-26 18:58:20 +010051 MgcpEndpoint endpoint optional
Harald Weltebb5a1212018-01-26 10:34:44 +010052};
Daniel Willmannfa870f52018-01-17 12:37:14 +010053
Harald Welte9601c812018-01-26 18:58:20 +010054/* pending CRCX with their transaction ID */
55type set of MgcpTransId MgcpTransIds;
56
Daniel Willmannfa870f52018-01-17 12:37:14 +010057type component MGCP_Emulation_CT {
58 /* Port facing to the UDP SUT */
59 port MGCP_CODEC_PT MGCP;
60 /* All MGCP_ConnHdlr MGCP ports connect here
61 * MGCP_Emulation_CT.main needs to figure out what messages
62 * to send where with CLIENT.send() to vc_conn */
Harald Weltebb5a1212018-01-26 10:34:44 +010063 port MGCP_Conn_PT MGCP_CLIENT;
Daniel Willmannfa870f52018-01-17 12:37:14 +010064 /* currently tracked connections */
Harald Welte9601c812018-01-26 18:58:20 +010065 var EndpointData MgcpEndpointTable[16];
66 var MgcpTransIds MgcpPendingTrans := {};
Daniel Willmannfa870f52018-01-17 12:37:14 +010067 /* pending expected CRCX */
Harald Weltebb5a1212018-01-26 10:34:44 +010068 var ExpectData MgcpExpectTable[8];
Daniel Willmannfa870f52018-01-17 12:37:14 +010069 /* procedure based port to register for incoming connections */
Harald Weltebb5a1212018-01-26 10:34:44 +010070 port MGCPEM_PROC_PT MGCP_PROC;
Daniel Willmannfa870f52018-01-17 12:37:14 +010071
72 var charstring g_mgcp_id;
Daniel Willmann166bbb32018-01-17 15:28:04 +010073 var integer g_mgcp_conn_id := -1;
Daniel Willmannfa870f52018-01-17 12:37:14 +010074}
75
76type function MGCPCreateCallback(MgcpCommand cmd, charstring id)
77runs on MGCP_Emulation_CT return MGCP_ConnHdlr;
78
Harald Weltebb5a1212018-01-26 10:34:44 +010079type function MGCPUnitdataCallback(MgcpMessage msg)
80runs on MGCP_Emulation_CT return template MgcpMessage;
81
Daniel Willmannfa870f52018-01-17 12:37:14 +010082type record MGCPOps {
Harald Weltebb5a1212018-01-26 10:34:44 +010083 MGCPCreateCallback create_cb,
84 MGCPUnitdataCallback unitdata_cb
Daniel Willmannfa870f52018-01-17 12:37:14 +010085}
86
87type record MGCP_conn_parameters {
Harald Weltebb5a1212018-01-26 10:34:44 +010088 HostName callagent_ip,
89 PortNumber callagent_udp_port,
90 HostName mgw_ip,
91 PortNumber mgw_udp_port
Daniel Willmannfa870f52018-01-17 12:37:14 +010092}
93
Daniel Willmann166bbb32018-01-17 15:28:04 +010094function tr_MGCP_RecvFrom_R(template MgcpMessage msg)
95runs on MGCP_Emulation_CT return template MGCP_RecvFrom {
96 var template MGCP_RecvFrom mrf := {
97 connId := g_mgcp_conn_id,
98 remName := ?,
99 remPort := ?,
100 locName := ?,
101 locPort := ?,
102 msg := msg
103 }
104 return mrf;
105}
106
Harald Welte9601c812018-01-26 18:58:20 +0100107private function f_ep_known(MgcpEndpoint ep)
Harald Weltebb5a1212018-01-26 10:34:44 +0100108runs on MGCP_Emulation_CT return boolean {
109 var integer i;
Harald Welte9601c812018-01-26 18:58:20 +0100110 for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) {
111 if (MgcpEndpointTable[i].endpoint == ep) {
Harald Weltebb5a1212018-01-26 10:34:44 +0100112 return true;
113 }
114 }
115 return false;
116}
117
118private function f_comp_known(MGCP_ConnHdlr client)
119runs on MGCP_Emulation_CT return boolean {
120 var integer i;
Harald Welte9601c812018-01-26 18:58:20 +0100121 for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) {
122 if (MgcpEndpointTable[i].comp_ref == client) {
Harald Weltebb5a1212018-01-26 10:34:44 +0100123 return true;
124 }
125 }
126 return false;
127}
128
Harald Welte9601c812018-01-26 18:58:20 +0100129private function f_comp_by_ep(MgcpEndpoint ep)
Harald Weltebb5a1212018-01-26 10:34:44 +0100130runs on MGCP_Emulation_CT return MGCP_ConnHdlr {
131 var integer i;
Harald Welte9601c812018-01-26 18:58:20 +0100132 for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) {
133 if (MgcpEndpointTable[i].endpoint == ep) {
134 return MgcpEndpointTable[i].comp_ref;
Harald Weltebb5a1212018-01-26 10:34:44 +0100135 }
136 }
Harald Welte9601c812018-01-26 18:58:20 +0100137 log("MGCP Endpoint Table not found by Endpoint", ep);
Harald Weltebb5a1212018-01-26 10:34:44 +0100138 setverdict(fail);
139 self.stop;
140}
141
Harald Welte9601c812018-01-26 18:58:20 +0100142private function f_ep_by_comp(MGCP_ConnHdlr client)
143runs on MGCP_Emulation_CT return MgcpEndpoint {
Harald Weltebb5a1212018-01-26 10:34:44 +0100144 var integer i;
Harald Welte9601c812018-01-26 18:58:20 +0100145 for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) {
146 if (MgcpEndpointTable[i].comp_ref == client) {
147 return MgcpEndpointTable[i].endpoint;
Harald Weltebb5a1212018-01-26 10:34:44 +0100148 }
149 }
Harald Welte9601c812018-01-26 18:58:20 +0100150 log("MGCP Endpoint Table not found by component ", client);
Harald Weltebb5a1212018-01-26 10:34:44 +0100151 setverdict(fail);
152 self.stop;
153}
154
Harald Welte9601c812018-01-26 18:58:20 +0100155private function f_ep_table_add(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep)
156runs on MGCP_Emulation_CT {
157 var integer i;
158 for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) {
159 if (not isvalue(MgcpEndpointTable[i].endpoint)) {
160 MgcpEndpointTable[i].endpoint := ep;
161 MgcpEndpointTable[i].comp_ref := comp_ref;
162 return;
163 }
164 }
165 setverdict(fail, "MGCP Endpoint Table full!");
166 self.stop;
167}
168
169private function f_ep_table_del(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep)
170runs on MGCP_Emulation_CT {
171 var integer i;
172 for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) {
173 if (MgcpEndpointTable[i].comp_ref == comp_ref and
174 MgcpEndpointTable[i].endpoint == ep) {
175 MgcpEndpointTable[i].endpoint := omit;
176 MgcpEndpointTable[i].comp_ref := null;
177 return;
178 }
179 }
180 setverdict(fail, "MGCP Endpoint Table: Couldn't find to-be-deleted entry!");
181 self.stop;
182}
183
184
185/* Check if the given transaction ID is a pending CRCX. If yes, return true + remove */
186private function f_trans_id_was_pending(MgcpTransId trans_id)
187runs on MGCP_Emulation_CT return boolean {
188 for (var integer i := 0; i < lengthof(MgcpPendingTrans); i := i+1) {
189 if (MgcpPendingTrans[i] == trans_id) {
190 /* Remove from list */
191 var MgcpTransIds OldPendingTrans := MgcpPendingTrans;
192 MgcpPendingTrans := {}
193 for (var integer j := 0; j < lengthof(OldPendingTrans); j := j+1) {
194 if (j != i) {
195 MgcpPendingTrans := MgcpPendingTrans & {OldPendingTrans[j]};
196 }
197 }
198 return true;
199 }
200 }
201 return false;
202}
203
Harald Weltebb5a1212018-01-26 10:34:44 +0100204/* TODO: move this to MGCP_Types? */
Harald Welte9601c812018-01-26 18:58:20 +0100205function f_mgcp_ep(MgcpMessage msg) return MgcpEndpoint {
Harald Weltebb5a1212018-01-26 10:34:44 +0100206 var MgcpParameterList params;
207 var integer i;
208 if (ischosen(msg.command)) {
Harald Welte9601c812018-01-26 18:58:20 +0100209 return msg.command.line.ep;
Harald Weltebb5a1212018-01-26 10:34:44 +0100210 } else {
Harald Welte363cb0a2018-01-30 19:35:53 +0100211 var MgcpEndpoint ep;
212 if (f_mgcp_find_param(msg, "Z", ep) == false) {
213 setverdict(fail, "No SpecificEndpointName in MGCP response", msg);
214 self.stop;
215 }
216 return ep;
Harald Weltebb5a1212018-01-26 10:34:44 +0100217 }
Harald Weltebb5a1212018-01-26 10:34:44 +0100218}
219
Harald Welte9601c812018-01-26 18:58:20 +0100220private function f_ep_table_init()
Harald Weltebb5a1212018-01-26 10:34:44 +0100221runs on MGCP_Emulation_CT {
Harald Welte9601c812018-01-26 18:58:20 +0100222 for (var integer i := 0; i < sizeof(MgcpEndpointTable); i := i+1) {
223 MgcpEndpointTable[i].comp_ref := null;
224 MgcpEndpointTable[i].endpoint := omit;
Harald Weltebb5a1212018-01-26 10:34:44 +0100225 }
226}
227
Daniel Willmann955627a2018-01-17 15:22:32 +0100228function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT {
Daniel Willmannfa870f52018-01-17 12:37:14 +0100229 var Result res;
230 g_mgcp_id := id;
Harald Welte9601c812018-01-26 18:58:20 +0100231 f_ep_table_init();
Daniel Willmann955627a2018-01-17 15:22:32 +0100232 f_expect_table_init();
Daniel Willmannfa870f52018-01-17 12:37:14 +0100233
234 map(self:MGCP, system:MGCP_CODEC_PT);
Harald Weltebb5a1212018-01-26 10:34:44 +0100235 if (p.callagent_udp_port == -1) {
236 res := MGCP_CodecPort_CtrlFunct.f_IPL4_listen(MGCP, p.mgw_ip, p.mgw_udp_port, { udp:={} });
237 } else {
238 res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, -1, { udp:={} });
239 }
240
Daniel Willmann166bbb32018-01-17 15:28:04 +0100241 g_mgcp_conn_id := res.connId;
Harald Weltebb5a1212018-01-26 10:34:44 +0100242
Daniel Willmannfa870f52018-01-17 12:37:14 +0100243 while (true) {
Daniel Willmann166bbb32018-01-17 15:28:04 +0100244 var MGCP_ConnHdlr vc_conn;
245 var ExpectCriteria crit;
246 var MGCP_RecvFrom mrf;
247 var MgcpMessage msg;
248 var MgcpCommand cmd;
249 var MgcpResponse resp;
Harald Welte9601c812018-01-26 18:58:20 +0100250 var MgcpEndpoint ep;
Daniel Willmann166bbb32018-01-17 15:28:04 +0100251
Daniel Willmannfa870f52018-01-17 12:37:14 +0100252 alt {
Daniel Willmann166bbb32018-01-17 15:28:04 +0100253 /* MGCP from client */
Harald Weltebb5a1212018-01-26 10:34:44 +0100254 [] MGCP_CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn {
Harald Welte9601c812018-01-26 18:58:20 +0100255 msg := {
256 response := resp
257 };
258 /* If this is the resposne to a pending CRCX, extract Endpoint and store in table */
259 if (f_trans_id_was_pending(resp.line.trans_id)) {
260 f_ep_table_add(vc_conn, f_mgcp_ep(msg));
261 }
Daniel Willmann166bbb32018-01-17 15:28:04 +0100262 /* Pass message through */
Harald Weltebb5a1212018-01-26 10:34:44 +0100263 /* TODO: check which ConnectionID client has allocated + store in table? */
Daniel Willmann166bbb32018-01-17 15:28:04 +0100264 MGCP.send(t_MGCP_Send(g_mgcp_conn_id, msg));
Daniel Willmannfa870f52018-01-17 12:37:14 +0100265 }
Daniel Willmann166bbb32018-01-17 15:28:04 +0100266 [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) -> value mrf {
Harald Weltebb5a1212018-01-26 10:34:44 +0100267 if (p.callagent_udp_port == -1) {
268 /* we aren't yet connected to the remote side port, let's fix this */
269 p.callagent_udp_port := mrf.remPort;
270 MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, g_mgcp_conn_id, { udp:={} });
271 }
Daniel Willmann166bbb32018-01-17 15:28:04 +0100272 if (ischosen(mrf.msg.command)) {
273 cmd := mrf.msg.command;
Harald Welte9601c812018-01-26 18:58:20 +0100274 if (f_ep_known(cmd.line.ep)) {
275 vc_conn := f_comp_by_ep(cmd.line.ep);
Harald Weltebb5a1212018-01-26 10:34:44 +0100276 MGCP_CLIENT.send(cmd) to vc_conn;
277 } else {
Harald Welte9601c812018-01-26 18:58:20 +0100278 if (cmd.line.verb == "CRCX") {
279 vc_conn := ops.create_cb.apply(cmd, id);
Harald Welte363cb0a2018-01-30 19:35:53 +0100280 if (not match(cmd.line.ep, t_MGCP_EP_wildcard)) {
281 /* non-wildcard EP, use directly */
Harald Welte9601c812018-01-26 18:58:20 +0100282 f_ep_table_add(vc_conn, cmd.line.ep);
283 } else {
284 /* add this transaction to list of pending transactions */
285 MgcpPendingTrans := MgcpPendingTrans & {cmd.line.trans_id};
286 }
287 MGCP_CLIENT.send(cmd) to vc_conn;
288 } else {
289 /* connectionless MGCP, i.e. messages without ConnectionId */
290 var template MgcpMessage r := ops.unitdata_cb.apply(mrf.msg);
291 if (isvalue(r)) {
292 MGCP.send(t_MGCP_Send(g_mgcp_conn_id, r));
293 }
Harald Weltebb5a1212018-01-26 10:34:44 +0100294 }
295 }
Daniel Willmann166bbb32018-01-17 15:28:04 +0100296 } else {
297 setverdict(fail, "Received unexpected MGCP response: ", mrf.msg.response);
298 self.stop;
299 }
Daniel Willmannfa870f52018-01-17 12:37:14 +0100300 }
Harald Weltebb5a1212018-01-26 10:34:44 +0100301 [] MGCP_PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) {
Daniel Willmann955627a2018-01-17 15:22:32 +0100302 f_create_expect(crit, vc_conn);
Harald Weltebb5a1212018-01-26 10:34:44 +0100303 MGCP_PROC.reply(MGCPEM_register:{crit, vc_conn});
Daniel Willmann955627a2018-01-17 15:22:32 +0100304 }
Harald Welte9601c812018-01-26 18:58:20 +0100305 [] MGCP_PROC.getcall(MGCPEM_delete_ep:{?,?}) -> param(ep, vc_conn) {
306 f_ep_table_del(vc_conn, ep);
307 MGCP_PROC.reply(MGCPEM_delete_ep:{ep, vc_conn});
308 }
Daniel Willmannfa870f52018-01-17 12:37:14 +0100309 }
Harald Welte9601c812018-01-26 18:58:20 +0100310
Daniel Willmannfa870f52018-01-17 12:37:14 +0100311 }
312}
313
314/* "Expect" Handling */
315
316/* */
Daniel Willmann955627a2018-01-17 15:22:32 +0100317type record ExpectCriteria {
318 MgcpConnectionId connid optional,
319 MgcpEndpoint endpoint optional,
320 MgcpTransId transid optional
Daniel Willmannfa870f52018-01-17 12:37:14 +0100321}
322
323type record ExpectData {
324 ExpectCriteria crit optional,
Daniel Willmann955627a2018-01-17 15:22:32 +0100325 MGCP_ConnHdlr vc_conn
Daniel Willmannfa870f52018-01-17 12:37:14 +0100326}
327
Daniel Willmann955627a2018-01-17 15:22:32 +0100328signature MGCPEM_register(in ExpectCriteria cmd, in MGCP_ConnHdlr hdlr);
Harald Welte9601c812018-01-26 18:58:20 +0100329signature MGCPEM_delete_ep(in MgcpEndpoint ep, in MGCP_ConnHdlr hdlr);
Daniel Willmannfa870f52018-01-17 12:37:14 +0100330
331type port MGCPEM_PROC_PT procedure {
Harald Welte9601c812018-01-26 18:58:20 +0100332 inout MGCPEM_register, MGCPEM_delete_ep;
Daniel Willmannfa870f52018-01-17 12:37:14 +0100333} with { extension "internal" };
334
335function f_get_mgcp_by_crit(ExpectCriteria crit)
336return template MgcpCommand {
Harald Weltebb5a1212018-01-26 10:34:44 +0100337 var template MgcpCommand ret := {
338 line := {
339 verb := ?,
340 trans_id := ?,
341 ep := ?,
342 ver := ?
343 },
344 params := *,
345 sdp := *
346 }
347 if (ispresent(crit.connid)) {
348 ret.params := { *, ts_MgcpParConnectionId(crit.connid), * };
349 }
350 if (ispresent(crit.endpoint)) {
351 ret.line.ep := crit.endpoint;
352 }
353 if (ispresent(crit.transid)) {
354 ret.line.trans_id := crit.transid;
355 }
Daniel Willmannfa870f52018-01-17 12:37:14 +0100356
357 return ret;
358}
359
360/* Function that can be used as create_cb and will usse the expect table */
361function ExpectedCreateCallback(MgcpCommand cmd, charstring id)
362runs on MGCP_Emulation_CT return MGCP_ConnHdlr {
363 var MGCP_ConnHdlr ret := null;
364 var template MgcpCommand mgcpcmd;
365 var integer i;
366
Harald Weltebb5a1212018-01-26 10:34:44 +0100367 for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) {
368 if (not ispresent(MgcpExpectTable[i].crit)) {
Daniel Willmannfa870f52018-01-17 12:37:14 +0100369 continue;
370 }
Daniel Willmann955627a2018-01-17 15:22:32 +0100371 /* FIXME: Ignore criteria for now */
Harald Weltebb5a1212018-01-26 10:34:44 +0100372 mgcpcmd := f_get_mgcp_by_crit(MgcpExpectTable[i].crit);
373 if (match(cmd, mgcpcmd)) {
374 ret := MgcpExpectTable[i].vc_conn;
Daniel Willmannfa870f52018-01-17 12:37:14 +0100375 /* Release this entry */
Harald Weltebb5a1212018-01-26 10:34:44 +0100376 MgcpExpectTable[i].crit := omit;
377 MgcpExpectTable[i].vc_conn := null;
Daniel Willmannfa870f52018-01-17 12:37:14 +0100378 log("Found Expect[", i, "] for ", cmd, " handled at ", ret);
379 return ret;
Harald Weltebb5a1212018-01-26 10:34:44 +0100380 }
Daniel Willmannfa870f52018-01-17 12:37:14 +0100381 }
382 setverdict(fail, "Couldn't find Expect for CRCX", cmd);
383 return ret;
384}
385
386private function f_create_expect(ExpectCriteria crit, MGCP_ConnHdlr hdlr)
387runs on MGCP_Emulation_CT {
388 var integer i;
389
390 /* Check an entry like this is not already presnt */
Harald Weltebb5a1212018-01-26 10:34:44 +0100391 for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) {
392 if (crit == MgcpExpectTable[i].crit) {
Daniel Willmannfa870f52018-01-17 12:37:14 +0100393 setverdict(fail, "Crit already present", crit);
394 self.stop;
395 }
396 }
Harald Weltebb5a1212018-01-26 10:34:44 +0100397 for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) {
398 if (not ispresent(MgcpExpectTable[i].crit)) {
399 MgcpExpectTable[i].crit := crit;
400 MgcpExpectTable[i].vc_conn := hdlr;
Daniel Willmannfa870f52018-01-17 12:37:14 +0100401 log("Created Expect[", i, "] for ", crit, " to be handled at ", hdlr);
402 return;
403 }
404 }
Harald Weltebb5a1212018-01-26 10:34:44 +0100405 setverdict(fail, "No space left in MgcpExpectTable")
406}
407
408/* client/conn_hdlr side function to use procedure port to create expect in emulation */
409function f_create_mgcp_expect(ExpectCriteria dest_number) runs on MGCP_ConnHdlr {
410 MGCP_PROC.call(MGCPEM_register:{dest_number, self}) {
411 [] MGCP_PROC.getreply(MGCPEM_register:{?,?}) {};
412 }
Daniel Willmannfa870f52018-01-17 12:37:14 +0100413}
414
Harald Welte9601c812018-01-26 18:58:20 +0100415/* client/conn_hdlr side function to use procedure port to create expect in emulation */
416function f_create_mgcp_delete_ep(MgcpEndpoint ep) runs on MGCP_ConnHdlr {
417 MGCP_PROC.call(MGCPEM_delete_ep:{ep, self}) {
418 [] MGCP_PROC.getreply(MGCPEM_delete_ep:{?,?}) {};
419 }
420}
421
422
Daniel Willmann955627a2018-01-17 15:22:32 +0100423private function f_expect_table_init()
424runs on MGCP_Emulation_CT {
425 var integer i;
Harald Weltebb5a1212018-01-26 10:34:44 +0100426 for (i := 0; i < sizeof(MgcpExpectTable); i := i + 1) {
427 MgcpExpectTable[i].crit := omit;
Daniel Willmann955627a2018-01-17 15:22:32 +0100428 }
429}
430
Harald Weltebb5a1212018-01-26 10:34:44 +0100431function DummyUnitdataCallback(MgcpMessage msg)
432runs on MGCP_Emulation_CT return template MgcpMessage {
433 log("Ignoring MGCP ", msg);
434 return omit;
435}
436
437
Daniel Willmannfa870f52018-01-17 12:37:14 +0100438}