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