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