blob: 828f341c902570c23fdc7857499b407a166ab351 [file] [log] [blame]
Harald Welte34b5a952019-05-27 11:54:11 +02001/* Osmocom MNCC type definitions in TTCN-3
2 * (C) 2017-2019 Harald Welte <laforge@gnumonks.org>
3 * contributions by sysmocom -s.f.m.c. GmbH
4 * (C) 2018 Vadim Yanitskiy <axilirator@gmail.com>
5 * All rights reserved.
6 *
7 * Released under the terms of GNU General Public License, Version 2 or
8 * (at your option) any later version.
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
Harald Welte474fd7d2017-12-29 16:01:39 +010013module MNCC_Types {
14
15import from Osmocom_Types all;
16
17/* for architectures where 'int' is 32bit like x86_64 */
18type integer int with { variant "FIELDLENGTH(32)" };
19
20
21/* GSM 04.08 Bearer Capability: Rate Adaption */
22type enumerated GSM48_bcap_ra {
23 GSM48_BCAP_RA_NONE (0),
24 GSM48_BCAP_RA_V110_X30 (1),
25 GSM48_BCAP_RA_X31 (2),
26 GSM48_BCAP_RA_OTHER (3)
27};
28
29/* GSM 04.08 Bearer Capability: Signalling access protocol */
30type enumerated GSM48_bcap_sig_access {
Harald Welteec3d0652018-01-22 02:54:13 +010031 GSM48_BCAP_SA_NONE (0),
Harald Welte474fd7d2017-12-29 16:01:39 +010032 GSM48_BCAP_SA_I440_I450 (1),
33 GSM48_BCAP_SA_X21 (2),
34 GSM48_BCAP_SA_X28_DP_IN (3),
35 GSM48_BCAP_SA_X28_DP_UN (4),
36 GSM48_BCAP_SA_X28_NDP (5),
37 GSM48_BCAP_SA_X32 (6)
38};
39
40/* GSM 04.08 Bearer Capability: User Rate */
41type enumerated GSM48_bcap_user_rate {
Harald Welteec3d0652018-01-22 02:54:13 +010042 GSM48_BCAP_UR_NONE (0),
Harald Welte474fd7d2017-12-29 16:01:39 +010043 GSM48_BCAP_UR_300 (1),
44 GSM48_BCAP_UR_1200 (2),
45 GSM48_BCAP_UR_2400 (3),
46 GSM48_BCAP_UR_4800 (4),
47 GSM48_BCAP_UR_9600 (5),
48 GSM48_BCAP_UR_12000 (6),
49 GSM48_BCAP_UR_1200_75 (7)
50};
51
52/* GSM 04.08 Bearer Capability: Parity */
53type enumerated GSM48_bcap_parity {
54 GSM48_BCAP_PAR_ODD (0),
55 GSM48_BCAP_PAR_EVEN (2),
56 GSM48_BCAP_PAR_NONE (3),
57 GSM48_BCAP_PAR_ZERO (4),
58 GSM48_BCAP_PAR_ONE (5)
59};
60
61/* GSM 04.08 Bearer Capability: Intermediate Rate */
62type enumerated GSM48_bcap_interm_rate {
Harald Welteec3d0652018-01-22 02:54:13 +010063 GSM48_BCAP_IR_NONE (0),
Harald Welte474fd7d2017-12-29 16:01:39 +010064 GSM48_BCAP_IR_8k (2),
65 GSM48_BCAP_IR_16k (3)
66};
67
68/* GSM 04.08 Bearer Capability: Transparency */
69type enumerated GSM48_bcap_transp {
70 GSM48_BCAP_TR_TRANSP (0),
71 GSM48_BCAP_TR_RLP (1),
72 GSM48_BCAP_TR_TR_PREF (2),
73 GSM48_BCAP_TR_RLP_PREF (3)
74};
75
76/* GSM 04.08 Bearer Capability: Modem Type */
77type enumerated GSM48_bcap_modem_type {
78 GSM48_BCAP_MT_NONE (0),
79 GSM48_BCAP_MT_V21 (1),
80 GSM48_BCAP_MT_V22 (2),
81 GSM48_BCAP_MT_V22bis (3),
82 GSM48_BCAP_MT_V23 (4),
83 GSM48_BCAP_MT_V26ter (5),
84 GSM48_BCAP_MT_V32 (6),
85 GSM48_BCAP_MT_UNDEF (7),
86 GSM48_BCAP_MT_AUTO_1 (8)
87};
88
89type enumerated MNCC_MsgType {
90 MNCC_SETUP_REQ ('0101'O),
91 MNCC_SETUP_IND ('0102'O),
92 MNCC_SETUP_RSP ('0103'O),
93 MNCC_SETUP_CNF ('0104'O),
94 MNCC_SETUP_COMPL_REQ ('0105'O),
95 MNCC_SETUP_COMPL_IND ('0106'O),
96 MNCC_CALL_CONF_IND ('0107'O),
97 MNCC_CALL_PROC_REQ ('0108'O),
98 MNCC_PROGRESS_REQ ('0109'O),
99 MNCC_ALERT_REQ ('010a'O),
100 MNCC_ALERT_IND ('010b'O),
101 MNCC_NOTIFY_REQ ('010c'O),
102 MNCC_NOTIFY_IND ('010d'O),
103 MNCC_DISC_REQ ('010e'O),
104 MNCC_DISC_IND ('010f'O),
105 MNCC_REL_REQ ('0110'O),
106 MNCC_REL_IND ('0111'O),
107 MNCC_REL_CNF ('0112'O),
108 MNCC_FACILITY_REQ ('0113'O),
109 MNCC_FACILITY_IND ('0114'O),
110 MNCC_START_DTMF_IND ('0115'O),
111 MNCC_START_DTMF_RSP ('0116'O),
112 MNCC_START_DTMF_REJ ('0117'O),
113 MNCC_STOP_DTMF_IND ('0118'O),
114 MNCC_STOP_DTMF_RSP ('0119'O),
115 MNCC_MODIFY_REQ ('011a'O),
116 MNCC_MODIFY_IND ('011b'O),
117 MNCC_MODIFY_RSP ('011c'O),
118 MNCC_MODIFY_CNF ('011d'O),
119 MNCC_MODIFY_REJ ('011e'O),
120 MNCC_HOLD_IND ('011f'O),
121 MNCC_HOLD_CNF ('0120'O),
122 MNCC_HOLD_REJ ('0121'O),
123 MNCC_RETRIEVE_IND ('0122'O),
124 MNCC_RETRIEVE_CNF ('0123'O),
125 MNCC_RETRIEVE_REJ ('0124'O),
126 MNCC_USERINFO_REQ ('0125'O),
127 MNCC_USERINFO_IND ('0126'O),
128 MNCC_REJ_REQ ('0127'O),
129 MNCC_REJ_IND ('0128'O),
Vadim Yanitskiye0bb4f02018-11-01 03:40:38 +0700130 MNCC_PROGRESS_IND ('0129'O),
131 MNCC_CALL_PROC_IND ('012a'O),
132 MNCC_CALL_CONF_REQ ('012b'O),
133 MNCC_START_DTMF_REQ ('012c'O),
134 MNCC_STOP_DTMF_REQ ('012d'O),
135 MNCC_HOLD_REQ ('012e'O),
136 MNCC_RETRIEVE_REQ ('012f'O),
Harald Welte474fd7d2017-12-29 16:01:39 +0100137
138 MNCC_BRIDGE ('0200'O),
139 MNCC_FRAME_RECV ('0201'O),
140 MNCC_FRAME_DROP ('0202'O),
141 MNCC_LCHAN_MODIFY ('0203'O),
142 MNCC_RTP_CREATE ('0204'O),
143 MNCC_RTP_CONNECT ('0205'O),
144 MNCC_RTP_FREE ('0206'O),
145
146 GSM_TCHF_FRAME ('0300'O),
147 GSM_TCHF_FRAME_EFR ('0301'O),
148 GSM_TCHH_FRAME ('0302'O),
149 GSM_TCH_FRAME_AMR ('0303'O),
150 GSM_BAD_FRAME ('03ff'O),
151
152 MNCC_SOCKET_HELLO ('0400'O)
153};
154
155const integer GSM_MAX_FACILITY := 128;
156const integer GSM_MAX_SSVERSION := 128;
157const integer GSM_MAX_USERUSER := 128;
158
159type record MNCC_bearer_cap_data {
160 GSM48_bcap_ra rate_adaptation,
161 GSM48_bcap_sig_access sig_access,
162 int async,
163 int nr_stop_bits,
164 int nr_data_bits,
165 GSM48_bcap_user_rate user_rate,
166 GSM48_bcap_parity parity,
167 GSM48_bcap_interm_rate interm_rate,
168 GSM48_bcap_transp transp,
169 GSM48_bcap_modem_type modem_type
170};
171
172type record length(0..8) of int MNCC_speech_vers;
173
174/* Expanded fields from GSM TS 04.08, Table 10.5.102 */
175type record MNCC_bearer_cap {
176 int transfer,
177 int mode,
178 int coding,
179 int radio,
180 int speech_ctm,
181 MNCC_speech_vers speech_ver,
182 MNCC_bearer_cap_data data optional
183};
184
185template MNCC_bearer_cap ts_MNCC_bcap_voice := {
186 transfer := 0, /* speech */
187 mode := 0, /* circuit */
188 coding := 0, /* GSM standard */
189 radio := 3, /* FR/HR, FR preferred */
190 speech_ctm := 0, /* not supported */
Harald Welte515f5d12018-01-22 02:55:10 +0100191 speech_ver := { 0, 2, 4, 1, 5, -1 },
Harald Welte474fd7d2017-12-29 16:01:39 +0100192 data := omit
193};
194
195type record MNCC_number {
196 GSM48_type_of_number number_type,
197 GSM48_num_plan_ind plan,
198 GSM48_present_ind presence,
199 GSM48_screening_ind screen,
200 charstring number
201};
202
203/* 24.008 10.5.118 */
204type enumerated GSM48_num_plan_ind {
205 GSM48_NUMPLAN_UNKNOWN (0),
206 GSM48_NUMPLAN_E164 (1),
207 GSM48_NUMPLAN_X121 (3),
208 GSM48_NUMPLAN_F69 (4),
209 GSM48_NUMPLAN_NATIONAL (8),
210 GSM48_NUMPLAN_PRIVATE (9),
211 GSM48_NUMPLAN_CTS (11),
212 GSM48_NUMPLAN_RESERVED (15)
213};
214
215/* 04.08 10.5.118 */
216type enumerated GSM48_type_of_number {
217 GSM48_TON_UNKNOWN (0),
218 GSM48_TON_INTERNATIONAL (1),
219 GSM48_TON_NATIONAL (2),
220 GSM48_TON_NETWORK_SPECIFIC (3),
221 GSM48_TON_SHORT_CODE (4)
222};
223
224/* 04.08 10.5.120 */
225type enumerated GSM48_present_ind {
226 GSM48_PRES_IND_ALLOWED (0),
227 GSM48_PRES_IND_RESTRICTED (1),
228 GSM48_PRES_IND_NUM_NOT_AVAIL (2),
229 GSM48_PRES_IND_RESERVED (3)
230};
231
232type enumerated GSM48_screening_ind {
233 GSM48_SCR_IND_NOT_SCREENED (0),
234 GSM48_SCR_IND_VERIF_PASSED (1),
235 GSM48_SCR_IND_VERIF_FAILED (2),
236 GSM48_SCR_IND_NETW_PROVIDED (3)
237};
238
Harald Weltefe75a202018-01-17 13:59:20 +0100239/* 24.008 Table 10.5.122 */
240type enumerated GSM48_cause_coding {
241 GSM48_CAUSE_CS_Q931 ('00'B),
242 GSM48_CAUSE_CS_RSVD ('01'B),
243 GSM48_CAUSE_CS_NATIONAL ('10'B),
244 GSM48_CAUSE_CS_GSM ('11'B)
245}
246
247type enumerated GSM48_cause_loc {
248 GSM48_CAUSE_LOC_USER ('0000'B),
249 GSM48_CAUSE_LOC_PRN_S_LU ('0001'B),
250 GSM48_CAUSE_LOC_PUN_S_LU ('0010'B),
251 GSM48_CAUSE_LOC_TRANS_NET ('0011'B),
252 GSM48_CAUSE_LOC_PUN_S_RU ('0100'B),
253 GSM48_CAUSE_LOC_PRN_S_RU ('0101'B),
254 GSM48_CAUSE_LOC_INN_NET ('0111'B),
255 GSM48_CAUSE_LOC_NET_BEYOND ('1010'B)
256}
257
258
Harald Welte474fd7d2017-12-29 16:01:39 +0100259
Harald Welted748a052018-01-22 02:59:24 +0100260template (value) MNCC_number ts_MNCC_number(charstring number,
Harald Welte474fd7d2017-12-29 16:01:39 +0100261 GSM48_type_of_number ton := GSM48_TON_INTERNATIONAL,
262 GSM48_num_plan_ind npi := GSM48_NUMPLAN_E164,
263 GSM48_present_ind pres := GSM48_PRES_IND_ALLOWED,
264 GSM48_screening_ind screen := GSM48_SCR_IND_NOT_SCREENED) := {
265 number_type := ton,
266 plan := npi,
267 presence := pres,
268 screen := screen,
269 number := number
270}
271
Harald Welted748a052018-01-22 02:59:24 +0100272template MNCC_number tr_MNCC_number(template charstring number,
273 template GSM48_type_of_number ton := ?,
274 template GSM48_num_plan_ind npi := ?,
275 template GSM48_present_ind pres := ?,
276 template GSM48_screening_ind screen := ?) := {
277 number_type := ton,
278 plan := npi,
279 presence := pres,
280 screen := screen,
281 number := number
282}
283
Harald Welte474fd7d2017-12-29 16:01:39 +0100284type record MNCC_cause {
Harald Weltefe75a202018-01-17 13:59:20 +0100285 GSM48_cause_loc location,
286 GSM48_cause_coding coding,
Harald Welte474fd7d2017-12-29 16:01:39 +0100287 int rec,
288 int rec_val,
289 int val,
290 octetstring diag
Harald Weltefe75a202018-01-17 13:59:20 +0100291} with {
292 variant (location) "FIELDLENGTH(32)";
293 variant (coding) "FIELDLENGTH(32)";
294}
Harald Welte474fd7d2017-12-29 16:01:39 +0100295
Harald Welte90938392018-03-25 16:36:40 +0200296template (value) MNCC_cause ts_MNCC_cause(int val,
Harald Welte2bb825f2018-01-22 11:31:18 +0100297 GSM48_cause_loc loc := GSM48_CAUSE_LOC_PUN_S_LU,
298 GSM48_cause_coding coding := GSM48_CAUSE_CS_GSM,
299 octetstring diag := ''O) := {
300 location := loc,
301 coding := coding,
302 rec := 0,
303 rec_val := 0,
304 val := val,
305 diag := diag
306}
307
Harald Welte474fd7d2017-12-29 16:01:39 +0100308type record MNCC_useruser {
309 int proto,
310 charstring info
311};
312
313type record MNCC_progress {
314 int coding,
315 int location,
316 int descr
317};
318
319type record MNCC_cccap {
320 int dtmf,
321 int pcp
322};
323
Harald Welte8b2a2582018-01-16 08:11:42 +0100324type int MNCC_notify (0..127);
Harald Welted13700d2018-02-02 20:06:52 +0100325type charstring MNCC_keypad length (1);
Harald Welte8b2a2582018-01-16 08:11:42 +0100326
Harald Welte474fd7d2017-12-29 16:01:39 +0100327type enumerated MNCC_bcap {
328 GSM_MNCC_BCAP_SPEECH (0),
329 GSM_MNCC_BCAP_UNR_DIG (1),
330 GSM_MNCC_BCAP_AUDIO (2),
331 GSM_MNCC_BCAP_FAX_G3 (3),
332 GSM_MNCC_BCAP_OTHER_ITC (4),
333 GSM_MNCC_BCAP_RESERVED (7)
334};
335
336
337type record MNCC_PDU_Signal {
338 uint32_t callref,
339
340 MNCC_bearer_cap bearer_cap optional,
341 MNCC_number called optional,
342 MNCC_number calling optional,
343 MNCC_number redirecting optional,
344 MNCC_number connected optional,
345 MNCC_cause cause optional,
346 MNCC_progress progress optional,
347 MNCC_useruser useruser optional,
348 charstring facility optional,
349 MNCC_cccap cccap optional,
350 charstring ssversion optional,
351
352 int clir_sup,
353 int clir_inv,
354 int signal optional,
355
Harald Welte8b2a2582018-01-16 08:11:42 +0100356 MNCC_keypad keypad optional,
Harald Welte474fd7d2017-12-29 16:01:39 +0100357 int more,
Harald Welte8b2a2582018-01-16 08:11:42 +0100358 MNCC_notify notify,
Harald Welte474fd7d2017-12-29 16:01:39 +0100359 int emergency optional,
360 charstring imsi,
361
362 uint8_t lchan_type, /* empty in OSmoMSC */
363 uint8_t lchan_mode /* empty in OsmoMSC */
364};
365
366
367type record MNCC_PDU_Data {
368 uint32_t callref,
369 octetstring data
370};
371
372type record MNCC_PDU_Rtp {
373 uint32_t callref,
374 uint32_t ip,
375 uint16_t rtp_port,
376 uint32_t payload_type,
377 uint32_t payload_msg_type
378};
379
380type record MNCC_PDU_Hello {
381 uint32_t version,
382 uint32_t mncc_size,
383 uint32_t data_frame_size,
384 uint32_t called_offset,
385 uint32_t signal_offset,
386 uint32_t emergency_offset,
387 uint32_t lchan_type_offset
388};
389
390
391type union MNCC_MsgUnion {
392 MNCC_PDU_Signal signal,
393 MNCC_PDU_Data data,
394 MNCC_PDU_Rtp rtp,
395 MNCC_PDU_Hello hello
396};
397
398
399type record MNCC_PDU {
400 MNCC_MsgType msg_type,
401 MNCC_MsgUnion u
402} with { variant (u) "CROSSTAG(
403 hello, msg_type = MNCC_SOCKET_HELLO;
404 rtp, { msg_type = MNCC_RTP_CREATE,
405 msg_type = MNCC_RTP_CONNECT,
406 msg_type = MNCC_RTP_FREE };
407 data, { msg_type = GSM_TCHF_FRAME,
408 msg_type = GSM_TCHF_FRAME_EFR,
409 msg_type = GSM_TCHH_FRAME,
410 msg_type = GSM_TCH_FRAME_AMR,
411 msg_type = GSM_BAD_FRAME };
412 signal, OTHERWISE
413 )"
414};
415
416external function enc_MNCC_PDU(in MNCC_PDU pdu) return octetstring;
417
418external function dec_MNCC_PDU(in octetstring stream) return MNCC_PDU;
419
Harald Welte14509532018-03-24 22:32:01 +0100420template (value) MNCC_PDU ts_MNCC_HELLO(uint32_t version := 5) := {
421 msg_type := MNCC_SOCKET_HELLO,
422 u := {
423 hello := {
424 version := version,
425 mncc_size := 836,
426 data_frame_size := 8,
427 called_offset := 104,
428 signal_offset := 796,
429 emergency_offset := 812,
430 lchan_type_offset := 0
431 }
432 }
433}
Harald Welte474fd7d2017-12-29 16:01:39 +0100434
435template MNCC_PDU ts_MNCC_Sign(MNCC_MsgType msg_type, MNCC_PDU_Signal sign) := {
436 msg_type := msg_type,
437 u := {
438 signal := sign
439 }
440}
441
Harald Welte8b2a2582018-01-16 08:11:42 +0100442template MNCC_PDU ts_MNCC_SIMPLE(MNCC_MsgType msg_type, uint32_t call_id) := {
443 msg_type := msg_type,
Harald Welte474fd7d2017-12-29 16:01:39 +0100444 u := {
445 signal := {
446 callref := call_id,
Harald Welte8b2a2582018-01-16 08:11:42 +0100447 bearer_cap := omit,
448 called := omit,
449 calling := omit,
Harald Welte474fd7d2017-12-29 16:01:39 +0100450 redirecting := omit,
451 connected := omit,
452 cause := omit,
453 progress := omit,
454 useruser := omit,
455 facility := omit,
456 cccap := omit,
457 ssversion := omit,
458 clir_sup := 0,
459 clir_inv := 0,
460 signal := omit,
461 keypad := omit,
462 more := 0,
463 notify := 0,
464 emergency := omit,
Harald Welte8b2a2582018-01-16 08:11:42 +0100465 imsi := "",
466 lchan_type := 0,
467 lchan_mode := 0
468 }
469 }
470}
471
472template MNCC_PDU tr_MNCC_SIMPLE(template MNCC_MsgType msg_type, template uint32_t call_id) := {
473 msg_type := msg_type,
474 u := {
475 signal := {
476 callref := call_id,
477 bearer_cap := omit,
478 called := omit,
479 calling := omit,
480 redirecting := omit,
481 connected := omit,
482 cause := omit,
483 progress := omit,
484 useruser := omit,
485 facility := omit,
486 cccap := omit,
487 ssversion := omit,
488 clir_sup := 0,
489 clir_inv := 0,
490 signal := omit,
491 keypad := omit,
492 more := 0,
493 notify := 0,
494 emergency := *,
495 imsi := ?,
496 lchan_type := ?,
497 lchan_mode := ?
498 }
499 }
500}
501
502
503
504/* MT: MSC <- MNCC: SETUP.req from ext. MNCC handler to MSC */
505template MNCC_PDU ts_MNCC_SETUP_req(uint32_t call_id, charstring called, charstring calling, charstring imsi := "") := {
506 msg_type := MNCC_SETUP_REQ,
507 u := {
508 signal := { /* See 24.008 9.3.23.1 */
509 callref := call_id,
510 bearer_cap := ts_MNCC_bcap_voice, /* mandatory */
511 called := valueof(ts_MNCC_number(called)), /* optional */
512 calling := valueof(ts_MNCC_number(calling)), /* optional */
513 redirecting := omit, /* optional */
514 connected := omit,
515 cause := omit,
516 progress := omit, /* optional */
517 useruser := omit, /* optional */
518 facility := omit, /* optional */
519 cccap := omit,
520 ssversion := omit,
521 clir_sup := 0,
522 clir_inv := 0,
523 signal := omit, /* optional */
524 keypad := omit,
525 more := 0,
526 notify := 0,
527 emergency := omit,
528 imsi := imsi,
Harald Welte474fd7d2017-12-29 16:01:39 +0100529 lchan_type := 0,
530 lchan_mode := 0
531 }
532 }
533};
Harald Welteb0d93602018-03-20 18:09:34 +0100534template MNCC_PDU tr_MNCC_SETUP_req(template uint32_t call_id := ?,
535 template charstring called := ?,
536 template charstring calling := *,
537 template charstring imsi := ?) := {
538 msg_type := MNCC_SETUP_REQ,
539 u := {
540 signal := { /* See 24.008 9.3.23.1 */
541 callref := call_id,
542 bearer_cap := *, /* mandatory in CC */
543 called := tr_MNCC_number(called), /* optional */
544 calling := tr_MNCC_number(calling), /* optional */
545 redirecting := *, /* optional */
546 connected := omit,
547 cause := omit,
548 progress := *, /* optional */
549 useruser := *, /* optional */
550 facility := *, /* optional */
551 cccap := omit,
552 ssversion := omit,
553 clir_sup := 0,
554 clir_inv := 0,
555 signal := *, /* optional */
556 keypad := omit,
557 more := 0,
558 notify := 0,
559 emergency := *,
560 imsi := imsi,
561 lchan_type := ?,
562 lchan_mode := ?
563 }
564 }
565};
566
Harald Welte474fd7d2017-12-29 16:01:39 +0100567
Harald Welte4017d552018-01-26 21:40:05 +0100568/* MO: MSC <- MNCC: Respons to SETUP.ind */
569template MNCC_PDU ts_MNCC_SETUP_rsp(uint32_t call_id, charstring imsi := "",
570 template MNCC_number connected := omit) := {
Harald Welte8b2a2582018-01-16 08:11:42 +0100571 msg_type := MNCC_SETUP_RSP,
572 u := {
573 signal := { /* See 24.008 9.3.5 */
574 callref := call_id,
575 bearer_cap := omit,
576 called := omit,
577 calling := omit,
578 redirecting := omit,
579 connected := connected,
580 cause := omit,
581 progress := omit,
Harald Welte4017d552018-01-26 21:40:05 +0100582 useruser := omit, /* optional */
583 facility := omit, /* optional */
Harald Welte8b2a2582018-01-16 08:11:42 +0100584 cccap := omit,
Harald Welte4017d552018-01-26 21:40:05 +0100585 ssversion := omit, /* optional */
Harald Welte8b2a2582018-01-16 08:11:42 +0100586 clir_sup := 0,
587 clir_inv := 0,
588 signal := omit,
589 keypad := omit,
590 more := 0,
591 notify := 0,
Harald Welte4017d552018-01-26 21:40:05 +0100592 emergency := omit,
Harald Welte8b2a2582018-01-16 08:11:42 +0100593 imsi := imsi,
Harald Welte4017d552018-01-26 21:40:05 +0100594 lchan_type := 0,
595 lchan_mode := 0
Harald Welte8b2a2582018-01-16 08:11:42 +0100596 }
597 }
598};
Harald Welte90938392018-03-25 16:36:40 +0200599template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id,
600 template charstring imsi := ?,
601 template MNCC_number connected := *) := {
602 msg_type := MNCC_SETUP_RSP,
603 u := {
604 signal := { /* See 24.008 9.3.5 */
605 callref := call_id,
606 bearer_cap := omit,
607 called := omit,
608 calling := omit,
609 redirecting := omit,
610 connected := connected,
611 cause := omit,
612 progress := omit,
613 useruser := *, /* optional */
614 facility := *, /* optional */
615 cccap := omit,
616 ssversion := *, /* optional */
617 clir_sup := 0,
618 clir_inv := 0,
619 signal := omit,
620 keypad := omit,
621 more := 0,
622 notify := 0,
623 emergency := omit,
624 imsi := imsi,
625 lchan_type := ?,
626 lchan_mode := ?
627 }
628 }
629};
630
Harald Welte8b2a2582018-01-16 08:11:42 +0100631
632/* MO: MSC -> MNCC: SETUP.ind from MSC to ext. MNCC handler */
633template MNCC_PDU tr_MNCC_SETUP_ind(template uint32_t call_id := ?, template MNCC_number called := ?,
634 template MNCC_number calling := *, template charstring imsi :=?) := {
635 msg_type := MNCC_SETUP_IND,
636 u := {
637 signal := { /* See 24.008 9.3.23.2 */
638 callref := call_id,
639 bearer_cap := ?, /* mandatory */
640 called := called, /* mandatory */
641 calling := calling, /* optional */
642 redirecting := omit,
643 connected := omit,
644 cause := omit,
645 progress := omit,
646 useruser := *, /* optional */
647 facility := *, /* optional */
648 cccap := *, /* optional */
649 ssversion := *, /* optional */
650 clir_sup := ?, /* optional */
651 clir_inv := ?, /* optional */
652 signal := omit,
653 keypad := omit,
654 more := 0,
655 notify := 0,
656 emergency := *,
657 imsi := imsi,
658 lchan_type := ?,
659 lchan_mode := ?
660 }
661 }
Harald Welteafec4712018-03-19 22:52:17 +0100662}
663template (value) MNCC_PDU ts_MNCC_SETUP_ind(uint32_t call_id, MNCC_number called,
664 template (omit) MNCC_number calling := omit,
665 template (omit) charstring imsi := omit,
666 template (value) MNCC_bearer_cap bcap := ts_MNCC_bcap_voice) := {
667 msg_type := MNCC_SETUP_IND,
668 u := {
669 signal := { /* See 24.008 9.3.23.2 */
670 callref := call_id,
671 bearer_cap := valueof(bcap), /* mandatory */
672 called := called, /* mandatory */
673 calling := calling, /* optional */
674 redirecting := omit,
675 connected := omit,
676 cause := omit,
677 progress := omit,
678 useruser := omit, /* optional */
679 facility := omit, /* optional */
680 cccap := omit, /* optional */
681 ssversion := omit, /* optional */
682 clir_sup := 0, /* optional */
683 clir_inv := 0, /* optional */
684 signal := omit,
685 keypad := omit,
686 more := 0,
687 notify := 0,
688 emergency := omit,
689 imsi := imsi,
690 lchan_type := 0,
691 lchan_mode := 0
692 }
693 }
Harald Welte8b2a2582018-01-16 08:11:42 +0100694}
695
696/* MO: MSC <- MNCC: SETUP.cnf; Response to SETUP.ind */
697template MNCC_PDU ts_MNCC_SETUP_CNF(uint32_t call_id, template MNCC_number connected := omit) := {
698 msg_type := MNCC_SETUP_CNF,
699 u := {
700 signal := { /* See 24.008 9.3.5 */
701 callref := call_id,
702 bearer_cap := omit,
703 called := omit,
704 calling := omit,
705 redirecting := omit,
706 connected := connected,
707 cause := omit,
Harald Welteb0d93602018-03-20 18:09:34 +0100708 progress := omit,
709 useruser := omit,
710 facility := omit,
Harald Welte8b2a2582018-01-16 08:11:42 +0100711 cccap := omit,
712 ssversion := omit,
713 clir_sup := 0,
714 clir_inv := 0,
715 signal := omit,
716 keypad := omit,
717 more := 0,
718 notify := 0,
Harald Welteb0d93602018-03-20 18:09:34 +0100719 emergency := omit,
Harald Welte8b2a2582018-01-16 08:11:42 +0100720 imsi := "",
Harald Welteb0d93602018-03-20 18:09:34 +0100721 lchan_type := 0,
722 lchan_mode := 0
Harald Welte8b2a2582018-01-16 08:11:42 +0100723 }
724 }
725}
726
Harald Welte33ec09b2018-02-10 15:34:46 +0100727/* MT: MSC -> MNCC: SETUP.cnf; Response to SETUP.req */
728template MNCC_PDU tr_MNCC_SETUP_cnf(uint32_t call_id, template MNCC_number connected := *) := {
729 msg_type := MNCC_SETUP_CNF,
730 u := {
731 signal := { /* See 24.008 9.3.5 */
732 callref := call_id,
733 bearer_cap := omit,
734 called := omit,
735 calling := omit,
736 redirecting := omit,
737 connected := connected,
738 cause := omit,
739 progress := *,
740 useruser := *,
741 facility := *,
742 cccap := omit,
743 ssversion := omit,
744 clir_sup := 0,
745 clir_inv := 0,
746 signal := omit,
747 keypad := omit,
748 more := 0,
749 notify := 0,
750 emergency := *,
751 imsi := ?,
752 lchan_type := ?,
753 lchan_mode := ?
754 }
755 }
756}
757
Harald Welte4017d552018-01-26 21:40:05 +0100758/* MT: MSC -> MNCC: SETUP_COMPL.req; request to send CONNECT ACK */
759template MNCC_PDU tr_MNCC_SETUP_COMPL_req(template uint32_t call_id) :=
760 tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */
Harald Welte8b2a2582018-01-16 08:11:42 +0100761
762/* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */
763template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) :=
764 tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 9.3.6 */
Harald Welte90938392018-03-25 16:36:40 +0200765template (value) MNCC_PDU ts_MNCC_SETUP_COMPL_ind(uint32_t call_id) :=
766 ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 9.3.6 */
Harald Welte8b2a2582018-01-16 08:11:42 +0100767
768/* MT: MSC -> MNCC: REJ.req; reject MT call */
769template MNCC_PDU tr_MNCC_REJ_req(template uint32_t call_id, template MNCC_cause cause := *) := {
770 msg_type := MNCC_REJ_REQ,
771 u := {
772 signal := { /* See 24.008 9.3.19 */
773 callref := call_id,
774 bearer_cap := omit,
775 called := omit,
776 calling := omit,
777 redirecting := omit,
778 connected := omit,
779 cause := cause,
780 progress := omit,
781 useruser := *,
782 facility := *,
783 cccap := omit,
784 ssversion := omit,
785 clir_sup := 0,
786 clir_inv := 0,
787 signal := omit,
788 keypad := omit,
789 more := 0,
790 notify := 0,
791 emergency := omit,
792 imsi := ?,
793 lchan_type := ?,
794 lchan_mode := ?
795 }
796 }
797}
798
799/* MO: MSC <- MNCC: REJ.ind; reject MO call */
800template MNCC_PDU ts_MNCC_REJ_ind(uint32_t call_id, template MNCC_cause cause := omit) := {
801 msg_type := MNCC_REJ_IND,
802 u := {
803 signal := { /* See 24.008 9.3.19 */
804 callref := call_id,
805 bearer_cap := omit,
806 called := omit,
807 calling := omit,
808 redirecting := omit,
809 connected := omit,
810 cause := cause,
811 progress := omit,
812 useruser := omit,
813 facility := omit,
814 cccap := omit,
815 ssversion := omit,
816 clir_sup := 0,
817 clir_inv := 0,
818 signal := omit,
819 keypad := omit,
820 more := 0,
821 notify := 0,
822 emergency := omit,
823 imsi := "",
824 lchan_type := 0,
825 lchan_mode := 0
826 }
827 }
828}
829
Harald Welte812f7a42018-01-27 00:49:18 +0100830/* MT: MSC -> MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */
831template MNCC_PDU tr_MNCC_CALL_CONF_ind(template uint32_t call_id, template MNCC_bearer_cap bcap := *,
832 template MNCC_cause cause := *,
833 template MNCC_cccap cccap := *) := {
Harald Welte8b2a2582018-01-16 08:11:42 +0100834 msg_type := MNCC_CALL_CONF_IND,
835 u := {
836 signal := { /* See 24.008 9.3.2 */
837 callref := call_id,
838 bearer_cap := bcap,
839 called := omit,
840 calling := omit,
841 redirecting := omit,
842 connected := omit,
843 cause := cause,
844 progress := omit,
845 useruser := omit,
846 facility := omit,
847 cccap := cccap,
848 ssversion := omit,
849 clir_sup := 0,
850 clir_inv := 0,
851 signal := omit,
852 keypad := omit,
853 more := 0,
854 notify := 0,
855 emergency := omit,
Harald Welte812f7a42018-01-27 00:49:18 +0100856 imsi := ?,
857 lchan_type := ?,
858 lchan_mode := ?
Harald Welte8b2a2582018-01-16 08:11:42 +0100859 }
860 }
861}
Harald Welteb0d93602018-03-20 18:09:34 +0100862template MNCC_PDU ts_MNCC_CALL_CONF_ind(uint32_t call_id,
863 template (omit) MNCC_bearer_cap bcap := omit,
864 template (omit) MNCC_cause cause := omit,
865 template (omit) MNCC_cccap cccap := omit) := {
866 msg_type := MNCC_CALL_CONF_IND,
867 u := {
868 signal := { /* See 24.008 9.3.2 */
869 callref := call_id,
870 bearer_cap := bcap,
871 called := omit,
872 calling := omit,
873 redirecting := omit,
874 connected := omit,
875 cause := cause,
876 progress := omit,
877 useruser := omit,
878 facility := omit,
879 cccap := cccap,
880 ssversion := omit,
881 clir_sup := 0,
882 clir_inv := 0,
883 signal := omit,
884 keypad := omit,
885 more := 0,
886 notify := 0,
887 emergency := omit,
888 imsi := "",
889 lchan_type := 0,
890 lchan_mode := 0
891 }
892 }
893}
894
Harald Welte8b2a2582018-01-16 08:11:42 +0100895
896/* MO: MSC <- MNCC: CALL_PROC.req; call establishment initiated in network */
897template MNCC_PDU ts_MNCC_CALL_PROC_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit,
898 template MNCC_progress prog := omit,
899 template charstring fac := omit,
900 template MNCC_cccap cccap := omit) := {
901 msg_type := MNCC_CALL_PROC_REQ,
902 u := {
903 signal := { /* See 24.008 9.3.2 */
904 callref := call_id,
905 bearer_cap := bcap,
906 called := omit,
907 calling := omit,
908 redirecting := omit,
909 connected := omit,
910 cause := omit,
911 progress := prog,
912 useruser := omit,
913 facility := fac,
914 cccap := cccap,
915 ssversion := omit,
916 clir_sup := 0,
917 clir_inv := 0,
918 signal := omit,
919 keypad := omit,
920 more := 0,
921 notify := 0,
922 emergency := omit,
923 imsi := "",
924 lchan_type := 0,
925 lchan_mode := 0
926 }
927 }
928}
Harald Welte90938392018-03-25 16:36:40 +0200929template MNCC_PDU tr_MNCC_CALL_PROC_req(template uint32_t call_id,
930 template MNCC_bearer_cap bcap := *,
931 template MNCC_progress prog := *,
932 template charstring fac := *,
933 template MNCC_cccap cccap := *) := {
934 msg_type := MNCC_CALL_PROC_REQ,
935 u := {
936 signal := { /* See 24.008 9.3.2 */
937 callref := call_id,
938 bearer_cap := bcap,
939 called := omit,
940 calling := omit,
941 redirecting := omit,
942 connected := omit,
943 cause := omit,
944 progress := prog,
945 useruser := omit,
946 facility := fac,
947 cccap := cccap,
948 ssversion := omit,
949 clir_sup := 0,
950 clir_inv := 0,
951 signal := omit,
952 keypad := omit,
953 more := 0,
954 notify := 0,
955 emergency := omit,
956 imsi := ?,
957 lchan_type := ?,
958 lchan_mode := ?
959 }
960 }
961}
962
Harald Welte8b2a2582018-01-16 08:11:42 +0100963
964/* MSC <- MNCC: PROGRESS.req; PROGRESS message from ISDN */
965template MNCC_PDU ts_MNCC_PROGRESS_req(uint32_t call_id, MNCC_progress prog,
966 template MNCC_useruser uu := omit) := {
967 msg_type := MNCC_PROGRESS_REQ,
968 u := {
969 signal := { /* See 24.008 9.3.17 */
970 callref := call_id,
971 bearer_cap := omit,
972 called := omit,
973 calling := omit,
974 redirecting := omit,
975 connected := omit,
976 cause := omit,
977 progress := prog,
978 useruser := uu,
979 facility := omit,
980 cccap := omit,
981 ssversion := omit,
982 clir_sup := 0,
983 clir_inv := 0,
984 signal := omit,
985 keypad := omit,
986 more := 0,
987 notify := 0,
988 emergency := omit,
989 imsi := "",
990 lchan_type := 0,
991 lchan_mode := 0
992 }
993 }
994}
995
996/* MO: MSC <- MNCC: ALERT.req; indicate that user alerting has been initiated */
997template MNCC_PDU ts_MNCC_ALERT_req(uint32_t call_id, template MNCC_progress prog := omit,
998 template charstring fac := omit,
999 template MNCC_useruser uu := omit) := {
1000 msg_type := MNCC_ALERT_REQ,
1001 u := {
1002 signal := { /* See 24.008 9.3.1 */
1003 callref := call_id,
1004 bearer_cap := omit,
1005 called := omit,
1006 calling := omit,
1007 redirecting := omit,
1008 connected := omit,
1009 cause := omit,
1010 progress := prog,
1011 useruser := uu,
1012 facility := fac,
1013 cccap := omit,
1014 ssversion := omit,
1015 clir_sup := 0,
1016 clir_inv := 0,
1017 signal := omit,
1018 keypad := omit,
1019 more := 0,
1020 notify := 0,
1021 emergency := omit,
1022 imsi := "",
1023 lchan_type := 0,
1024 lchan_mode := 0
1025 }
1026 }
1027}
Harald Welte90938392018-03-25 16:36:40 +02001028template MNCC_PDU tr_MNCC_ALERT_req(template uint32_t call_id,
1029 template MNCC_progress prog := *,
1030 template charstring fac := *,
1031 template MNCC_useruser uu := *) := {
1032 msg_type := MNCC_ALERT_REQ,
1033 u := {
1034 signal := { /* See 24.008 9.3.1 */
1035 callref := call_id,
1036 bearer_cap := omit,
1037 called := omit,
1038 calling := omit,
1039 redirecting := omit,
1040 connected := omit,
1041 cause := omit,
1042 progress := prog,
1043 useruser := uu,
1044 facility := fac,
1045 cccap := omit,
1046 ssversion := omit,
1047 clir_sup := 0,
1048 clir_inv := 0,
1049 signal := omit,
1050 keypad := omit,
1051 more := 0,
1052 notify := 0,
1053 emergency := omit,
1054 imsi := ?,
1055 lchan_type := ?,
1056 lchan_mode := ?
1057 }
1058 }
1059}
1060
Harald Welte8b2a2582018-01-16 08:11:42 +01001061
1062
1063/* MT: MSC -> MNCC: ALERRT.ind; indicates that mobile user alerting has been initiated */
1064template MNCC_PDU tr_MNCC_ALERT_ind(template uint32_t call_id, template MNCC_progress prog := omit,
1065 template charstring fac := omit,
1066 template MNCC_useruser uu := omit) := {
Harald Welte33ec09b2018-02-10 15:34:46 +01001067 msg_type := MNCC_ALERT_IND,
Harald Welte8b2a2582018-01-16 08:11:42 +01001068 u := {
1069 signal := { /* See 24.008 9.3.1 */
1070 callref := call_id,
1071 bearer_cap := omit,
1072 called := omit,
1073 calling := omit,
1074 redirecting := omit,
1075 connected := omit,
1076 cause := omit,
1077 progress := prog,
1078 useruser := uu,
1079 facility := fac,
1080 cccap := omit,
1081 ssversion := omit,
1082 clir_sup := 0,
1083 clir_inv := 0,
1084 signal := omit,
1085 keypad := omit,
1086 more := 0,
1087 notify := 0,
1088 emergency := *,
1089 imsi := ?,
1090 lchan_type := ?,
1091 lchan_mode := ?
1092 }
1093 }
1094}
Harald Welteb0d93602018-03-20 18:09:34 +01001095template (value) MNCC_PDU ts_MNCC_ALERT_ind(uint32_t call_id,
1096 template (omit) MNCC_progress prog := omit,
1097 template (omit) charstring fac := omit,
1098 template (omit) MNCC_useruser uu := omit) := {
1099 msg_type := MNCC_ALERT_IND,
1100 u := {
1101 signal := { /* See 24.008 9.3.1 */
1102 callref := call_id,
1103 bearer_cap := omit,
1104 called := omit,
1105 calling := omit,
1106 redirecting := omit,
1107 connected := omit,
1108 cause := omit,
1109 progress := prog,
1110 useruser := uu,
1111 facility := fac,
1112 cccap := omit,
1113 ssversion := omit,
1114 clir_sup := 0,
1115 clir_inv := 0,
1116 signal := omit,
1117 keypad := omit,
1118 more := 0,
1119 notify := 0,
1120 emergency := omit,
1121 imsi := "",
1122 lchan_type := 0,
1123 lchan_mode := 0
1124 }
1125 }
1126}
1127
Harald Welte8b2a2582018-01-16 08:11:42 +01001128
1129/* : MSC <- MNCC: NOTIFY.req; request to send information pertaining to a call (such as user suspended) */
1130template MNCC_PDU ts_MNCC_NOTIFY_req(uint32_t call_id, MNCC_notify notify) := {
1131 msg_type := MNCC_NOTIFY_REQ,
1132 u := {
1133 signal := { /* See 24.008 9.3.16 */
1134 callref := call_id,
1135 bearer_cap := omit,
1136 called := omit,
1137 calling := omit,
1138 redirecting := omit,
1139 connected := omit,
1140 cause := omit,
1141 progress := omit,
1142 useruser := omit,
1143 facility := omit,
1144 cccap := omit,
1145 ssversion := omit,
1146 clir_sup := 0,
1147 clir_inv := 0,
1148 signal := omit,
1149 keypad := omit,
1150 more := 0,
1151 notify := notify,
1152 emergency := omit,
1153 imsi := "",
1154 lchan_type := 0,
1155 lchan_mode := 0
1156 }
1157 }
1158}
1159
1160/* : MSC -> MNCC: NOTIFY.ind; indication to the mobile user */
1161template MNCC_PDU tr_MNCC_NOTIFY_ind(template uint32_t call_id, template MNCC_notify notify) := {
1162 msg_type := MNCC_NOTIFY_IND,
1163 u := {
1164 signal := { /* See 24.008 9.3.16 */
1165 callref := call_id,
1166 bearer_cap := omit,
1167 called := omit,
1168 calling := omit,
1169 redirecting := omit,
1170 connected := omit,
1171 cause := omit,
1172 progress := omit,
1173 useruser := omit,
1174 facility := omit,
1175 cccap := omit,
1176 ssversion := omit,
1177 clir_sup := 0,
1178 clir_inv := 0,
1179 signal := omit,
1180 keypad := omit,
1181 more := 0,
1182 notify := notify,
1183 emergency := *,
1184 imsi := ?,
1185 lchan_type := ?,
1186 lchan_mode := ?
1187 }
1188 }
1189}
1190
1191/* : MSC -> MNCC: DISC.ind; mobile user requests disconnect */
1192template MNCC_PDU tr_MNCC_DISC_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?,
1193 template MNCC_progress prog := *,
1194 template charstring fac := *,
1195 template MNCC_useruser uu := *) := {
1196 msg_type := MNCC_DISC_IND,
1197 u := {
1198 signal := { /* See 24.008 9.3.7 */
1199 callref := call_id,
1200 bearer_cap := omit,
1201 called := omit,
1202 calling := omit,
1203 redirecting := omit,
1204 connected := omit,
1205 cause := cause,
1206 progress := prog,
1207 useruser := uu,
1208 facility := fac,
1209 cccap := omit,
1210 ssversion := omit,
1211 clir_sup := 0,
1212 clir_inv := 0,
1213 signal := omit,
1214 keypad := omit,
1215 more := 0,
1216 notify := 0,
1217 emergency := *,
1218 imsi := ?,
1219 lchan_type := ?,
1220 lchan_mode := ?
1221 }
1222 }
1223}
Harald Welte90938392018-03-25 16:36:40 +02001224template (value) MNCC_PDU ts_MNCC_DISC_ind(uint32_t call_id, template (value) MNCC_cause cause,
1225 template (omit) MNCC_progress prog := omit,
1226 template (omit) charstring fac := omit,
1227 template (omit) MNCC_useruser uu := omit) := {
1228 msg_type := MNCC_DISC_IND,
1229 u := {
1230 signal := { /* See 24.008 9.3.7 */
1231 callref := call_id,
1232 bearer_cap := omit,
1233 called := omit,
1234 calling := omit,
1235 redirecting := omit,
1236 connected := omit,
1237 cause := cause,
1238 progress := prog,
1239 useruser := uu,
1240 facility := fac,
1241 cccap := omit,
1242 ssversion := omit,
1243 clir_sup := 0,
1244 clir_inv := 0,
1245 signal := omit,
1246 keypad := omit,
1247 more := 0,
1248 notify := 0,
1249 emergency := omit,
1250 imsi := "",
1251 lchan_type := 0,
1252 lchan_mode := 0
1253 }
1254 }
1255}
Harald Welte8b2a2582018-01-16 08:11:42 +01001256
1257/* : MSC <- MNCC: DISC.req; indicate disconnect to mobile user */
1258template MNCC_PDU ts_MNCC_DISC_req(uint32_t call_id, MNCC_cause cause,
1259 template MNCC_progress prog := omit,
1260 template charstring fac := omit,
1261 template MNCC_useruser uu := omit) := {
1262 msg_type := MNCC_DISC_REQ,
1263 u := {
1264 signal := { /* See 24.008 9.3.7 */
1265 callref := call_id,
1266 bearer_cap := omit,
1267 called := omit,
1268 calling := omit,
1269 redirecting := omit,
1270 connected := omit,
1271 cause := cause,
1272 progress := prog,
1273 useruser := uu,
1274 facility := fac,
1275 cccap := omit,
1276 ssversion := omit,
1277 clir_sup := 0,
1278 clir_inv := 0,
1279 signal := omit,
1280 keypad := omit,
1281 more := 0,
1282 notify := 0,
1283 emergency := omit,
1284 imsi := "",
1285 lchan_type := 0,
1286 lchan_mode := 0
1287 }
1288 }
1289}
Harald Welte90938392018-03-25 16:36:40 +02001290template MNCC_PDU tr_MNCC_DISC_req(template uint32_t call_id,
1291 template MNCC_cause cause := *,
1292 template MNCC_progress prog := omit,
1293 template charstring fac := omit,
1294 template MNCC_useruser uu := omit) := {
1295 msg_type := MNCC_DISC_REQ,
1296 u := {
1297 signal := { /* See 24.008 9.3.7 */
1298 callref := call_id,
1299 bearer_cap := omit,
1300 called := omit,
1301 calling := omit,
1302 redirecting := omit,
1303 connected := omit,
1304 cause := cause,
1305 progress := prog,
1306 useruser := uu,
1307 facility := fac,
1308 cccap := omit,
1309 ssversion := omit,
1310 clir_sup := 0,
1311 clir_inv := 0,
1312 signal := omit,
1313 keypad := omit,
1314 more := 0,
1315 notify := 0,
1316 emergency := *,
1317 imsi := ?,
1318 lchan_type := ?,
1319 lchan_mode := ?
1320 }
1321 }
1322}
1323
Harald Welte8b2a2582018-01-16 08:11:42 +01001324
1325/* : MSC -> MNCC: REL.ind; mobile user informs network that user wants to release call + MM */
1326template MNCC_PDU tr_MNCC_REL_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?,
1327 template charstring fac := *, template MNCC_useruser uu := *) := {
1328 msg_type := MNCC_REL_IND,
1329 u := {
1330 signal := { /* See 24.008 9.3.18 */
1331 callref := call_id,
1332 bearer_cap := omit,
1333 called := omit,
1334 calling := omit,
1335 redirecting := omit,
1336 connected := omit,
1337 cause := cause,
1338 progress := omit,
1339 useruser := uu,
1340 facility := fac,
1341 cccap := omit,
1342 ssversion := omit,
1343 clir_sup := 0,
1344 clir_inv := 0,
1345 signal := omit,
1346 keypad := omit,
1347 more := 0,
1348 notify := 0,
1349 emergency := *,
1350 imsi := ?,
1351 lchan_type := ?,
1352 lchan_mode := ?
1353 }
1354 }
1355}
Harald Welte90938392018-03-25 16:36:40 +02001356template (value) MNCC_PDU ts_MNCC_REL_ind(uint32_t call_id,
1357 template (value) MNCC_cause cause,
1358 template (omit) charstring fac := omit,
1359 template (omit) MNCC_useruser uu := omit) := {
1360 msg_type := MNCC_REL_IND,
1361 u := {
1362 signal := { /* See 24.008 9.3.18 */
1363 callref := call_id,
1364 bearer_cap := omit,
1365 called := omit,
1366 calling := omit,
1367 redirecting := omit,
1368 connected := omit,
1369 cause := cause,
1370 progress := omit,
1371 useruser := uu,
1372 facility := fac,
1373 cccap := omit,
1374 ssversion := omit,
1375 clir_sup := 0,
1376 clir_inv := 0,
1377 signal := omit,
1378 keypad := omit,
1379 more := 0,
1380 notify := 0,
1381 emergency := omit,
1382 imsi := "",
1383 lchan_type := 0,
1384 lchan_mode := 0
1385 }
1386 }
1387}
Harald Welte8b2a2582018-01-16 08:11:42 +01001388
1389/* : MSC <- MNCC: REL.req; indicate to mobile user tat network intents to release MM */
1390template MNCC_PDU ts_MNCC_REL_req(uint32_t call_id, MNCC_cause cause,
1391 template charstring fac := omit, template MNCC_useruser uu := omit) := {
1392 msg_type := MNCC_REL_REQ,
1393 u := {
1394 signal := { /* See 24.008 9.3.18 */
1395 callref := call_id,
1396 bearer_cap := omit,
1397 called := omit,
1398 calling := omit,
1399 redirecting := omit,
1400 connected := omit,
1401 cause := cause,
1402 progress := omit,
1403 useruser := uu,
1404 facility := fac,
1405 cccap := omit,
1406 ssversion := omit,
1407 clir_sup := 0,
1408 clir_inv := 0,
1409 signal := omit,
1410 keypad := omit,
1411 more := 0,
1412 notify := 0,
1413 emergency := omit,
1414 imsi := "",
1415 lchan_type := 0,
1416 lchan_mode := 0
1417 }
1418 }
1419}
Harald Welte90938392018-03-25 16:36:40 +02001420template MNCC_PDU tr_MNCC_REL_req(template uint32_t call_id, template MNCC_cause cause := *,
1421 template charstring fac := *, template MNCC_useruser uu := *) := {
1422 msg_type := MNCC_REL_REQ,
1423 u := {
1424 signal := { /* See 24.008 9.3.18 */
1425 callref := call_id,
1426 bearer_cap := omit,
1427 called := *,
1428 calling := *,
1429 redirecting := *,
1430 connected := *,
1431 cause := cause,
1432 progress := omit,
1433 useruser := uu,
1434 facility := fac,
1435 cccap := omit,
1436 ssversion := omit,
1437 clir_sup := 0,
1438 clir_inv := 0,
1439 signal := omit,
1440 keypad := omit,
1441 more := 0,
1442 notify := 0,
1443 emergency := omit,
1444 imsi := ?,
1445 lchan_type := 0,
1446 lchan_mode := 0
1447 }
1448 }
1449}
1450
Harald Welte8b2a2582018-01-16 08:11:42 +01001451
1452/* : MSC -> MNCC: REL.cnf; confirm REL_req */
1453template MNCC_PDU tr_MNCC_REL_cnf(template uint32_t call_id := ?, template MNCC_cause cause := ?,
1454 template charstring fac := *, template MNCC_useruser uu := *)
1455modifies tr_MNCC_REL_ind := {
1456 msg_type := MNCC_REL_CNF
1457};
Harald Welte90938392018-03-25 16:36:40 +02001458template (value) MNCC_PDU ts_MNCC_REL_cnf(uint32_t call_id,
1459 template (value) MNCC_cause cause,
1460 template (omit) charstring fac := omit,
1461 template (omit) MNCC_useruser uu := omit)
1462modifies ts_MNCC_REL_ind := {
1463 msg_type := MNCC_REL_CNF
1464};
1465
Harald Welte8b2a2582018-01-16 08:11:42 +01001466
1467/* : MSC <- MNCC: FACILITY.req; request transmission of facility */
1468template MNCC_PDU ts_MNCC_FACILITY_req(uint32_t call_id, charstring fac) := {
1469 msg_type := MNCC_FACILITY_REQ,
1470 u := {
1471 signal := { /* See 24.008 9.3.9 */
1472 callref := call_id,
1473 bearer_cap := omit,
1474 called := omit,
1475 calling := omit,
1476 redirecting := omit,
1477 connected := omit,
1478 cause := omit,
1479 progress := omit,
1480 useruser := omit,
1481 facility := fac,
1482 cccap := omit,
1483 ssversion := omit,
1484 clir_sup := 0,
1485 clir_inv := 0,
1486 signal := omit,
1487 keypad := omit,
1488 more := 0,
1489 notify := 0,
1490 emergency := omit,
1491 imsi := "",
1492 lchan_type := 0,
1493 lchan_mode := 0
1494 }
1495 }
1496}
1497
1498/* : MSC -> MNCC: FACILITY.req; indicate reception of facility */
1499template MNCC_PDU tr_MNCC_FACILITY_ind(template uint32_t call_id := ?, template charstring fac := ?) := {
1500 msg_type := MNCC_FACILITY_IND,
1501 u := {
1502 signal := { /* See 24.008 9.3.9 */
1503 callref := call_id,
1504 bearer_cap := omit,
1505 called := omit,
1506 calling := omit,
1507 redirecting := omit,
1508 connected := omit,
1509 cause := omit,
1510 progress := omit,
1511 useruser := omit,
1512 facility := fac,
1513 cccap := omit,
1514 ssversion := omit,
1515 clir_sup := 0,
1516 clir_inv := 0,
1517 signal := omit,
1518 keypad := omit,
1519 more := 0,
1520 notify := 0,
1521 emergency := *,
1522 imsi := ?,
1523 lchan_type := ?,
1524 lchan_mode := ?
1525 }
1526 }
1527}
1528
1529/* : MSC -> MNCC: START_DTMF.ind; MS has */
1530template MNCC_PDU tr_MNCC_START_DTMF_ind(template uint32_t call_id := ?, template MNCC_keypad keypad := ?) := {
1531 msg_type := MNCC_START_DTMF_IND,
1532 u := {
1533 signal := { /* See 24.008 9.3.24 */
1534 callref := call_id,
1535 bearer_cap := omit,
1536 called := omit,
1537 calling := omit,
1538 redirecting := omit,
1539 connected := omit,
1540 cause := omit,
1541 progress := omit,
1542 useruser := omit,
1543 facility := omit,
1544 cccap := omit,
1545 ssversion := omit,
1546 clir_sup := 0,
1547 clir_inv := 0,
1548 signal := omit,
1549 keypad := keypad,
1550 more := 0,
1551 notify := 0,
1552 emergency := *,
1553 imsi := ?,
1554 lchan_type := ?,
1555 lchan_mode := ?
1556 }
1557 }
1558}
1559
1560/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */
1561template MNCC_PDU ts_MNCC_START_DTMF_rsp(uint32_t call_id, MNCC_keypad keypad) := {
1562 msg_type := MNCC_START_DTMF_RSP,
1563 u := {
1564 signal := { /* See 24.008 9.3.25 */
1565 callref := call_id,
1566 bearer_cap := omit,
1567 called := omit,
1568 calling := omit,
1569 redirecting := omit,
1570 connected := omit,
1571 cause := omit,
1572 progress := omit,
1573 useruser := omit,
1574 facility := omit,
1575 cccap := omit,
1576 ssversion := omit,
1577 clir_sup := 0,
1578 clir_inv := 0,
1579 signal := omit,
1580 keypad := keypad,
1581 more := 0,
1582 notify := 0,
1583 emergency := omit,
1584 imsi := "",
1585 lchan_type := 0,
1586 lchan_mode := 0
1587 }
1588 }
1589}
1590
1591/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */
1592template MNCC_PDU ts_MNCC_START_DTMF_rej(uint32_t call_id, MNCC_cause cause) := {
1593 msg_type := MNCC_START_DTMF_REJ,
1594 u := {
1595 signal := { /* See 24.008 9.3.26 */
1596 callref := call_id,
1597 bearer_cap := omit,
1598 called := omit,
1599 calling := omit,
1600 redirecting := omit,
1601 connected := omit,
1602 cause := cause,
1603 progress := omit,
1604 useruser := omit,
1605 facility := omit,
1606 cccap := omit,
1607 ssversion := omit,
1608 clir_sup := 0,
1609 clir_inv := 0,
1610 signal := omit,
1611 keypad := omit,
1612 more := 0,
1613 notify := 0,
1614 emergency := omit,
1615 imsi := "",
1616 lchan_type := 0,
1617 lchan_mode := 0
1618 }
1619 }
1620}
1621
1622/* : MSC -> MNCC: STOP_DTMF.ind */
1623template MNCC_PDU tr_MNCC_STOP_DTMF_ind(template uint32_t call_id := ?) :=
1624 tr_MNCC_SIMPLE(MNCC_STOP_DTMF_IND, call_id); /* See 24.008 9.3.29 */
1625
1626/* : MSC <- MNCC: STOP_DTMF.rsp; Acknowledge stop of DTMF */
1627template MNCC_PDU ts_MNCC_STOP_DTMF_rsp(uint32_t call_id) :=
1628 ts_MNCC_SIMPLE(MNCC_STOP_DTMF_RSP, call_id); /* See 24.008 9.3.30 */
1629
1630/* : MSC -> MNCC: MODIFY.ind; request to start MO in-call modification */
1631template MNCC_PDU tr_MNCC_MODIFY_ind(template uint32_t call_id := ?, template MNCC_bearer_cap bcap := ?) := {
1632 msg_type := MNCC_MODIFY_IND,
1633 u := {
1634 signal := { /* See 24.008 9.3.14 */
1635 callref := call_id,
1636 bearer_cap := bcap,
1637 called := omit,
1638 calling := omit,
1639 redirecting := omit,
1640 connected := omit,
1641 cause := omit,
1642 progress := omit,
1643 useruser := omit,
1644 facility := omit,
1645 cccap := omit,
1646 ssversion := omit,
1647 clir_sup := 0,
1648 clir_inv := 0,
1649 signal := omit,
1650 keypad := omit,
1651 more := 0,
1652 notify := 0,
1653 emergency := *,
1654 imsi := ?,
1655 lchan_type := ?,
1656 lchan_mode := ?
1657 }
1658 }
1659}
1660
1661/* : MSC <- MNCC: MODIFY.rsp; tespond to MO in-call modification */
1662template MNCC_PDU ts_MNCC_MODIFY_rsp(uint32_t call_id, MNCC_bearer_cap bcap) := {
1663 msg_type := MNCC_MODIFY_RSP,
1664 u := {
1665 signal := { /* See 24.008 9.3.14 */
1666 callref := call_id,
1667 bearer_cap := bcap,
1668 called := omit,
1669 calling := omit,
1670 redirecting := omit,
1671 connected := omit,
1672 cause := omit,
1673 progress := omit,
1674 useruser := omit,
1675 facility := omit,
1676 cccap := omit,
1677 ssversion := omit,
1678 clir_sup := 0,
1679 clir_inv := 0,
1680 signal := omit,
1681 keypad := omit,
1682 more := 0,
1683 notify := 0,
1684 emergency := omit,
1685 imsi := "",
1686 lchan_type := 0,
1687 lchan_mode := 0
1688 }
1689 }
1690}
1691
1692/* : MSC <- MNCC: MODIFY.req; request to start MT in-call modification */
1693template MNCC_PDU ts_MNCC_MODIFY_req(uint32_t call_id, MNCC_bearer_cap bcap) := {
1694 msg_type := MNCC_MODIFY_REQ,
1695 u := {
1696 signal := { /* See 24.008 9.3.14 */
1697 callref := call_id,
1698 bearer_cap := bcap,
1699 called := omit,
1700 calling := omit,
1701 redirecting := omit,
1702 connected := omit,
1703 cause := omit,
1704 progress := omit,
1705 useruser := omit,
1706 facility := omit,
1707 cccap := omit,
1708 ssversion := omit,
1709 clir_sup := 0,
1710 clir_inv := 0,
1711 signal := omit,
1712 keypad := omit,
1713 more := 0,
1714 notify := 0,
1715 emergency := omit,
1716 imsi := "",
1717 lchan_type := 0,
1718 lchan_mode := 0
1719 }
1720 }
1721}
1722
1723/* : MSC -> MNCC: MODIFY.cnf; MS has responded to MT in-call modification */
1724template MNCC_PDU tr_MNCC_MODIFY_cnf(template uint32_t call_id := ?,
1725 template MNCC_bearer_cap bcap := ?) := {
1726 msg_type := MNCC_MODIFY_CNF,
1727 u := {
1728 signal := { /* See 24.008 9.3.14 */
1729 callref := call_id,
1730 bearer_cap := bcap,
1731 called := omit,
1732 calling := omit,
1733 redirecting := omit,
1734 connected := omit,
1735 cause := omit,
1736 progress := omit,
1737 useruser := omit,
1738 facility := omit,
1739 cccap := omit,
1740 ssversion := omit,
1741 clir_sup := 0,
1742 clir_inv := 0,
1743 signal := omit,
1744 keypad := omit,
1745 more := 0,
1746 notify := 0,
1747 emergency := *,
1748 imsi := ?,
1749 lchan_type := ?,
1750 lchan_mode := ?
1751 }
1752 }
1753}
1754
1755/* : MSC <- MNCC: Request transmission of USERINFO to MS */
1756template MNCC_PDU ts_MNCC_USERINFO_req(uint32_t call_id, MNCC_useruser uu, integer more) := {
1757 msg_type := MNCC_USERINFO_REQ,
1758 u := {
1759 signal := { /* See 24.008 9.3.31 */
1760 callref := call_id,
1761 bearer_cap := omit,
1762 called := omit,
1763 calling := omit,
1764 redirecting := omit,
1765 connected := omit,
1766 cause := omit,
1767 progress := omit,
1768 useruser := uu,
1769 facility := omit,
1770 cccap := omit,
1771 ssversion := omit,
1772 clir_sup := 0,
1773 clir_inv := 0,
1774 signal := omit,
1775 keypad := omit,
1776 more := more,
1777 notify := 0,
1778 emergency := omit,
1779 imsi := "",
1780 lchan_type := 0,
1781 lchan_mode := 0
1782 }
1783 }
1784}
1785
1786/* : MSC -> MNCC: Indicate reception of USERINFO from MS */
1787template MNCC_PDU tr_MNCC_USERINFO_ind(template uint32_t call_id := ?, template MNCC_useruser uu := ?,
1788 integer more) := {
1789 msg_type := MNCC_USERINFO_IND,
1790 u := {
1791 signal := { /* See 24.008 9.3.31 */
1792 callref := call_id,
1793 bearer_cap := omit,
1794 called := omit,
1795 calling := omit,
1796 redirecting := omit,
1797 connected := omit,
1798 cause := omit,
1799 progress := omit,
1800 useruser := uu,
1801 facility := omit,
1802 cccap := omit,
1803 ssversion := omit,
1804 clir_sup := 0,
1805 clir_inv := 0,
1806 signal := omit,
1807 keypad := omit,
1808 more := more,
1809 notify := 0,
1810 emergency := omit,
1811 imsi := "",
1812 lchan_type := 0,
1813 lchan_mode := 0
1814 }
1815 }
1816}
1817
1818/* : MSC -> MNCC: HOLD.ind; MS requests hold of call */
1819template MNCC_PDU tr_MNCC_HOLD_ind(template uint32_t call_id := ?) :=
1820 tr_MNCC_SIMPLE(MNCC_HOLD_IND, call_id); /* See 24.008 9.3.10 */
1821
1822/* : MSC <- MNCC: HOLD.cnf; network confirms hold of call */
1823template MNCC_PDU ts_MNCC_HOLD_cnf(uint32_t call_id) :=
1824 ts_MNCC_SIMPLE(MNCC_HOLD_CNF, call_id); /* See 24.008 9.3.11 */
1825
1826/* : MSC <- MNCC: HOLD.rej; network rejects hold of call */
1827template MNCC_PDU ts_MNCC_HOLD_rej(uint32_t call_id, MNCC_cause cause) := {
1828 msg_type := MNCC_HOLD_REJ,
1829 u := {
1830 signal := { /* See 24.008 9.3.12 */
1831 callref := call_id,
1832 bearer_cap := omit,
1833 called := omit,
1834 calling := omit,
1835 redirecting := omit,
1836 connected := omit,
1837 cause := cause,
1838 progress := omit,
1839 useruser := omit,
1840 facility := omit,
1841 cccap := omit,
1842 ssversion := omit,
1843 clir_sup := 0,
1844 clir_inv := 0,
1845 signal := omit,
1846 keypad := omit,
1847 more := 0,
1848 notify := 0,
1849 emergency := omit,
1850 imsi := "",
1851 lchan_type := 0,
1852 lchan_mode := 0
1853 }
1854 }
1855}
1856
1857/* : MSC -> MNCC: RETRIEVE.ind; MS requests retrieval of held call */
1858template MNCC_PDU tr_MNCC_RETRIEVE_ind(template uint32_t call_id := ?) :=
1859 tr_MNCC_SIMPLE(MNCC_RETRIEVE_IND, call_id); /* See 24.008 9.3.20 */
1860
1861/* : MSC <- MNCC: RETRIEVE.cnf; network confirms retrieve of call */
1862template MNCC_PDU ts_MNCC_RETRIEVE_cnf(uint32_t call_id) :=
1863 ts_MNCC_SIMPLE(MNCC_RETRIEVE_CNF, call_id); /* See 24.008 9.3.21 */
1864
1865/* : MSC <- MNCC: RETRIEVE.rej; network rejects retrieve of call */
1866template MNCC_PDU ts_MNCC_RETRIEVE_rej(uint32_t call_id, MNCC_cause cause)
1867modifies ts_MNCC_HOLD_rej := { /* See 24.008 9.3.22 */
1868 msg_type := MNCC_RETRIEVE_REJ
1869}
1870
1871
1872template MNCC_PDU ts_MNCC_SIMPLE_RTP(MNCC_MsgType msg_type, uint32_t call_id) := {
1873 msg_type := msg_type,
1874 u := {
1875 rtp := {
1876 callref := call_id,
1877 ip := 0,
1878 rtp_port := 0,
1879 payload_type := 0,
1880 payload_msg_type := 0
1881 }
1882 }
1883}
1884
1885/* MSC <- MNCC: RTP_CREATE.req; request creation of RTP */
1886template MNCC_PDU ts_MNCC_RTP_CREATE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_CREATE, call_id);
1887
1888/* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side IP/Port) */
Neels Hofmeyr2ca1ab42019-03-08 03:45:43 +01001889template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?,
1890 template uint32_t ip := ?,
1891 template uint32_t rtp_port := ?,
1892 template uint32_t payload_type := ?) := {
Harald Welte8b2a2582018-01-16 08:11:42 +01001893 msg_type := MNCC_RTP_CREATE,
1894 u := {
1895 rtp := {
1896 callref := call_id,
Neels Hofmeyr2ca1ab42019-03-08 03:45:43 +01001897 ip := ip,
1898 rtp_port := rtp_port,
1899 payload_type := payload_type,
Harald Welte8b2a2582018-01-16 08:11:42 +01001900 payload_msg_type := ?
1901 }
1902 }
1903}
1904
1905/* MSC <- MNCC: RTP_CONNECT.req; request connect of RTP */
1906template MNCC_PDU ts_MNCC_RTP_CONNECT(uint32_t call_id, uint32_t ip, uint32_t rtp_port, uint32_t pt) := {
1907 msg_type := MNCC_RTP_CONNECT,
1908 u := {
1909 rtp := {
1910 callref := call_id,
1911 ip := ip,
1912 rtp_port := rtp_port,
1913 payload_type := pt,
1914 payload_msg_type := 0
1915 }
1916 }
1917}
Harald Welteb0d93602018-03-20 18:09:34 +01001918template MNCC_PDU tr_MNCC_RTP_CONNECT(template uint32_t call_id,
1919 template uint32_t ip := ?,
1920 template uint32_t rtp_port := ?,
1921 template uint32_t pt := ?) := {
1922 msg_type := MNCC_RTP_CONNECT,
1923 u := {
1924 rtp := {
1925 callref := call_id,
1926 ip := ip,
1927 rtp_port := rtp_port,
1928 payload_type := pt,
1929 payload_msg_type := 0
1930 }
1931 }
1932}
1933
Harald Welte8b2a2582018-01-16 08:11:42 +01001934
1935/* MSC <- MNCC: RTP_FREE.req; request connect of RTP */
1936template MNCC_PDU ts_MNCC_RTP_FREE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_FREE, call_id);
Harald Welte474fd7d2017-12-29 16:01:39 +01001937
Harald Welte251b52b2018-01-17 13:58:16 +01001938function f_mncc_get_call_id(MNCC_PDU pdu) return uint32_t {
1939 if (ischosen(pdu.u.rtp)) {
1940 return pdu.u.rtp.callref;
1941 } else if (ischosen(pdu.u.data)) {
1942 return pdu.u.data.callref;
1943 } else if (ischosen(pdu.u.signal)) {
1944 return pdu.u.signal.callref;
1945 } else {
1946 setverdict(fail, "Unable to determine Callref for MNCC", pdu);
Daniel Willmanne4ff5372018-07-05 17:35:03 +02001947 mtc.stop
Harald Welte251b52b2018-01-17 13:58:16 +01001948 }
1949}
1950
Harald Welte474fd7d2017-12-29 16:01:39 +01001951} with { encode "RAW" ; variant "FIELDORDER(msb)" }