blob: 39f9dcef61c1adb2141cc1afa8bcca64553de010 [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};
515
Harald Welte4017d552018-01-26 21:40:05 +0100516/* MO: MSC <- MNCC: Respons to SETUP.ind */
517template MNCC_PDU ts_MNCC_SETUP_rsp(uint32_t call_id, charstring imsi := "",
518 template MNCC_number connected := omit) := {
Harald Welte8b2a2582018-01-16 08:11:42 +0100519 msg_type := MNCC_SETUP_RSP,
520 u := {
521 signal := { /* See 24.008 9.3.5 */
522 callref := call_id,
523 bearer_cap := omit,
524 called := omit,
525 calling := omit,
526 redirecting := omit,
527 connected := connected,
528 cause := omit,
529 progress := omit,
Harald Welte4017d552018-01-26 21:40:05 +0100530 useruser := omit, /* optional */
531 facility := omit, /* optional */
Harald Welte8b2a2582018-01-16 08:11:42 +0100532 cccap := omit,
Harald Welte4017d552018-01-26 21:40:05 +0100533 ssversion := omit, /* optional */
Harald Welte8b2a2582018-01-16 08:11:42 +0100534 clir_sup := 0,
535 clir_inv := 0,
536 signal := omit,
537 keypad := omit,
538 more := 0,
539 notify := 0,
Harald Welte4017d552018-01-26 21:40:05 +0100540 emergency := omit,
Harald Welte8b2a2582018-01-16 08:11:42 +0100541 imsi := imsi,
Harald Welte4017d552018-01-26 21:40:05 +0100542 lchan_type := 0,
543 lchan_mode := 0
Harald Welte8b2a2582018-01-16 08:11:42 +0100544 }
545 }
546};
Harald Welte90938392018-03-25 16:36:40 +0200547template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id,
548 template charstring imsi := ?,
549 template MNCC_number connected := *) := {
550 msg_type := MNCC_SETUP_RSP,
551 u := {
552 signal := { /* See 24.008 9.3.5 */
553 callref := call_id,
554 bearer_cap := omit,
555 called := omit,
556 calling := omit,
557 redirecting := omit,
558 connected := connected,
559 cause := omit,
560 progress := omit,
561 useruser := *, /* optional */
562 facility := *, /* optional */
563 cccap := omit,
564 ssversion := *, /* optional */
565 clir_sup := 0,
566 clir_inv := 0,
567 signal := omit,
568 keypad := omit,
569 more := 0,
570 notify := 0,
571 emergency := omit,
572 imsi := imsi,
573 lchan_type := ?,
574 lchan_mode := ?
575 }
576 }
577};
578
Harald Welte8b2a2582018-01-16 08:11:42 +0100579
580/* MO: MSC -> MNCC: SETUP.ind from MSC to ext. MNCC handler */
581template MNCC_PDU tr_MNCC_SETUP_ind(template uint32_t call_id := ?, template MNCC_number called := ?,
582 template MNCC_number calling := *, template charstring imsi :=?) := {
583 msg_type := MNCC_SETUP_IND,
584 u := {
585 signal := { /* See 24.008 9.3.23.2 */
586 callref := call_id,
587 bearer_cap := ?, /* mandatory */
588 called := called, /* mandatory */
589 calling := calling, /* optional */
590 redirecting := omit,
591 connected := omit,
592 cause := omit,
593 progress := omit,
594 useruser := *, /* optional */
595 facility := *, /* optional */
596 cccap := *, /* optional */
597 ssversion := *, /* optional */
598 clir_sup := ?, /* optional */
599 clir_inv := ?, /* optional */
600 signal := omit,
601 keypad := omit,
602 more := 0,
603 notify := 0,
604 emergency := *,
605 imsi := imsi,
606 lchan_type := ?,
607 lchan_mode := ?
608 }
609 }
Harald Welteafec4712018-03-19 22:52:17 +0100610}
611template (value) MNCC_PDU ts_MNCC_SETUP_ind(uint32_t call_id, MNCC_number called,
612 template (omit) MNCC_number calling := omit,
613 template (omit) charstring imsi := omit,
614 template (value) MNCC_bearer_cap bcap := ts_MNCC_bcap_voice) := {
615 msg_type := MNCC_SETUP_IND,
616 u := {
617 signal := { /* See 24.008 9.3.23.2 */
618 callref := call_id,
619 bearer_cap := valueof(bcap), /* mandatory */
620 called := called, /* mandatory */
621 calling := calling, /* optional */
622 redirecting := omit,
623 connected := omit,
624 cause := omit,
625 progress := omit,
626 useruser := omit, /* optional */
627 facility := omit, /* optional */
628 cccap := omit, /* optional */
629 ssversion := omit, /* optional */
630 clir_sup := 0, /* optional */
631 clir_inv := 0, /* optional */
632 signal := omit,
633 keypad := omit,
634 more := 0,
635 notify := 0,
636 emergency := omit,
637 imsi := imsi,
638 lchan_type := 0,
639 lchan_mode := 0
640 }
641 }
Harald Welte8b2a2582018-01-16 08:11:42 +0100642}
643
644/* MO: MSC <- MNCC: SETUP.cnf; Response to SETUP.ind */
645template MNCC_PDU ts_MNCC_SETUP_CNF(uint32_t call_id, template MNCC_number connected := omit) := {
646 msg_type := MNCC_SETUP_CNF,
647 u := {
648 signal := { /* See 24.008 9.3.5 */
649 callref := call_id,
650 bearer_cap := omit,
651 called := omit,
652 calling := omit,
653 redirecting := omit,
654 connected := connected,
655 cause := omit,
656 progress := *,
657 useruser := *,
658 facility := *,
659 cccap := omit,
660 ssversion := omit,
661 clir_sup := 0,
662 clir_inv := 0,
663 signal := omit,
664 keypad := omit,
665 more := 0,
666 notify := 0,
667 emergency := *,
668 imsi := "",
669 lchan_type := ?,
670 lchan_mode := ?
671 }
672 }
673}
674
Harald Welte33ec09b2018-02-10 15:34:46 +0100675/* MT: MSC -> MNCC: SETUP.cnf; Response to SETUP.req */
676template MNCC_PDU tr_MNCC_SETUP_cnf(uint32_t call_id, template MNCC_number connected := *) := {
677 msg_type := MNCC_SETUP_CNF,
678 u := {
679 signal := { /* See 24.008 9.3.5 */
680 callref := call_id,
681 bearer_cap := omit,
682 called := omit,
683 calling := omit,
684 redirecting := omit,
685 connected := connected,
686 cause := omit,
687 progress := *,
688 useruser := *,
689 facility := *,
690 cccap := omit,
691 ssversion := omit,
692 clir_sup := 0,
693 clir_inv := 0,
694 signal := omit,
695 keypad := omit,
696 more := 0,
697 notify := 0,
698 emergency := *,
699 imsi := ?,
700 lchan_type := ?,
701 lchan_mode := ?
702 }
703 }
704}
705
Harald Welte4017d552018-01-26 21:40:05 +0100706/* MT: MSC -> MNCC: SETUP_COMPL.req; request to send CONNECT ACK */
707template MNCC_PDU tr_MNCC_SETUP_COMPL_req(template uint32_t call_id) :=
708 tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */
Harald Welte8b2a2582018-01-16 08:11:42 +0100709
710/* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */
711template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) :=
712 tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 9.3.6 */
Harald Welte90938392018-03-25 16:36:40 +0200713template (value) MNCC_PDU ts_MNCC_SETUP_COMPL_ind(uint32_t call_id) :=
714 ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 9.3.6 */
Harald Welte8b2a2582018-01-16 08:11:42 +0100715
716/* MT: MSC -> MNCC: REJ.req; reject MT call */
717template MNCC_PDU tr_MNCC_REJ_req(template uint32_t call_id, template MNCC_cause cause := *) := {
718 msg_type := MNCC_REJ_REQ,
719 u := {
720 signal := { /* See 24.008 9.3.19 */
721 callref := call_id,
722 bearer_cap := omit,
723 called := omit,
724 calling := omit,
725 redirecting := omit,
726 connected := omit,
727 cause := cause,
728 progress := omit,
729 useruser := *,
730 facility := *,
731 cccap := omit,
732 ssversion := omit,
733 clir_sup := 0,
734 clir_inv := 0,
735 signal := omit,
736 keypad := omit,
737 more := 0,
738 notify := 0,
739 emergency := omit,
740 imsi := ?,
741 lchan_type := ?,
742 lchan_mode := ?
743 }
744 }
745}
746
747/* MO: MSC <- MNCC: REJ.ind; reject MO call */
748template MNCC_PDU ts_MNCC_REJ_ind(uint32_t call_id, template MNCC_cause cause := omit) := {
749 msg_type := MNCC_REJ_IND,
750 u := {
751 signal := { /* See 24.008 9.3.19 */
752 callref := call_id,
753 bearer_cap := omit,
754 called := omit,
755 calling := omit,
756 redirecting := omit,
757 connected := omit,
758 cause := cause,
759 progress := omit,
760 useruser := omit,
761 facility := omit,
762 cccap := omit,
763 ssversion := omit,
764 clir_sup := 0,
765 clir_inv := 0,
766 signal := omit,
767 keypad := omit,
768 more := 0,
769 notify := 0,
770 emergency := omit,
771 imsi := "",
772 lchan_type := 0,
773 lchan_mode := 0
774 }
775 }
776}
777
Harald Welte812f7a42018-01-27 00:49:18 +0100778/* MT: MSC -> MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */
779template MNCC_PDU tr_MNCC_CALL_CONF_ind(template uint32_t call_id, template MNCC_bearer_cap bcap := *,
780 template MNCC_cause cause := *,
781 template MNCC_cccap cccap := *) := {
Harald Welte8b2a2582018-01-16 08:11:42 +0100782 msg_type := MNCC_CALL_CONF_IND,
783 u := {
784 signal := { /* See 24.008 9.3.2 */
785 callref := call_id,
786 bearer_cap := bcap,
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 := cccap,
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,
Harald Welte812f7a42018-01-27 00:49:18 +0100804 imsi := ?,
805 lchan_type := ?,
806 lchan_mode := ?
Harald Welte8b2a2582018-01-16 08:11:42 +0100807 }
808 }
809}
810
811/* MO: MSC <- MNCC: CALL_PROC.req; call establishment initiated in network */
812template MNCC_PDU ts_MNCC_CALL_PROC_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit,
813 template MNCC_progress prog := omit,
814 template charstring fac := omit,
815 template MNCC_cccap cccap := omit) := {
816 msg_type := MNCC_CALL_PROC_REQ,
817 u := {
818 signal := { /* See 24.008 9.3.2 */
819 callref := call_id,
820 bearer_cap := bcap,
821 called := omit,
822 calling := omit,
823 redirecting := omit,
824 connected := omit,
825 cause := omit,
826 progress := prog,
827 useruser := omit,
828 facility := fac,
829 cccap := cccap,
830 ssversion := omit,
831 clir_sup := 0,
832 clir_inv := 0,
833 signal := omit,
834 keypad := omit,
835 more := 0,
836 notify := 0,
837 emergency := omit,
838 imsi := "",
839 lchan_type := 0,
840 lchan_mode := 0
841 }
842 }
843}
Harald Welte90938392018-03-25 16:36:40 +0200844template MNCC_PDU tr_MNCC_CALL_PROC_req(template uint32_t call_id,
845 template MNCC_bearer_cap bcap := *,
846 template MNCC_progress prog := *,
847 template charstring fac := *,
848 template MNCC_cccap cccap := *) := {
849 msg_type := MNCC_CALL_PROC_REQ,
850 u := {
851 signal := { /* See 24.008 9.3.2 */
852 callref := call_id,
853 bearer_cap := bcap,
854 called := omit,
855 calling := omit,
856 redirecting := omit,
857 connected := omit,
858 cause := omit,
859 progress := prog,
860 useruser := omit,
861 facility := fac,
862 cccap := cccap,
863 ssversion := omit,
864 clir_sup := 0,
865 clir_inv := 0,
866 signal := omit,
867 keypad := omit,
868 more := 0,
869 notify := 0,
870 emergency := omit,
871 imsi := ?,
872 lchan_type := ?,
873 lchan_mode := ?
874 }
875 }
876}
877
Harald Welte8b2a2582018-01-16 08:11:42 +0100878
879/* MSC <- MNCC: PROGRESS.req; PROGRESS message from ISDN */
880template MNCC_PDU ts_MNCC_PROGRESS_req(uint32_t call_id, MNCC_progress prog,
881 template MNCC_useruser uu := omit) := {
882 msg_type := MNCC_PROGRESS_REQ,
883 u := {
884 signal := { /* See 24.008 9.3.17 */
885 callref := call_id,
886 bearer_cap := omit,
887 called := omit,
888 calling := omit,
889 redirecting := omit,
890 connected := omit,
891 cause := omit,
892 progress := prog,
893 useruser := uu,
894 facility := omit,
895 cccap := omit,
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}
910
911/* MO: MSC <- MNCC: ALERT.req; indicate that user alerting has been initiated */
912template MNCC_PDU ts_MNCC_ALERT_req(uint32_t call_id, template MNCC_progress prog := omit,
913 template charstring fac := omit,
914 template MNCC_useruser uu := omit) := {
915 msg_type := MNCC_ALERT_REQ,
916 u := {
917 signal := { /* See 24.008 9.3.1 */
918 callref := call_id,
919 bearer_cap := omit,
920 called := omit,
921 calling := omit,
922 redirecting := omit,
923 connected := omit,
924 cause := omit,
925 progress := prog,
926 useruser := uu,
927 facility := fac,
928 cccap := omit,
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 := 0,
939 lchan_mode := 0
940 }
941 }
942}
Harald Welte90938392018-03-25 16:36:40 +0200943template MNCC_PDU tr_MNCC_ALERT_req(template uint32_t call_id,
944 template MNCC_progress prog := *,
945 template charstring fac := *,
946 template MNCC_useruser uu := *) := {
947 msg_type := MNCC_ALERT_REQ,
948 u := {
949 signal := { /* See 24.008 9.3.1 */
950 callref := call_id,
951 bearer_cap := omit,
952 called := omit,
953 calling := omit,
954 redirecting := omit,
955 connected := omit,
956 cause := omit,
957 progress := prog,
958 useruser := uu,
959 facility := fac,
960 cccap := omit,
961 ssversion := omit,
962 clir_sup := 0,
963 clir_inv := 0,
964 signal := omit,
965 keypad := omit,
966 more := 0,
967 notify := 0,
968 emergency := omit,
969 imsi := ?,
970 lchan_type := ?,
971 lchan_mode := ?
972 }
973 }
974}
975
Harald Welte8b2a2582018-01-16 08:11:42 +0100976
977
978/* MT: MSC -> MNCC: ALERRT.ind; indicates that mobile user alerting has been initiated */
979template MNCC_PDU tr_MNCC_ALERT_ind(template uint32_t call_id, template MNCC_progress prog := omit,
980 template charstring fac := omit,
981 template MNCC_useruser uu := omit) := {
Harald Welte33ec09b2018-02-10 15:34:46 +0100982 msg_type := MNCC_ALERT_IND,
Harald Welte8b2a2582018-01-16 08:11:42 +0100983 u := {
984 signal := { /* See 24.008 9.3.1 */
985 callref := call_id,
986 bearer_cap := omit,
987 called := omit,
988 calling := omit,
989 redirecting := omit,
990 connected := omit,
991 cause := omit,
992 progress := prog,
993 useruser := uu,
994 facility := fac,
995 cccap := omit,
996 ssversion := omit,
997 clir_sup := 0,
998 clir_inv := 0,
999 signal := omit,
1000 keypad := omit,
1001 more := 0,
1002 notify := 0,
1003 emergency := *,
1004 imsi := ?,
1005 lchan_type := ?,
1006 lchan_mode := ?
1007 }
1008 }
1009}
1010
1011/* : MSC <- MNCC: NOTIFY.req; request to send information pertaining to a call (such as user suspended) */
1012template MNCC_PDU ts_MNCC_NOTIFY_req(uint32_t call_id, MNCC_notify notify) := {
1013 msg_type := MNCC_NOTIFY_REQ,
1014 u := {
1015 signal := { /* See 24.008 9.3.16 */
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 := omit,
1024 useruser := omit,
1025 facility := omit,
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 := notify,
1034 emergency := omit,
1035 imsi := "",
1036 lchan_type := 0,
1037 lchan_mode := 0
1038 }
1039 }
1040}
1041
1042/* : MSC -> MNCC: NOTIFY.ind; indication to the mobile user */
1043template MNCC_PDU tr_MNCC_NOTIFY_ind(template uint32_t call_id, template MNCC_notify notify) := {
1044 msg_type := MNCC_NOTIFY_IND,
1045 u := {
1046 signal := { /* See 24.008 9.3.16 */
1047 callref := call_id,
1048 bearer_cap := omit,
1049 called := omit,
1050 calling := omit,
1051 redirecting := omit,
1052 connected := omit,
1053 cause := omit,
1054 progress := omit,
1055 useruser := omit,
1056 facility := omit,
1057 cccap := omit,
1058 ssversion := omit,
1059 clir_sup := 0,
1060 clir_inv := 0,
1061 signal := omit,
1062 keypad := omit,
1063 more := 0,
1064 notify := notify,
1065 emergency := *,
1066 imsi := ?,
1067 lchan_type := ?,
1068 lchan_mode := ?
1069 }
1070 }
1071}
1072
1073/* : MSC -> MNCC: DISC.ind; mobile user requests disconnect */
1074template MNCC_PDU tr_MNCC_DISC_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?,
1075 template MNCC_progress prog := *,
1076 template charstring fac := *,
1077 template MNCC_useruser uu := *) := {
1078 msg_type := MNCC_DISC_IND,
1079 u := {
1080 signal := { /* See 24.008 9.3.7 */
1081 callref := call_id,
1082 bearer_cap := omit,
1083 called := omit,
1084 calling := omit,
1085 redirecting := omit,
1086 connected := omit,
1087 cause := cause,
1088 progress := prog,
1089 useruser := uu,
1090 facility := fac,
1091 cccap := omit,
1092 ssversion := omit,
1093 clir_sup := 0,
1094 clir_inv := 0,
1095 signal := omit,
1096 keypad := omit,
1097 more := 0,
1098 notify := 0,
1099 emergency := *,
1100 imsi := ?,
1101 lchan_type := ?,
1102 lchan_mode := ?
1103 }
1104 }
1105}
Harald Welte90938392018-03-25 16:36:40 +02001106template (value) MNCC_PDU ts_MNCC_DISC_ind(uint32_t call_id, template (value) MNCC_cause cause,
1107 template (omit) MNCC_progress prog := omit,
1108 template (omit) charstring fac := omit,
1109 template (omit) MNCC_useruser uu := omit) := {
1110 msg_type := MNCC_DISC_IND,
1111 u := {
1112 signal := { /* See 24.008 9.3.7 */
1113 callref := call_id,
1114 bearer_cap := omit,
1115 called := omit,
1116 calling := omit,
1117 redirecting := omit,
1118 connected := omit,
1119 cause := cause,
1120 progress := prog,
1121 useruser := uu,
1122 facility := fac,
1123 cccap := omit,
1124 ssversion := omit,
1125 clir_sup := 0,
1126 clir_inv := 0,
1127 signal := omit,
1128 keypad := omit,
1129 more := 0,
1130 notify := 0,
1131 emergency := omit,
1132 imsi := "",
1133 lchan_type := 0,
1134 lchan_mode := 0
1135 }
1136 }
1137}
Harald Welte8b2a2582018-01-16 08:11:42 +01001138
1139/* : MSC <- MNCC: DISC.req; indicate disconnect to mobile user */
1140template MNCC_PDU ts_MNCC_DISC_req(uint32_t call_id, MNCC_cause cause,
1141 template MNCC_progress prog := omit,
1142 template charstring fac := omit,
1143 template MNCC_useruser uu := omit) := {
1144 msg_type := MNCC_DISC_REQ,
1145 u := {
1146 signal := { /* See 24.008 9.3.7 */
1147 callref := call_id,
1148 bearer_cap := omit,
1149 called := omit,
1150 calling := omit,
1151 redirecting := omit,
1152 connected := omit,
1153 cause := cause,
1154 progress := prog,
1155 useruser := uu,
1156 facility := fac,
1157 cccap := omit,
1158 ssversion := omit,
1159 clir_sup := 0,
1160 clir_inv := 0,
1161 signal := omit,
1162 keypad := omit,
1163 more := 0,
1164 notify := 0,
1165 emergency := omit,
1166 imsi := "",
1167 lchan_type := 0,
1168 lchan_mode := 0
1169 }
1170 }
1171}
Harald Welte90938392018-03-25 16:36:40 +02001172template MNCC_PDU tr_MNCC_DISC_req(template uint32_t call_id,
1173 template MNCC_cause cause := *,
1174 template MNCC_progress prog := omit,
1175 template charstring fac := omit,
1176 template MNCC_useruser uu := omit) := {
1177 msg_type := MNCC_DISC_REQ,
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}
1205
Harald Welte8b2a2582018-01-16 08:11:42 +01001206
1207/* : MSC -> MNCC: REL.ind; mobile user informs network that user wants to release call + MM */
1208template MNCC_PDU tr_MNCC_REL_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?,
1209 template charstring fac := *, template MNCC_useruser uu := *) := {
1210 msg_type := MNCC_REL_IND,
1211 u := {
1212 signal := { /* See 24.008 9.3.18 */
1213 callref := call_id,
1214 bearer_cap := omit,
1215 called := omit,
1216 calling := omit,
1217 redirecting := omit,
1218 connected := omit,
1219 cause := cause,
1220 progress := omit,
1221 useruser := uu,
1222 facility := fac,
1223 cccap := omit,
1224 ssversion := omit,
1225 clir_sup := 0,
1226 clir_inv := 0,
1227 signal := omit,
1228 keypad := omit,
1229 more := 0,
1230 notify := 0,
1231 emergency := *,
1232 imsi := ?,
1233 lchan_type := ?,
1234 lchan_mode := ?
1235 }
1236 }
1237}
Harald Welte90938392018-03-25 16:36:40 +02001238template (value) MNCC_PDU ts_MNCC_REL_ind(uint32_t call_id,
1239 template (value) MNCC_cause cause,
1240 template (omit) charstring fac := omit,
1241 template (omit) MNCC_useruser uu := omit) := {
1242 msg_type := MNCC_REL_IND,
1243 u := {
1244 signal := { /* See 24.008 9.3.18 */
1245 callref := call_id,
1246 bearer_cap := omit,
1247 called := omit,
1248 calling := omit,
1249 redirecting := omit,
1250 connected := omit,
1251 cause := cause,
1252 progress := omit,
1253 useruser := uu,
1254 facility := fac,
1255 cccap := omit,
1256 ssversion := omit,
1257 clir_sup := 0,
1258 clir_inv := 0,
1259 signal := omit,
1260 keypad := omit,
1261 more := 0,
1262 notify := 0,
1263 emergency := omit,
1264 imsi := "",
1265 lchan_type := 0,
1266 lchan_mode := 0
1267 }
1268 }
1269}
Harald Welte8b2a2582018-01-16 08:11:42 +01001270
1271/* : MSC <- MNCC: REL.req; indicate to mobile user tat network intents to release MM */
1272template MNCC_PDU ts_MNCC_REL_req(uint32_t call_id, MNCC_cause cause,
1273 template charstring fac := omit, template MNCC_useruser uu := omit) := {
1274 msg_type := MNCC_REL_REQ,
1275 u := {
1276 signal := { /* See 24.008 9.3.18 */
1277 callref := call_id,
1278 bearer_cap := omit,
1279 called := omit,
1280 calling := omit,
1281 redirecting := omit,
1282 connected := omit,
1283 cause := cause,
1284 progress := omit,
1285 useruser := uu,
1286 facility := fac,
1287 cccap := omit,
1288 ssversion := omit,
1289 clir_sup := 0,
1290 clir_inv := 0,
1291 signal := omit,
1292 keypad := omit,
1293 more := 0,
1294 notify := 0,
1295 emergency := omit,
1296 imsi := "",
1297 lchan_type := 0,
1298 lchan_mode := 0
1299 }
1300 }
1301}
Harald Welte90938392018-03-25 16:36:40 +02001302template MNCC_PDU tr_MNCC_REL_req(template uint32_t call_id, template MNCC_cause cause := *,
1303 template charstring fac := *, template MNCC_useruser uu := *) := {
1304 msg_type := MNCC_REL_REQ,
1305 u := {
1306 signal := { /* See 24.008 9.3.18 */
1307 callref := call_id,
1308 bearer_cap := omit,
1309 called := *,
1310 calling := *,
1311 redirecting := *,
1312 connected := *,
1313 cause := cause,
1314 progress := omit,
1315 useruser := uu,
1316 facility := fac,
1317 cccap := omit,
1318 ssversion := omit,
1319 clir_sup := 0,
1320 clir_inv := 0,
1321 signal := omit,
1322 keypad := omit,
1323 more := 0,
1324 notify := 0,
1325 emergency := omit,
1326 imsi := ?,
1327 lchan_type := 0,
1328 lchan_mode := 0
1329 }
1330 }
1331}
1332
Harald Welte8b2a2582018-01-16 08:11:42 +01001333
1334/* : MSC -> MNCC: REL.cnf; confirm REL_req */
1335template MNCC_PDU tr_MNCC_REL_cnf(template uint32_t call_id := ?, template MNCC_cause cause := ?,
1336 template charstring fac := *, template MNCC_useruser uu := *)
1337modifies tr_MNCC_REL_ind := {
1338 msg_type := MNCC_REL_CNF
1339};
Harald Welte90938392018-03-25 16:36:40 +02001340template (value) MNCC_PDU ts_MNCC_REL_cnf(uint32_t call_id,
1341 template (value) MNCC_cause cause,
1342 template (omit) charstring fac := omit,
1343 template (omit) MNCC_useruser uu := omit)
1344modifies ts_MNCC_REL_ind := {
1345 msg_type := MNCC_REL_CNF
1346};
1347
Harald Welte8b2a2582018-01-16 08:11:42 +01001348
1349/* : MSC <- MNCC: FACILITY.req; request transmission of facility */
1350template MNCC_PDU ts_MNCC_FACILITY_req(uint32_t call_id, charstring fac) := {
1351 msg_type := MNCC_FACILITY_REQ,
1352 u := {
1353 signal := { /* See 24.008 9.3.9 */
1354 callref := call_id,
1355 bearer_cap := omit,
1356 called := omit,
1357 calling := omit,
1358 redirecting := omit,
1359 connected := omit,
1360 cause := omit,
1361 progress := omit,
1362 useruser := omit,
1363 facility := fac,
1364 cccap := omit,
1365 ssversion := omit,
1366 clir_sup := 0,
1367 clir_inv := 0,
1368 signal := omit,
1369 keypad := omit,
1370 more := 0,
1371 notify := 0,
1372 emergency := omit,
1373 imsi := "",
1374 lchan_type := 0,
1375 lchan_mode := 0
1376 }
1377 }
1378}
1379
1380/* : MSC -> MNCC: FACILITY.req; indicate reception of facility */
1381template MNCC_PDU tr_MNCC_FACILITY_ind(template uint32_t call_id := ?, template charstring fac := ?) := {
1382 msg_type := MNCC_FACILITY_IND,
1383 u := {
1384 signal := { /* See 24.008 9.3.9 */
1385 callref := call_id,
1386 bearer_cap := omit,
1387 called := omit,
1388 calling := omit,
1389 redirecting := omit,
1390 connected := omit,
1391 cause := omit,
1392 progress := omit,
1393 useruser := omit,
1394 facility := fac,
1395 cccap := omit,
1396 ssversion := omit,
1397 clir_sup := 0,
1398 clir_inv := 0,
1399 signal := omit,
1400 keypad := omit,
1401 more := 0,
1402 notify := 0,
1403 emergency := *,
1404 imsi := ?,
1405 lchan_type := ?,
1406 lchan_mode := ?
1407 }
1408 }
1409}
1410
1411/* : MSC -> MNCC: START_DTMF.ind; MS has */
1412template MNCC_PDU tr_MNCC_START_DTMF_ind(template uint32_t call_id := ?, template MNCC_keypad keypad := ?) := {
1413 msg_type := MNCC_START_DTMF_IND,
1414 u := {
1415 signal := { /* See 24.008 9.3.24 */
1416 callref := call_id,
1417 bearer_cap := omit,
1418 called := omit,
1419 calling := omit,
1420 redirecting := omit,
1421 connected := omit,
1422 cause := omit,
1423 progress := omit,
1424 useruser := omit,
1425 facility := omit,
1426 cccap := omit,
1427 ssversion := omit,
1428 clir_sup := 0,
1429 clir_inv := 0,
1430 signal := omit,
1431 keypad := keypad,
1432 more := 0,
1433 notify := 0,
1434 emergency := *,
1435 imsi := ?,
1436 lchan_type := ?,
1437 lchan_mode := ?
1438 }
1439 }
1440}
1441
1442/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */
1443template MNCC_PDU ts_MNCC_START_DTMF_rsp(uint32_t call_id, MNCC_keypad keypad) := {
1444 msg_type := MNCC_START_DTMF_RSP,
1445 u := {
1446 signal := { /* See 24.008 9.3.25 */
1447 callref := call_id,
1448 bearer_cap := omit,
1449 called := omit,
1450 calling := omit,
1451 redirecting := omit,
1452 connected := omit,
1453 cause := omit,
1454 progress := omit,
1455 useruser := omit,
1456 facility := omit,
1457 cccap := omit,
1458 ssversion := omit,
1459 clir_sup := 0,
1460 clir_inv := 0,
1461 signal := omit,
1462 keypad := keypad,
1463 more := 0,
1464 notify := 0,
1465 emergency := omit,
1466 imsi := "",
1467 lchan_type := 0,
1468 lchan_mode := 0
1469 }
1470 }
1471}
1472
1473/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */
1474template MNCC_PDU ts_MNCC_START_DTMF_rej(uint32_t call_id, MNCC_cause cause) := {
1475 msg_type := MNCC_START_DTMF_REJ,
1476 u := {
1477 signal := { /* See 24.008 9.3.26 */
1478 callref := call_id,
1479 bearer_cap := omit,
1480 called := omit,
1481 calling := omit,
1482 redirecting := omit,
1483 connected := omit,
1484 cause := cause,
1485 progress := omit,
1486 useruser := omit,
1487 facility := omit,
1488 cccap := omit,
1489 ssversion := omit,
1490 clir_sup := 0,
1491 clir_inv := 0,
1492 signal := omit,
1493 keypad := omit,
1494 more := 0,
1495 notify := 0,
1496 emergency := omit,
1497 imsi := "",
1498 lchan_type := 0,
1499 lchan_mode := 0
1500 }
1501 }
1502}
1503
1504/* : MSC -> MNCC: STOP_DTMF.ind */
1505template MNCC_PDU tr_MNCC_STOP_DTMF_ind(template uint32_t call_id := ?) :=
1506 tr_MNCC_SIMPLE(MNCC_STOP_DTMF_IND, call_id); /* See 24.008 9.3.29 */
1507
1508/* : MSC <- MNCC: STOP_DTMF.rsp; Acknowledge stop of DTMF */
1509template MNCC_PDU ts_MNCC_STOP_DTMF_rsp(uint32_t call_id) :=
1510 ts_MNCC_SIMPLE(MNCC_STOP_DTMF_RSP, call_id); /* See 24.008 9.3.30 */
1511
1512/* : MSC -> MNCC: MODIFY.ind; request to start MO in-call modification */
1513template MNCC_PDU tr_MNCC_MODIFY_ind(template uint32_t call_id := ?, template MNCC_bearer_cap bcap := ?) := {
1514 msg_type := MNCC_MODIFY_IND,
1515 u := {
1516 signal := { /* See 24.008 9.3.14 */
1517 callref := call_id,
1518 bearer_cap := bcap,
1519 called := omit,
1520 calling := omit,
1521 redirecting := omit,
1522 connected := omit,
1523 cause := omit,
1524 progress := omit,
1525 useruser := omit,
1526 facility := omit,
1527 cccap := omit,
1528 ssversion := omit,
1529 clir_sup := 0,
1530 clir_inv := 0,
1531 signal := omit,
1532 keypad := omit,
1533 more := 0,
1534 notify := 0,
1535 emergency := *,
1536 imsi := ?,
1537 lchan_type := ?,
1538 lchan_mode := ?
1539 }
1540 }
1541}
1542
1543/* : MSC <- MNCC: MODIFY.rsp; tespond to MO in-call modification */
1544template MNCC_PDU ts_MNCC_MODIFY_rsp(uint32_t call_id, MNCC_bearer_cap bcap) := {
1545 msg_type := MNCC_MODIFY_RSP,
1546 u := {
1547 signal := { /* See 24.008 9.3.14 */
1548 callref := call_id,
1549 bearer_cap := bcap,
1550 called := omit,
1551 calling := omit,
1552 redirecting := omit,
1553 connected := omit,
1554 cause := omit,
1555 progress := omit,
1556 useruser := omit,
1557 facility := omit,
1558 cccap := omit,
1559 ssversion := omit,
1560 clir_sup := 0,
1561 clir_inv := 0,
1562 signal := omit,
1563 keypad := omit,
1564 more := 0,
1565 notify := 0,
1566 emergency := omit,
1567 imsi := "",
1568 lchan_type := 0,
1569 lchan_mode := 0
1570 }
1571 }
1572}
1573
1574/* : MSC <- MNCC: MODIFY.req; request to start MT in-call modification */
1575template MNCC_PDU ts_MNCC_MODIFY_req(uint32_t call_id, MNCC_bearer_cap bcap) := {
1576 msg_type := MNCC_MODIFY_REQ,
1577 u := {
1578 signal := { /* See 24.008 9.3.14 */
1579 callref := call_id,
1580 bearer_cap := bcap,
1581 called := omit,
1582 calling := omit,
1583 redirecting := omit,
1584 connected := omit,
1585 cause := omit,
1586 progress := omit,
1587 useruser := omit,
1588 facility := omit,
1589 cccap := omit,
1590 ssversion := omit,
1591 clir_sup := 0,
1592 clir_inv := 0,
1593 signal := omit,
1594 keypad := omit,
1595 more := 0,
1596 notify := 0,
1597 emergency := omit,
1598 imsi := "",
1599 lchan_type := 0,
1600 lchan_mode := 0
1601 }
1602 }
1603}
1604
1605/* : MSC -> MNCC: MODIFY.cnf; MS has responded to MT in-call modification */
1606template MNCC_PDU tr_MNCC_MODIFY_cnf(template uint32_t call_id := ?,
1607 template MNCC_bearer_cap bcap := ?) := {
1608 msg_type := MNCC_MODIFY_CNF,
1609 u := {
1610 signal := { /* See 24.008 9.3.14 */
1611 callref := call_id,
1612 bearer_cap := bcap,
1613 called := omit,
1614 calling := omit,
1615 redirecting := omit,
1616 connected := omit,
1617 cause := omit,
1618 progress := omit,
1619 useruser := omit,
1620 facility := omit,
1621 cccap := omit,
1622 ssversion := omit,
1623 clir_sup := 0,
1624 clir_inv := 0,
1625 signal := omit,
1626 keypad := omit,
1627 more := 0,
1628 notify := 0,
1629 emergency := *,
1630 imsi := ?,
1631 lchan_type := ?,
1632 lchan_mode := ?
1633 }
1634 }
1635}
1636
1637/* : MSC <- MNCC: Request transmission of USERINFO to MS */
1638template MNCC_PDU ts_MNCC_USERINFO_req(uint32_t call_id, MNCC_useruser uu, integer more) := {
1639 msg_type := MNCC_USERINFO_REQ,
1640 u := {
1641 signal := { /* See 24.008 9.3.31 */
1642 callref := call_id,
1643 bearer_cap := omit,
1644 called := omit,
1645 calling := omit,
1646 redirecting := omit,
1647 connected := omit,
1648 cause := omit,
1649 progress := omit,
1650 useruser := uu,
1651 facility := omit,
1652 cccap := omit,
1653 ssversion := omit,
1654 clir_sup := 0,
1655 clir_inv := 0,
1656 signal := omit,
1657 keypad := omit,
1658 more := more,
1659 notify := 0,
1660 emergency := omit,
1661 imsi := "",
1662 lchan_type := 0,
1663 lchan_mode := 0
1664 }
1665 }
1666}
1667
1668/* : MSC -> MNCC: Indicate reception of USERINFO from MS */
1669template MNCC_PDU tr_MNCC_USERINFO_ind(template uint32_t call_id := ?, template MNCC_useruser uu := ?,
1670 integer more) := {
1671 msg_type := MNCC_USERINFO_IND,
1672 u := {
1673 signal := { /* See 24.008 9.3.31 */
1674 callref := call_id,
1675 bearer_cap := omit,
1676 called := omit,
1677 calling := omit,
1678 redirecting := omit,
1679 connected := omit,
1680 cause := omit,
1681 progress := omit,
1682 useruser := uu,
1683 facility := omit,
1684 cccap := omit,
1685 ssversion := omit,
1686 clir_sup := 0,
1687 clir_inv := 0,
1688 signal := omit,
1689 keypad := omit,
1690 more := more,
1691 notify := 0,
1692 emergency := omit,
1693 imsi := "",
1694 lchan_type := 0,
1695 lchan_mode := 0
1696 }
1697 }
1698}
1699
1700/* : MSC -> MNCC: HOLD.ind; MS requests hold of call */
1701template MNCC_PDU tr_MNCC_HOLD_ind(template uint32_t call_id := ?) :=
1702 tr_MNCC_SIMPLE(MNCC_HOLD_IND, call_id); /* See 24.008 9.3.10 */
1703
1704/* : MSC <- MNCC: HOLD.cnf; network confirms hold of call */
1705template MNCC_PDU ts_MNCC_HOLD_cnf(uint32_t call_id) :=
1706 ts_MNCC_SIMPLE(MNCC_HOLD_CNF, call_id); /* See 24.008 9.3.11 */
1707
1708/* : MSC <- MNCC: HOLD.rej; network rejects hold of call */
1709template MNCC_PDU ts_MNCC_HOLD_rej(uint32_t call_id, MNCC_cause cause) := {
1710 msg_type := MNCC_HOLD_REJ,
1711 u := {
1712 signal := { /* See 24.008 9.3.12 */
1713 callref := call_id,
1714 bearer_cap := omit,
1715 called := omit,
1716 calling := omit,
1717 redirecting := omit,
1718 connected := omit,
1719 cause := cause,
1720 progress := omit,
1721 useruser := omit,
1722 facility := omit,
1723 cccap := omit,
1724 ssversion := omit,
1725 clir_sup := 0,
1726 clir_inv := 0,
1727 signal := omit,
1728 keypad := omit,
1729 more := 0,
1730 notify := 0,
1731 emergency := omit,
1732 imsi := "",
1733 lchan_type := 0,
1734 lchan_mode := 0
1735 }
1736 }
1737}
1738
1739/* : MSC -> MNCC: RETRIEVE.ind; MS requests retrieval of held call */
1740template MNCC_PDU tr_MNCC_RETRIEVE_ind(template uint32_t call_id := ?) :=
1741 tr_MNCC_SIMPLE(MNCC_RETRIEVE_IND, call_id); /* See 24.008 9.3.20 */
1742
1743/* : MSC <- MNCC: RETRIEVE.cnf; network confirms retrieve of call */
1744template MNCC_PDU ts_MNCC_RETRIEVE_cnf(uint32_t call_id) :=
1745 ts_MNCC_SIMPLE(MNCC_RETRIEVE_CNF, call_id); /* See 24.008 9.3.21 */
1746
1747/* : MSC <- MNCC: RETRIEVE.rej; network rejects retrieve of call */
1748template MNCC_PDU ts_MNCC_RETRIEVE_rej(uint32_t call_id, MNCC_cause cause)
1749modifies ts_MNCC_HOLD_rej := { /* See 24.008 9.3.22 */
1750 msg_type := MNCC_RETRIEVE_REJ
1751}
1752
1753
1754template MNCC_PDU ts_MNCC_SIMPLE_RTP(MNCC_MsgType msg_type, uint32_t call_id) := {
1755 msg_type := msg_type,
1756 u := {
1757 rtp := {
1758 callref := call_id,
1759 ip := 0,
1760 rtp_port := 0,
1761 payload_type := 0,
1762 payload_msg_type := 0
1763 }
1764 }
1765}
1766
1767/* MSC <- MNCC: RTP_CREATE.req; request creation of RTP */
1768template MNCC_PDU ts_MNCC_RTP_CREATE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_CREATE, call_id);
1769
1770/* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side IP/Port) */
1771template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?) := {
1772 msg_type := MNCC_RTP_CREATE,
1773 u := {
1774 rtp := {
1775 callref := call_id,
1776 ip := ?,
1777 rtp_port := ?,
1778 payload_type := ?,
1779 payload_msg_type := ?
1780 }
1781 }
1782}
1783
1784/* MSC <- MNCC: RTP_CONNECT.req; request connect of RTP */
1785template MNCC_PDU ts_MNCC_RTP_CONNECT(uint32_t call_id, uint32_t ip, uint32_t rtp_port, uint32_t pt) := {
1786 msg_type := MNCC_RTP_CONNECT,
1787 u := {
1788 rtp := {
1789 callref := call_id,
1790 ip := ip,
1791 rtp_port := rtp_port,
1792 payload_type := pt,
1793 payload_msg_type := 0
1794 }
1795 }
1796}
1797
1798/* MSC <- MNCC: RTP_FREE.req; request connect of RTP */
1799template 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 +01001800
Harald Welte251b52b2018-01-17 13:58:16 +01001801function f_mncc_get_call_id(MNCC_PDU pdu) return uint32_t {
1802 if (ischosen(pdu.u.rtp)) {
1803 return pdu.u.rtp.callref;
1804 } else if (ischosen(pdu.u.data)) {
1805 return pdu.u.data.callref;
1806 } else if (ischosen(pdu.u.signal)) {
1807 return pdu.u.signal.callref;
1808 } else {
1809 setverdict(fail, "Unable to determine Callref for MNCC", pdu);
1810 self.stop
1811 }
1812}
1813
Harald Welte474fd7d2017-12-29 16:01:39 +01001814} with { encode "RAW" ; variant "FIELDORDER(msb)" }