blob: 8d47efbfffd55bd0912c17d5bb53c030624571de [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 Welte2bb825f2018-01-22 11:31:18 +0100277template MNCC_cause ts_MNCC_cause(int val,
278 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
401
402template MNCC_PDU ts_MNCC_Sign(MNCC_MsgType msg_type, MNCC_PDU_Signal sign) := {
403 msg_type := msg_type,
404 u := {
405 signal := sign
406 }
407}
408
Harald Welte8b2a2582018-01-16 08:11:42 +0100409template MNCC_PDU ts_MNCC_SIMPLE(MNCC_MsgType msg_type, uint32_t call_id) := {
410 msg_type := msg_type,
Harald Welte474fd7d2017-12-29 16:01:39 +0100411 u := {
412 signal := {
413 callref := call_id,
Harald Welte8b2a2582018-01-16 08:11:42 +0100414 bearer_cap := omit,
415 called := omit,
416 calling := omit,
Harald Welte474fd7d2017-12-29 16:01:39 +0100417 redirecting := omit,
418 connected := omit,
419 cause := omit,
420 progress := omit,
421 useruser := omit,
422 facility := omit,
423 cccap := omit,
424 ssversion := omit,
425 clir_sup := 0,
426 clir_inv := 0,
427 signal := omit,
428 keypad := omit,
429 more := 0,
430 notify := 0,
431 emergency := omit,
Harald Welte8b2a2582018-01-16 08:11:42 +0100432 imsi := "",
433 lchan_type := 0,
434 lchan_mode := 0
435 }
436 }
437}
438
439template MNCC_PDU tr_MNCC_SIMPLE(template MNCC_MsgType msg_type, template uint32_t call_id) := {
440 msg_type := msg_type,
441 u := {
442 signal := {
443 callref := call_id,
444 bearer_cap := omit,
445 called := omit,
446 calling := omit,
447 redirecting := omit,
448 connected := omit,
449 cause := omit,
450 progress := omit,
451 useruser := omit,
452 facility := omit,
453 cccap := omit,
454 ssversion := omit,
455 clir_sup := 0,
456 clir_inv := 0,
457 signal := omit,
458 keypad := omit,
459 more := 0,
460 notify := 0,
461 emergency := *,
462 imsi := ?,
463 lchan_type := ?,
464 lchan_mode := ?
465 }
466 }
467}
468
469
470
471/* MT: MSC <- MNCC: SETUP.req from ext. MNCC handler to MSC */
472template MNCC_PDU ts_MNCC_SETUP_req(uint32_t call_id, charstring called, charstring calling, charstring imsi := "") := {
473 msg_type := MNCC_SETUP_REQ,
474 u := {
475 signal := { /* See 24.008 9.3.23.1 */
476 callref := call_id,
477 bearer_cap := ts_MNCC_bcap_voice, /* mandatory */
478 called := valueof(ts_MNCC_number(called)), /* optional */
479 calling := valueof(ts_MNCC_number(calling)), /* optional */
480 redirecting := omit, /* optional */
481 connected := omit,
482 cause := omit,
483 progress := omit, /* optional */
484 useruser := omit, /* optional */
485 facility := omit, /* optional */
486 cccap := omit,
487 ssversion := omit,
488 clir_sup := 0,
489 clir_inv := 0,
490 signal := omit, /* optional */
491 keypad := omit,
492 more := 0,
493 notify := 0,
494 emergency := omit,
495 imsi := imsi,
Harald Welte474fd7d2017-12-29 16:01:39 +0100496 lchan_type := 0,
497 lchan_mode := 0
498 }
499 }
500};
501
Harald Welte4017d552018-01-26 21:40:05 +0100502/* MO: MSC <- MNCC: Respons to SETUP.ind */
503template MNCC_PDU ts_MNCC_SETUP_rsp(uint32_t call_id, charstring imsi := "",
504 template MNCC_number connected := omit) := {
Harald Welte8b2a2582018-01-16 08:11:42 +0100505 msg_type := MNCC_SETUP_RSP,
506 u := {
507 signal := { /* See 24.008 9.3.5 */
508 callref := call_id,
509 bearer_cap := omit,
510 called := omit,
511 calling := omit,
512 redirecting := omit,
513 connected := connected,
514 cause := omit,
515 progress := omit,
Harald Welte4017d552018-01-26 21:40:05 +0100516 useruser := omit, /* optional */
517 facility := omit, /* optional */
Harald Welte8b2a2582018-01-16 08:11:42 +0100518 cccap := omit,
Harald Welte4017d552018-01-26 21:40:05 +0100519 ssversion := omit, /* optional */
Harald Welte8b2a2582018-01-16 08:11:42 +0100520 clir_sup := 0,
521 clir_inv := 0,
522 signal := omit,
523 keypad := omit,
524 more := 0,
525 notify := 0,
Harald Welte4017d552018-01-26 21:40:05 +0100526 emergency := omit,
Harald Welte8b2a2582018-01-16 08:11:42 +0100527 imsi := imsi,
Harald Welte4017d552018-01-26 21:40:05 +0100528 lchan_type := 0,
529 lchan_mode := 0
Harald Welte8b2a2582018-01-16 08:11:42 +0100530 }
531 }
532};
533
534/* MO: MSC -> MNCC: SETUP.ind from MSC to ext. MNCC handler */
535template MNCC_PDU tr_MNCC_SETUP_ind(template uint32_t call_id := ?, template MNCC_number called := ?,
536 template MNCC_number calling := *, template charstring imsi :=?) := {
537 msg_type := MNCC_SETUP_IND,
538 u := {
539 signal := { /* See 24.008 9.3.23.2 */
540 callref := call_id,
541 bearer_cap := ?, /* mandatory */
542 called := called, /* mandatory */
543 calling := calling, /* optional */
544 redirecting := omit,
545 connected := omit,
546 cause := omit,
547 progress := omit,
548 useruser := *, /* optional */
549 facility := *, /* optional */
550 cccap := *, /* optional */
551 ssversion := *, /* optional */
552 clir_sup := ?, /* optional */
553 clir_inv := ?, /* optional */
554 signal := omit,
555 keypad := omit,
556 more := 0,
557 notify := 0,
558 emergency := *,
559 imsi := imsi,
560 lchan_type := ?,
561 lchan_mode := ?
562 }
563 }
Harald Welteafec4712018-03-19 22:52:17 +0100564}
565template (value) MNCC_PDU ts_MNCC_SETUP_ind(uint32_t call_id, MNCC_number called,
566 template (omit) MNCC_number calling := omit,
567 template (omit) charstring imsi := omit,
568 template (value) MNCC_bearer_cap bcap := ts_MNCC_bcap_voice) := {
569 msg_type := MNCC_SETUP_IND,
570 u := {
571 signal := { /* See 24.008 9.3.23.2 */
572 callref := call_id,
573 bearer_cap := valueof(bcap), /* mandatory */
574 called := called, /* mandatory */
575 calling := calling, /* optional */
576 redirecting := omit,
577 connected := omit,
578 cause := omit,
579 progress := omit,
580 useruser := omit, /* optional */
581 facility := omit, /* optional */
582 cccap := omit, /* optional */
583 ssversion := omit, /* optional */
584 clir_sup := 0, /* optional */
585 clir_inv := 0, /* optional */
586 signal := omit,
587 keypad := omit,
588 more := 0,
589 notify := 0,
590 emergency := omit,
591 imsi := imsi,
592 lchan_type := 0,
593 lchan_mode := 0
594 }
595 }
Harald Welte8b2a2582018-01-16 08:11:42 +0100596}
597
598/* MO: MSC <- MNCC: SETUP.cnf; Response to SETUP.ind */
599template MNCC_PDU ts_MNCC_SETUP_CNF(uint32_t call_id, template MNCC_number connected := omit) := {
600 msg_type := MNCC_SETUP_CNF,
601 u := {
602 signal := { /* See 24.008 9.3.5 */
603 callref := call_id,
604 bearer_cap := omit,
605 called := omit,
606 calling := omit,
607 redirecting := omit,
608 connected := connected,
609 cause := omit,
610 progress := *,
611 useruser := *,
612 facility := *,
613 cccap := omit,
614 ssversion := omit,
615 clir_sup := 0,
616 clir_inv := 0,
617 signal := omit,
618 keypad := omit,
619 more := 0,
620 notify := 0,
621 emergency := *,
622 imsi := "",
623 lchan_type := ?,
624 lchan_mode := ?
625 }
626 }
627}
628
Harald Welte33ec09b2018-02-10 15:34:46 +0100629/* MT: MSC -> MNCC: SETUP.cnf; Response to SETUP.req */
630template MNCC_PDU tr_MNCC_SETUP_cnf(uint32_t call_id, template MNCC_number connected := *) := {
631 msg_type := MNCC_SETUP_CNF,
632 u := {
633 signal := { /* See 24.008 9.3.5 */
634 callref := call_id,
635 bearer_cap := omit,
636 called := omit,
637 calling := omit,
638 redirecting := omit,
639 connected := connected,
640 cause := omit,
641 progress := *,
642 useruser := *,
643 facility := *,
644 cccap := omit,
645 ssversion := omit,
646 clir_sup := 0,
647 clir_inv := 0,
648 signal := omit,
649 keypad := omit,
650 more := 0,
651 notify := 0,
652 emergency := *,
653 imsi := ?,
654 lchan_type := ?,
655 lchan_mode := ?
656 }
657 }
658}
659
Harald Welte4017d552018-01-26 21:40:05 +0100660/* MT: MSC -> MNCC: SETUP_COMPL.req; request to send CONNECT ACK */
661template MNCC_PDU tr_MNCC_SETUP_COMPL_req(template uint32_t call_id) :=
662 tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */
Harald Welte8b2a2582018-01-16 08:11:42 +0100663
664/* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */
665template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) :=
666 tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 9.3.6 */
667
668/* MT: MSC -> MNCC: REJ.req; reject MT call */
669template MNCC_PDU tr_MNCC_REJ_req(template uint32_t call_id, template MNCC_cause cause := *) := {
670 msg_type := MNCC_REJ_REQ,
671 u := {
672 signal := { /* See 24.008 9.3.19 */
673 callref := call_id,
674 bearer_cap := omit,
675 called := omit,
676 calling := omit,
677 redirecting := omit,
678 connected := omit,
679 cause := cause,
680 progress := omit,
681 useruser := *,
682 facility := *,
683 cccap := omit,
684 ssversion := omit,
685 clir_sup := 0,
686 clir_inv := 0,
687 signal := omit,
688 keypad := omit,
689 more := 0,
690 notify := 0,
691 emergency := omit,
692 imsi := ?,
693 lchan_type := ?,
694 lchan_mode := ?
695 }
696 }
697}
698
699/* MO: MSC <- MNCC: REJ.ind; reject MO call */
700template MNCC_PDU ts_MNCC_REJ_ind(uint32_t call_id, template MNCC_cause cause := omit) := {
701 msg_type := MNCC_REJ_IND,
702 u := {
703 signal := { /* See 24.008 9.3.19 */
704 callref := call_id,
705 bearer_cap := omit,
706 called := omit,
707 calling := omit,
708 redirecting := omit,
709 connected := omit,
710 cause := cause,
711 progress := omit,
712 useruser := omit,
713 facility := omit,
714 cccap := omit,
715 ssversion := omit,
716 clir_sup := 0,
717 clir_inv := 0,
718 signal := omit,
719 keypad := omit,
720 more := 0,
721 notify := 0,
722 emergency := omit,
723 imsi := "",
724 lchan_type := 0,
725 lchan_mode := 0
726 }
727 }
728}
729
Harald Welte812f7a42018-01-27 00:49:18 +0100730/* MT: MSC -> MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */
731template MNCC_PDU tr_MNCC_CALL_CONF_ind(template uint32_t call_id, template MNCC_bearer_cap bcap := *,
732 template MNCC_cause cause := *,
733 template MNCC_cccap cccap := *) := {
Harald Welte8b2a2582018-01-16 08:11:42 +0100734 msg_type := MNCC_CALL_CONF_IND,
735 u := {
736 signal := { /* See 24.008 9.3.2 */
737 callref := call_id,
738 bearer_cap := bcap,
739 called := omit,
740 calling := omit,
741 redirecting := omit,
742 connected := omit,
743 cause := cause,
744 progress := omit,
745 useruser := omit,
746 facility := omit,
747 cccap := cccap,
748 ssversion := omit,
749 clir_sup := 0,
750 clir_inv := 0,
751 signal := omit,
752 keypad := omit,
753 more := 0,
754 notify := 0,
755 emergency := omit,
Harald Welte812f7a42018-01-27 00:49:18 +0100756 imsi := ?,
757 lchan_type := ?,
758 lchan_mode := ?
Harald Welte8b2a2582018-01-16 08:11:42 +0100759 }
760 }
761}
762
763/* MO: MSC <- MNCC: CALL_PROC.req; call establishment initiated in network */
764template MNCC_PDU ts_MNCC_CALL_PROC_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit,
765 template MNCC_progress prog := omit,
766 template charstring fac := omit,
767 template MNCC_cccap cccap := omit) := {
768 msg_type := MNCC_CALL_PROC_REQ,
769 u := {
770 signal := { /* See 24.008 9.3.2 */
771 callref := call_id,
772 bearer_cap := bcap,
773 called := omit,
774 calling := omit,
775 redirecting := omit,
776 connected := omit,
777 cause := omit,
778 progress := prog,
779 useruser := omit,
780 facility := fac,
781 cccap := cccap,
782 ssversion := omit,
783 clir_sup := 0,
784 clir_inv := 0,
785 signal := omit,
786 keypad := omit,
787 more := 0,
788 notify := 0,
789 emergency := omit,
790 imsi := "",
791 lchan_type := 0,
792 lchan_mode := 0
793 }
794 }
795}
796
797/* MSC <- MNCC: PROGRESS.req; PROGRESS message from ISDN */
798template MNCC_PDU ts_MNCC_PROGRESS_req(uint32_t call_id, MNCC_progress prog,
799 template MNCC_useruser uu := omit) := {
800 msg_type := MNCC_PROGRESS_REQ,
801 u := {
802 signal := { /* See 24.008 9.3.17 */
803 callref := call_id,
804 bearer_cap := omit,
805 called := omit,
806 calling := omit,
807 redirecting := omit,
808 connected := omit,
809 cause := omit,
810 progress := prog,
811 useruser := uu,
812 facility := omit,
813 cccap := omit,
814 ssversion := omit,
815 clir_sup := 0,
816 clir_inv := 0,
817 signal := omit,
818 keypad := omit,
819 more := 0,
820 notify := 0,
821 emergency := omit,
822 imsi := "",
823 lchan_type := 0,
824 lchan_mode := 0
825 }
826 }
827}
828
829/* MO: MSC <- MNCC: ALERT.req; indicate that user alerting has been initiated */
830template MNCC_PDU ts_MNCC_ALERT_req(uint32_t call_id, template MNCC_progress prog := omit,
831 template charstring fac := omit,
832 template MNCC_useruser uu := omit) := {
833 msg_type := MNCC_ALERT_REQ,
834 u := {
835 signal := { /* See 24.008 9.3.1 */
836 callref := call_id,
837 bearer_cap := omit,
838 called := omit,
839 calling := omit,
840 redirecting := omit,
841 connected := omit,
842 cause := omit,
843 progress := prog,
844 useruser := uu,
845 facility := fac,
846 cccap := omit,
847 ssversion := omit,
848 clir_sup := 0,
849 clir_inv := 0,
850 signal := omit,
851 keypad := omit,
852 more := 0,
853 notify := 0,
854 emergency := omit,
855 imsi := "",
856 lchan_type := 0,
857 lchan_mode := 0
858 }
859 }
860}
861
862
863/* MT: MSC -> MNCC: ALERRT.ind; indicates that mobile user alerting has been initiated */
864template MNCC_PDU tr_MNCC_ALERT_ind(template uint32_t call_id, template MNCC_progress prog := omit,
865 template charstring fac := omit,
866 template MNCC_useruser uu := omit) := {
Harald Welte33ec09b2018-02-10 15:34:46 +0100867 msg_type := MNCC_ALERT_IND,
Harald Welte8b2a2582018-01-16 08:11:42 +0100868 u := {
869 signal := { /* See 24.008 9.3.1 */
870 callref := call_id,
871 bearer_cap := omit,
872 called := omit,
873 calling := omit,
874 redirecting := omit,
875 connected := omit,
876 cause := omit,
877 progress := prog,
878 useruser := uu,
879 facility := fac,
880 cccap := omit,
881 ssversion := omit,
882 clir_sup := 0,
883 clir_inv := 0,
884 signal := omit,
885 keypad := omit,
886 more := 0,
887 notify := 0,
888 emergency := *,
889 imsi := ?,
890 lchan_type := ?,
891 lchan_mode := ?
892 }
893 }
894}
895
896/* : MSC <- MNCC: NOTIFY.req; request to send information pertaining to a call (such as user suspended) */
897template MNCC_PDU ts_MNCC_NOTIFY_req(uint32_t call_id, MNCC_notify notify) := {
898 msg_type := MNCC_NOTIFY_REQ,
899 u := {
900 signal := { /* See 24.008 9.3.16 */
901 callref := call_id,
902 bearer_cap := omit,
903 called := omit,
904 calling := omit,
905 redirecting := omit,
906 connected := omit,
907 cause := omit,
908 progress := omit,
909 useruser := omit,
910 facility := omit,
911 cccap := omit,
912 ssversion := omit,
913 clir_sup := 0,
914 clir_inv := 0,
915 signal := omit,
916 keypad := omit,
917 more := 0,
918 notify := notify,
919 emergency := omit,
920 imsi := "",
921 lchan_type := 0,
922 lchan_mode := 0
923 }
924 }
925}
926
927/* : MSC -> MNCC: NOTIFY.ind; indication to the mobile user */
928template MNCC_PDU tr_MNCC_NOTIFY_ind(template uint32_t call_id, template MNCC_notify notify) := {
929 msg_type := MNCC_NOTIFY_IND,
930 u := {
931 signal := { /* See 24.008 9.3.16 */
932 callref := call_id,
933 bearer_cap := omit,
934 called := omit,
935 calling := omit,
936 redirecting := omit,
937 connected := omit,
938 cause := omit,
939 progress := omit,
940 useruser := omit,
941 facility := omit,
942 cccap := omit,
943 ssversion := omit,
944 clir_sup := 0,
945 clir_inv := 0,
946 signal := omit,
947 keypad := omit,
948 more := 0,
949 notify := notify,
950 emergency := *,
951 imsi := ?,
952 lchan_type := ?,
953 lchan_mode := ?
954 }
955 }
956}
957
958/* : MSC -> MNCC: DISC.ind; mobile user requests disconnect */
959template MNCC_PDU tr_MNCC_DISC_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?,
960 template MNCC_progress prog := *,
961 template charstring fac := *,
962 template MNCC_useruser uu := *) := {
963 msg_type := MNCC_DISC_IND,
964 u := {
965 signal := { /* See 24.008 9.3.7 */
966 callref := call_id,
967 bearer_cap := omit,
968 called := omit,
969 calling := omit,
970 redirecting := omit,
971 connected := omit,
972 cause := cause,
973 progress := prog,
974 useruser := uu,
975 facility := fac,
976 cccap := omit,
977 ssversion := omit,
978 clir_sup := 0,
979 clir_inv := 0,
980 signal := omit,
981 keypad := omit,
982 more := 0,
983 notify := 0,
984 emergency := *,
985 imsi := ?,
986 lchan_type := ?,
987 lchan_mode := ?
988 }
989 }
990}
991
992/* : MSC <- MNCC: DISC.req; indicate disconnect to mobile user */
993template MNCC_PDU ts_MNCC_DISC_req(uint32_t call_id, MNCC_cause cause,
994 template MNCC_progress prog := omit,
995 template charstring fac := omit,
996 template MNCC_useruser uu := omit) := {
997 msg_type := MNCC_DISC_REQ,
998 u := {
999 signal := { /* See 24.008 9.3.7 */
1000 callref := call_id,
1001 bearer_cap := omit,
1002 called := omit,
1003 calling := omit,
1004 redirecting := omit,
1005 connected := omit,
1006 cause := cause,
1007 progress := prog,
1008 useruser := uu,
1009 facility := fac,
1010 cccap := omit,
1011 ssversion := omit,
1012 clir_sup := 0,
1013 clir_inv := 0,
1014 signal := omit,
1015 keypad := omit,
1016 more := 0,
1017 notify := 0,
1018 emergency := omit,
1019 imsi := "",
1020 lchan_type := 0,
1021 lchan_mode := 0
1022 }
1023 }
1024}
1025
1026/* : MSC -> MNCC: REL.ind; mobile user informs network that user wants to release call + MM */
1027template MNCC_PDU tr_MNCC_REL_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?,
1028 template charstring fac := *, template MNCC_useruser uu := *) := {
1029 msg_type := MNCC_REL_IND,
1030 u := {
1031 signal := { /* See 24.008 9.3.18 */
1032 callref := call_id,
1033 bearer_cap := omit,
1034 called := omit,
1035 calling := omit,
1036 redirecting := omit,
1037 connected := omit,
1038 cause := cause,
1039 progress := omit,
1040 useruser := uu,
1041 facility := fac,
1042 cccap := omit,
1043 ssversion := omit,
1044 clir_sup := 0,
1045 clir_inv := 0,
1046 signal := omit,
1047 keypad := omit,
1048 more := 0,
1049 notify := 0,
1050 emergency := *,
1051 imsi := ?,
1052 lchan_type := ?,
1053 lchan_mode := ?
1054 }
1055 }
1056}
1057
1058/* : MSC <- MNCC: REL.req; indicate to mobile user tat network intents to release MM */
1059template MNCC_PDU ts_MNCC_REL_req(uint32_t call_id, MNCC_cause cause,
1060 template charstring fac := omit, template MNCC_useruser uu := omit) := {
1061 msg_type := MNCC_REL_REQ,
1062 u := {
1063 signal := { /* See 24.008 9.3.18 */
1064 callref := call_id,
1065 bearer_cap := omit,
1066 called := omit,
1067 calling := omit,
1068 redirecting := omit,
1069 connected := omit,
1070 cause := cause,
1071 progress := omit,
1072 useruser := uu,
1073 facility := fac,
1074 cccap := omit,
1075 ssversion := omit,
1076 clir_sup := 0,
1077 clir_inv := 0,
1078 signal := omit,
1079 keypad := omit,
1080 more := 0,
1081 notify := 0,
1082 emergency := omit,
1083 imsi := "",
1084 lchan_type := 0,
1085 lchan_mode := 0
1086 }
1087 }
1088}
1089
1090/* : MSC -> MNCC: REL.cnf; confirm REL_req */
1091template MNCC_PDU tr_MNCC_REL_cnf(template uint32_t call_id := ?, template MNCC_cause cause := ?,
1092 template charstring fac := *, template MNCC_useruser uu := *)
1093modifies tr_MNCC_REL_ind := {
1094 msg_type := MNCC_REL_CNF
1095};
1096
1097/* : MSC <- MNCC: FACILITY.req; request transmission of facility */
1098template MNCC_PDU ts_MNCC_FACILITY_req(uint32_t call_id, charstring fac) := {
1099 msg_type := MNCC_FACILITY_REQ,
1100 u := {
1101 signal := { /* See 24.008 9.3.9 */
1102 callref := call_id,
1103 bearer_cap := omit,
1104 called := omit,
1105 calling := omit,
1106 redirecting := omit,
1107 connected := omit,
1108 cause := omit,
1109 progress := omit,
1110 useruser := omit,
1111 facility := fac,
1112 cccap := omit,
1113 ssversion := omit,
1114 clir_sup := 0,
1115 clir_inv := 0,
1116 signal := omit,
1117 keypad := omit,
1118 more := 0,
1119 notify := 0,
1120 emergency := omit,
1121 imsi := "",
1122 lchan_type := 0,
1123 lchan_mode := 0
1124 }
1125 }
1126}
1127
1128/* : MSC -> MNCC: FACILITY.req; indicate reception of facility */
1129template MNCC_PDU tr_MNCC_FACILITY_ind(template uint32_t call_id := ?, template charstring fac := ?) := {
1130 msg_type := MNCC_FACILITY_IND,
1131 u := {
1132 signal := { /* See 24.008 9.3.9 */
1133 callref := call_id,
1134 bearer_cap := omit,
1135 called := omit,
1136 calling := omit,
1137 redirecting := omit,
1138 connected := omit,
1139 cause := omit,
1140 progress := omit,
1141 useruser := omit,
1142 facility := fac,
1143 cccap := omit,
1144 ssversion := omit,
1145 clir_sup := 0,
1146 clir_inv := 0,
1147 signal := omit,
1148 keypad := omit,
1149 more := 0,
1150 notify := 0,
1151 emergency := *,
1152 imsi := ?,
1153 lchan_type := ?,
1154 lchan_mode := ?
1155 }
1156 }
1157}
1158
1159/* : MSC -> MNCC: START_DTMF.ind; MS has */
1160template MNCC_PDU tr_MNCC_START_DTMF_ind(template uint32_t call_id := ?, template MNCC_keypad keypad := ?) := {
1161 msg_type := MNCC_START_DTMF_IND,
1162 u := {
1163 signal := { /* See 24.008 9.3.24 */
1164 callref := call_id,
1165 bearer_cap := omit,
1166 called := omit,
1167 calling := omit,
1168 redirecting := omit,
1169 connected := omit,
1170 cause := omit,
1171 progress := omit,
1172 useruser := omit,
1173 facility := omit,
1174 cccap := omit,
1175 ssversion := omit,
1176 clir_sup := 0,
1177 clir_inv := 0,
1178 signal := omit,
1179 keypad := keypad,
1180 more := 0,
1181 notify := 0,
1182 emergency := *,
1183 imsi := ?,
1184 lchan_type := ?,
1185 lchan_mode := ?
1186 }
1187 }
1188}
1189
1190/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */
1191template MNCC_PDU ts_MNCC_START_DTMF_rsp(uint32_t call_id, MNCC_keypad keypad) := {
1192 msg_type := MNCC_START_DTMF_RSP,
1193 u := {
1194 signal := { /* See 24.008 9.3.25 */
1195 callref := call_id,
1196 bearer_cap := omit,
1197 called := omit,
1198 calling := omit,
1199 redirecting := omit,
1200 connected := omit,
1201 cause := omit,
1202 progress := omit,
1203 useruser := omit,
1204 facility := omit,
1205 cccap := omit,
1206 ssversion := omit,
1207 clir_sup := 0,
1208 clir_inv := 0,
1209 signal := omit,
1210 keypad := keypad,
1211 more := 0,
1212 notify := 0,
1213 emergency := omit,
1214 imsi := "",
1215 lchan_type := 0,
1216 lchan_mode := 0
1217 }
1218 }
1219}
1220
1221/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */
1222template MNCC_PDU ts_MNCC_START_DTMF_rej(uint32_t call_id, MNCC_cause cause) := {
1223 msg_type := MNCC_START_DTMF_REJ,
1224 u := {
1225 signal := { /* See 24.008 9.3.26 */
1226 callref := call_id,
1227 bearer_cap := omit,
1228 called := omit,
1229 calling := omit,
1230 redirecting := omit,
1231 connected := omit,
1232 cause := cause,
1233 progress := omit,
1234 useruser := omit,
1235 facility := omit,
1236 cccap := omit,
1237 ssversion := omit,
1238 clir_sup := 0,
1239 clir_inv := 0,
1240 signal := omit,
1241 keypad := omit,
1242 more := 0,
1243 notify := 0,
1244 emergency := omit,
1245 imsi := "",
1246 lchan_type := 0,
1247 lchan_mode := 0
1248 }
1249 }
1250}
1251
1252/* : MSC -> MNCC: STOP_DTMF.ind */
1253template MNCC_PDU tr_MNCC_STOP_DTMF_ind(template uint32_t call_id := ?) :=
1254 tr_MNCC_SIMPLE(MNCC_STOP_DTMF_IND, call_id); /* See 24.008 9.3.29 */
1255
1256/* : MSC <- MNCC: STOP_DTMF.rsp; Acknowledge stop of DTMF */
1257template MNCC_PDU ts_MNCC_STOP_DTMF_rsp(uint32_t call_id) :=
1258 ts_MNCC_SIMPLE(MNCC_STOP_DTMF_RSP, call_id); /* See 24.008 9.3.30 */
1259
1260/* : MSC -> MNCC: MODIFY.ind; request to start MO in-call modification */
1261template MNCC_PDU tr_MNCC_MODIFY_ind(template uint32_t call_id := ?, template MNCC_bearer_cap bcap := ?) := {
1262 msg_type := MNCC_MODIFY_IND,
1263 u := {
1264 signal := { /* See 24.008 9.3.14 */
1265 callref := call_id,
1266 bearer_cap := bcap,
1267 called := omit,
1268 calling := omit,
1269 redirecting := omit,
1270 connected := omit,
1271 cause := omit,
1272 progress := omit,
1273 useruser := omit,
1274 facility := omit,
1275 cccap := omit,
1276 ssversion := omit,
1277 clir_sup := 0,
1278 clir_inv := 0,
1279 signal := omit,
1280 keypad := omit,
1281 more := 0,
1282 notify := 0,
1283 emergency := *,
1284 imsi := ?,
1285 lchan_type := ?,
1286 lchan_mode := ?
1287 }
1288 }
1289}
1290
1291/* : MSC <- MNCC: MODIFY.rsp; tespond to MO in-call modification */
1292template MNCC_PDU ts_MNCC_MODIFY_rsp(uint32_t call_id, MNCC_bearer_cap bcap) := {
1293 msg_type := MNCC_MODIFY_RSP,
1294 u := {
1295 signal := { /* See 24.008 9.3.14 */
1296 callref := call_id,
1297 bearer_cap := bcap,
1298 called := omit,
1299 calling := omit,
1300 redirecting := omit,
1301 connected := omit,
1302 cause := omit,
1303 progress := omit,
1304 useruser := omit,
1305 facility := omit,
1306 cccap := omit,
1307 ssversion := omit,
1308 clir_sup := 0,
1309 clir_inv := 0,
1310 signal := omit,
1311 keypad := omit,
1312 more := 0,
1313 notify := 0,
1314 emergency := omit,
1315 imsi := "",
1316 lchan_type := 0,
1317 lchan_mode := 0
1318 }
1319 }
1320}
1321
1322/* : MSC <- MNCC: MODIFY.req; request to start MT in-call modification */
1323template MNCC_PDU ts_MNCC_MODIFY_req(uint32_t call_id, MNCC_bearer_cap bcap) := {
1324 msg_type := MNCC_MODIFY_REQ,
1325 u := {
1326 signal := { /* See 24.008 9.3.14 */
1327 callref := call_id,
1328 bearer_cap := bcap,
1329 called := omit,
1330 calling := omit,
1331 redirecting := omit,
1332 connected := omit,
1333 cause := omit,
1334 progress := omit,
1335 useruser := omit,
1336 facility := omit,
1337 cccap := omit,
1338 ssversion := omit,
1339 clir_sup := 0,
1340 clir_inv := 0,
1341 signal := omit,
1342 keypad := omit,
1343 more := 0,
1344 notify := 0,
1345 emergency := omit,
1346 imsi := "",
1347 lchan_type := 0,
1348 lchan_mode := 0
1349 }
1350 }
1351}
1352
1353/* : MSC -> MNCC: MODIFY.cnf; MS has responded to MT in-call modification */
1354template MNCC_PDU tr_MNCC_MODIFY_cnf(template uint32_t call_id := ?,
1355 template MNCC_bearer_cap bcap := ?) := {
1356 msg_type := MNCC_MODIFY_CNF,
1357 u := {
1358 signal := { /* See 24.008 9.3.14 */
1359 callref := call_id,
1360 bearer_cap := bcap,
1361 called := omit,
1362 calling := omit,
1363 redirecting := omit,
1364 connected := omit,
1365 cause := omit,
1366 progress := omit,
1367 useruser := omit,
1368 facility := omit,
1369 cccap := omit,
1370 ssversion := omit,
1371 clir_sup := 0,
1372 clir_inv := 0,
1373 signal := omit,
1374 keypad := omit,
1375 more := 0,
1376 notify := 0,
1377 emergency := *,
1378 imsi := ?,
1379 lchan_type := ?,
1380 lchan_mode := ?
1381 }
1382 }
1383}
1384
1385/* : MSC <- MNCC: Request transmission of USERINFO to MS */
1386template MNCC_PDU ts_MNCC_USERINFO_req(uint32_t call_id, MNCC_useruser uu, integer more) := {
1387 msg_type := MNCC_USERINFO_REQ,
1388 u := {
1389 signal := { /* See 24.008 9.3.31 */
1390 callref := call_id,
1391 bearer_cap := omit,
1392 called := omit,
1393 calling := omit,
1394 redirecting := omit,
1395 connected := omit,
1396 cause := omit,
1397 progress := omit,
1398 useruser := uu,
1399 facility := omit,
1400 cccap := omit,
1401 ssversion := omit,
1402 clir_sup := 0,
1403 clir_inv := 0,
1404 signal := omit,
1405 keypad := omit,
1406 more := more,
1407 notify := 0,
1408 emergency := omit,
1409 imsi := "",
1410 lchan_type := 0,
1411 lchan_mode := 0
1412 }
1413 }
1414}
1415
1416/* : MSC -> MNCC: Indicate reception of USERINFO from MS */
1417template MNCC_PDU tr_MNCC_USERINFO_ind(template uint32_t call_id := ?, template MNCC_useruser uu := ?,
1418 integer more) := {
1419 msg_type := MNCC_USERINFO_IND,
1420 u := {
1421 signal := { /* See 24.008 9.3.31 */
1422 callref := call_id,
1423 bearer_cap := omit,
1424 called := omit,
1425 calling := omit,
1426 redirecting := omit,
1427 connected := omit,
1428 cause := omit,
1429 progress := omit,
1430 useruser := uu,
1431 facility := omit,
1432 cccap := omit,
1433 ssversion := omit,
1434 clir_sup := 0,
1435 clir_inv := 0,
1436 signal := omit,
1437 keypad := omit,
1438 more := more,
1439 notify := 0,
1440 emergency := omit,
1441 imsi := "",
1442 lchan_type := 0,
1443 lchan_mode := 0
1444 }
1445 }
1446}
1447
1448/* : MSC -> MNCC: HOLD.ind; MS requests hold of call */
1449template MNCC_PDU tr_MNCC_HOLD_ind(template uint32_t call_id := ?) :=
1450 tr_MNCC_SIMPLE(MNCC_HOLD_IND, call_id); /* See 24.008 9.3.10 */
1451
1452/* : MSC <- MNCC: HOLD.cnf; network confirms hold of call */
1453template MNCC_PDU ts_MNCC_HOLD_cnf(uint32_t call_id) :=
1454 ts_MNCC_SIMPLE(MNCC_HOLD_CNF, call_id); /* See 24.008 9.3.11 */
1455
1456/* : MSC <- MNCC: HOLD.rej; network rejects hold of call */
1457template MNCC_PDU ts_MNCC_HOLD_rej(uint32_t call_id, MNCC_cause cause) := {
1458 msg_type := MNCC_HOLD_REJ,
1459 u := {
1460 signal := { /* See 24.008 9.3.12 */
1461 callref := call_id,
1462 bearer_cap := omit,
1463 called := omit,
1464 calling := omit,
1465 redirecting := omit,
1466 connected := omit,
1467 cause := cause,
1468 progress := omit,
1469 useruser := omit,
1470 facility := omit,
1471 cccap := omit,
1472 ssversion := omit,
1473 clir_sup := 0,
1474 clir_inv := 0,
1475 signal := omit,
1476 keypad := omit,
1477 more := 0,
1478 notify := 0,
1479 emergency := omit,
1480 imsi := "",
1481 lchan_type := 0,
1482 lchan_mode := 0
1483 }
1484 }
1485}
1486
1487/* : MSC -> MNCC: RETRIEVE.ind; MS requests retrieval of held call */
1488template MNCC_PDU tr_MNCC_RETRIEVE_ind(template uint32_t call_id := ?) :=
1489 tr_MNCC_SIMPLE(MNCC_RETRIEVE_IND, call_id); /* See 24.008 9.3.20 */
1490
1491/* : MSC <- MNCC: RETRIEVE.cnf; network confirms retrieve of call */
1492template MNCC_PDU ts_MNCC_RETRIEVE_cnf(uint32_t call_id) :=
1493 ts_MNCC_SIMPLE(MNCC_RETRIEVE_CNF, call_id); /* See 24.008 9.3.21 */
1494
1495/* : MSC <- MNCC: RETRIEVE.rej; network rejects retrieve of call */
1496template MNCC_PDU ts_MNCC_RETRIEVE_rej(uint32_t call_id, MNCC_cause cause)
1497modifies ts_MNCC_HOLD_rej := { /* See 24.008 9.3.22 */
1498 msg_type := MNCC_RETRIEVE_REJ
1499}
1500
1501
1502template MNCC_PDU ts_MNCC_SIMPLE_RTP(MNCC_MsgType msg_type, uint32_t call_id) := {
1503 msg_type := msg_type,
1504 u := {
1505 rtp := {
1506 callref := call_id,
1507 ip := 0,
1508 rtp_port := 0,
1509 payload_type := 0,
1510 payload_msg_type := 0
1511 }
1512 }
1513}
1514
1515/* MSC <- MNCC: RTP_CREATE.req; request creation of RTP */
1516template MNCC_PDU ts_MNCC_RTP_CREATE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_CREATE, call_id);
1517
1518/* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side IP/Port) */
1519template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?) := {
1520 msg_type := MNCC_RTP_CREATE,
1521 u := {
1522 rtp := {
1523 callref := call_id,
1524 ip := ?,
1525 rtp_port := ?,
1526 payload_type := ?,
1527 payload_msg_type := ?
1528 }
1529 }
1530}
1531
1532/* MSC <- MNCC: RTP_CONNECT.req; request connect of RTP */
1533template MNCC_PDU ts_MNCC_RTP_CONNECT(uint32_t call_id, uint32_t ip, uint32_t rtp_port, uint32_t pt) := {
1534 msg_type := MNCC_RTP_CONNECT,
1535 u := {
1536 rtp := {
1537 callref := call_id,
1538 ip := ip,
1539 rtp_port := rtp_port,
1540 payload_type := pt,
1541 payload_msg_type := 0
1542 }
1543 }
1544}
1545
1546/* MSC <- MNCC: RTP_FREE.req; request connect of RTP */
1547template 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 +01001548
Harald Welte251b52b2018-01-17 13:58:16 +01001549function f_mncc_get_call_id(MNCC_PDU pdu) return uint32_t {
1550 if (ischosen(pdu.u.rtp)) {
1551 return pdu.u.rtp.callref;
1552 } else if (ischosen(pdu.u.data)) {
1553 return pdu.u.data.callref;
1554 } else if (ischosen(pdu.u.signal)) {
1555 return pdu.u.signal.callref;
1556 } else {
1557 setverdict(fail, "Unable to determine Callref for MNCC", pdu);
1558 self.stop
1559 }
1560}
1561
Harald Welte474fd7d2017-12-29 16:01:39 +01001562} with { encode "RAW" ; variant "FIELDORDER(msb)" }