Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 1 | module MNCC_Types { |
| 2 | |
| 3 | import from Osmocom_Types all; |
| 4 | |
| 5 | /* for architectures where 'int' is 32bit like x86_64 */ |
| 6 | type integer int with { variant "FIELDLENGTH(32)" }; |
| 7 | |
| 8 | |
| 9 | /* GSM 04.08 Bearer Capability: Rate Adaption */ |
| 10 | type 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 */ |
| 18 | type enumerated GSM48_bcap_sig_access { |
Harald Welte | ec3d065 | 2018-01-22 02:54:13 +0100 | [diff] [blame] | 19 | GSM48_BCAP_SA_NONE (0), |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 20 | 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 */ |
| 29 | type enumerated GSM48_bcap_user_rate { |
Harald Welte | ec3d065 | 2018-01-22 02:54:13 +0100 | [diff] [blame] | 30 | GSM48_BCAP_UR_NONE (0), |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 31 | 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 */ |
| 41 | type 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 */ |
| 50 | type enumerated GSM48_bcap_interm_rate { |
Harald Welte | ec3d065 | 2018-01-22 02:54:13 +0100 | [diff] [blame] | 51 | GSM48_BCAP_IR_NONE (0), |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 52 | GSM48_BCAP_IR_8k (2), |
| 53 | GSM48_BCAP_IR_16k (3) |
| 54 | }; |
| 55 | |
| 56 | /* GSM 04.08 Bearer Capability: Transparency */ |
| 57 | type 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 */ |
| 65 | type 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 | |
| 77 | type 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 | |
| 136 | const integer GSM_MAX_FACILITY := 128; |
| 137 | const integer GSM_MAX_SSVERSION := 128; |
| 138 | const integer GSM_MAX_USERUSER := 128; |
| 139 | |
| 140 | type 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 | |
| 153 | type record length(0..8) of int MNCC_speech_vers; |
| 154 | |
| 155 | /* Expanded fields from GSM TS 04.08, Table 10.5.102 */ |
| 156 | type 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 | |
| 166 | template 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 Welte | 515f5d1 | 2018-01-22 02:55:10 +0100 | [diff] [blame] | 172 | speech_ver := { 0, 2, 4, 1, 5, -1 }, |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 173 | data := omit |
| 174 | }; |
| 175 | |
| 176 | type 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 */ |
| 185 | type 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 */ |
| 197 | type 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 */ |
| 206 | type 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 | |
| 213 | type 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 Welte | fe75a20 | 2018-01-17 13:59:20 +0100 | [diff] [blame] | 220 | /* 24.008 Table 10.5.122 */ |
| 221 | type 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 | |
| 228 | type 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 Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 240 | |
Harald Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 241 | template (value) MNCC_number ts_MNCC_number(charstring number, |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 242 | 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 Welte | d748a05 | 2018-01-22 02:59:24 +0100 | [diff] [blame] | 253 | template 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 Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 265 | type record MNCC_cause { |
Harald Welte | fe75a20 | 2018-01-17 13:59:20 +0100 | [diff] [blame] | 266 | GSM48_cause_loc location, |
| 267 | GSM48_cause_coding coding, |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 268 | int rec, |
| 269 | int rec_val, |
| 270 | int val, |
| 271 | octetstring diag |
Harald Welte | fe75a20 | 2018-01-17 13:59:20 +0100 | [diff] [blame] | 272 | } with { |
| 273 | variant (location) "FIELDLENGTH(32)"; |
| 274 | variant (coding) "FIELDLENGTH(32)"; |
| 275 | } |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 276 | |
| 277 | type record MNCC_useruser { |
| 278 | int proto, |
| 279 | charstring info |
| 280 | }; |
| 281 | |
| 282 | type record MNCC_progress { |
| 283 | int coding, |
| 284 | int location, |
| 285 | int descr |
| 286 | }; |
| 287 | |
| 288 | type record MNCC_cccap { |
| 289 | int dtmf, |
| 290 | int pcp |
| 291 | }; |
| 292 | |
Harald Welte | 8b2a258 | 2018-01-16 08:11:42 +0100 | [diff] [blame] | 293 | type int MNCC_notify (0..127); |
| 294 | type int MNCC_keypad (0..127); |
| 295 | |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 296 | type enumerated MNCC_bcap { |
| 297 | GSM_MNCC_BCAP_SPEECH (0), |
| 298 | GSM_MNCC_BCAP_UNR_DIG (1), |
| 299 | GSM_MNCC_BCAP_AUDIO (2), |
| 300 | GSM_MNCC_BCAP_FAX_G3 (3), |
| 301 | GSM_MNCC_BCAP_OTHER_ITC (4), |
| 302 | GSM_MNCC_BCAP_RESERVED (7) |
| 303 | }; |
| 304 | |
| 305 | |
| 306 | type record MNCC_PDU_Signal { |
| 307 | uint32_t callref, |
| 308 | |
| 309 | MNCC_bearer_cap bearer_cap optional, |
| 310 | MNCC_number called optional, |
| 311 | MNCC_number calling optional, |
| 312 | MNCC_number redirecting optional, |
| 313 | MNCC_number connected optional, |
| 314 | MNCC_cause cause optional, |
| 315 | MNCC_progress progress optional, |
| 316 | MNCC_useruser useruser optional, |
| 317 | charstring facility optional, |
| 318 | MNCC_cccap cccap optional, |
| 319 | charstring ssversion optional, |
| 320 | |
| 321 | int clir_sup, |
| 322 | int clir_inv, |
| 323 | int signal optional, |
| 324 | |
Harald Welte | 8b2a258 | 2018-01-16 08:11:42 +0100 | [diff] [blame] | 325 | MNCC_keypad keypad optional, |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 326 | int more, |
Harald Welte | 8b2a258 | 2018-01-16 08:11:42 +0100 | [diff] [blame] | 327 | MNCC_notify notify, |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 328 | int emergency optional, |
| 329 | charstring imsi, |
| 330 | |
| 331 | uint8_t lchan_type, /* empty in OSmoMSC */ |
| 332 | uint8_t lchan_mode /* empty in OsmoMSC */ |
| 333 | }; |
| 334 | |
| 335 | |
| 336 | type record MNCC_PDU_Data { |
| 337 | uint32_t callref, |
| 338 | octetstring data |
| 339 | }; |
| 340 | |
| 341 | type record MNCC_PDU_Rtp { |
| 342 | uint32_t callref, |
| 343 | uint32_t ip, |
| 344 | uint16_t rtp_port, |
| 345 | uint32_t payload_type, |
| 346 | uint32_t payload_msg_type |
| 347 | }; |
| 348 | |
| 349 | type record MNCC_PDU_Hello { |
| 350 | uint32_t version, |
| 351 | uint32_t mncc_size, |
| 352 | uint32_t data_frame_size, |
| 353 | uint32_t called_offset, |
| 354 | uint32_t signal_offset, |
| 355 | uint32_t emergency_offset, |
| 356 | uint32_t lchan_type_offset |
| 357 | }; |
| 358 | |
| 359 | |
| 360 | type union MNCC_MsgUnion { |
| 361 | MNCC_PDU_Signal signal, |
| 362 | MNCC_PDU_Data data, |
| 363 | MNCC_PDU_Rtp rtp, |
| 364 | MNCC_PDU_Hello hello |
| 365 | }; |
| 366 | |
| 367 | |
| 368 | type record MNCC_PDU { |
| 369 | MNCC_MsgType msg_type, |
| 370 | MNCC_MsgUnion u |
| 371 | } with { variant (u) "CROSSTAG( |
| 372 | hello, msg_type = MNCC_SOCKET_HELLO; |
| 373 | rtp, { msg_type = MNCC_RTP_CREATE, |
| 374 | msg_type = MNCC_RTP_CONNECT, |
| 375 | msg_type = MNCC_RTP_FREE }; |
| 376 | data, { msg_type = GSM_TCHF_FRAME, |
| 377 | msg_type = GSM_TCHF_FRAME_EFR, |
| 378 | msg_type = GSM_TCHH_FRAME, |
| 379 | msg_type = GSM_TCH_FRAME_AMR, |
| 380 | msg_type = GSM_BAD_FRAME }; |
| 381 | signal, OTHERWISE |
| 382 | )" |
| 383 | }; |
| 384 | |
| 385 | external function enc_MNCC_PDU(in MNCC_PDU pdu) return octetstring; |
| 386 | |
| 387 | external function dec_MNCC_PDU(in octetstring stream) return MNCC_PDU; |
| 388 | |
| 389 | |
| 390 | template MNCC_PDU ts_MNCC_Sign(MNCC_MsgType msg_type, MNCC_PDU_Signal sign) := { |
| 391 | msg_type := msg_type, |
| 392 | u := { |
| 393 | signal := sign |
| 394 | } |
| 395 | } |
| 396 | |
Harald Welte | 8b2a258 | 2018-01-16 08:11:42 +0100 | [diff] [blame] | 397 | template MNCC_PDU ts_MNCC_SIMPLE(MNCC_MsgType msg_type, uint32_t call_id) := { |
| 398 | msg_type := msg_type, |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 399 | u := { |
| 400 | signal := { |
| 401 | callref := call_id, |
Harald Welte | 8b2a258 | 2018-01-16 08:11:42 +0100 | [diff] [blame] | 402 | bearer_cap := omit, |
| 403 | called := omit, |
| 404 | calling := omit, |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 405 | redirecting := omit, |
| 406 | connected := omit, |
| 407 | cause := omit, |
| 408 | progress := omit, |
| 409 | useruser := omit, |
| 410 | facility := omit, |
| 411 | cccap := omit, |
| 412 | ssversion := omit, |
| 413 | clir_sup := 0, |
| 414 | clir_inv := 0, |
| 415 | signal := omit, |
| 416 | keypad := omit, |
| 417 | more := 0, |
| 418 | notify := 0, |
| 419 | emergency := omit, |
Harald Welte | 8b2a258 | 2018-01-16 08:11:42 +0100 | [diff] [blame] | 420 | imsi := "", |
| 421 | lchan_type := 0, |
| 422 | lchan_mode := 0 |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | template MNCC_PDU tr_MNCC_SIMPLE(template MNCC_MsgType msg_type, template uint32_t call_id) := { |
| 428 | msg_type := msg_type, |
| 429 | u := { |
| 430 | signal := { |
| 431 | callref := call_id, |
| 432 | bearer_cap := omit, |
| 433 | called := omit, |
| 434 | calling := omit, |
| 435 | redirecting := omit, |
| 436 | connected := omit, |
| 437 | cause := omit, |
| 438 | progress := omit, |
| 439 | useruser := omit, |
| 440 | facility := omit, |
| 441 | cccap := omit, |
| 442 | ssversion := omit, |
| 443 | clir_sup := 0, |
| 444 | clir_inv := 0, |
| 445 | signal := omit, |
| 446 | keypad := omit, |
| 447 | more := 0, |
| 448 | notify := 0, |
| 449 | emergency := *, |
| 450 | imsi := ?, |
| 451 | lchan_type := ?, |
| 452 | lchan_mode := ? |
| 453 | } |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | |
| 458 | |
| 459 | /* MT: MSC <- MNCC: SETUP.req from ext. MNCC handler to MSC */ |
| 460 | template MNCC_PDU ts_MNCC_SETUP_req(uint32_t call_id, charstring called, charstring calling, charstring imsi := "") := { |
| 461 | msg_type := MNCC_SETUP_REQ, |
| 462 | u := { |
| 463 | signal := { /* See 24.008 9.3.23.1 */ |
| 464 | callref := call_id, |
| 465 | bearer_cap := ts_MNCC_bcap_voice, /* mandatory */ |
| 466 | called := valueof(ts_MNCC_number(called)), /* optional */ |
| 467 | calling := valueof(ts_MNCC_number(calling)), /* optional */ |
| 468 | redirecting := omit, /* optional */ |
| 469 | connected := omit, |
| 470 | cause := omit, |
| 471 | progress := omit, /* optional */ |
| 472 | useruser := omit, /* optional */ |
| 473 | facility := omit, /* optional */ |
| 474 | cccap := omit, |
| 475 | ssversion := omit, |
| 476 | clir_sup := 0, |
| 477 | clir_inv := 0, |
| 478 | signal := omit, /* optional */ |
| 479 | keypad := omit, |
| 480 | more := 0, |
| 481 | notify := 0, |
| 482 | emergency := omit, |
| 483 | imsi := imsi, |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 484 | lchan_type := 0, |
| 485 | lchan_mode := 0 |
| 486 | } |
| 487 | } |
| 488 | }; |
| 489 | |
Harald Welte | 8b2a258 | 2018-01-16 08:11:42 +0100 | [diff] [blame] | 490 | /* MT: MSC -> MNCC: Respons to SETUP.req */ |
| 491 | template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id := ?, template MNCC_number connected := *, |
| 492 | template charstring imsi := ?) := { |
| 493 | msg_type := MNCC_SETUP_RSP, |
| 494 | u := { |
| 495 | signal := { /* See 24.008 9.3.5 */ |
| 496 | callref := call_id, |
| 497 | bearer_cap := omit, |
| 498 | called := omit, |
| 499 | calling := omit, |
| 500 | redirecting := omit, |
| 501 | connected := connected, |
| 502 | cause := omit, |
| 503 | progress := omit, |
| 504 | useruser := *, |
| 505 | facility := *, |
| 506 | cccap := omit, |
| 507 | ssversion := *, |
| 508 | clir_sup := 0, |
| 509 | clir_inv := 0, |
| 510 | signal := omit, |
| 511 | keypad := omit, |
| 512 | more := 0, |
| 513 | notify := 0, |
| 514 | emergency := *, |
| 515 | imsi := imsi, |
| 516 | lchan_type := ?, |
| 517 | lchan_mode := ? |
| 518 | } |
| 519 | } |
| 520 | }; |
| 521 | |
| 522 | /* MO: MSC -> MNCC: SETUP.ind from MSC to ext. MNCC handler */ |
| 523 | template MNCC_PDU tr_MNCC_SETUP_ind(template uint32_t call_id := ?, template MNCC_number called := ?, |
| 524 | template MNCC_number calling := *, template charstring imsi :=?) := { |
| 525 | msg_type := MNCC_SETUP_IND, |
| 526 | u := { |
| 527 | signal := { /* See 24.008 9.3.23.2 */ |
| 528 | callref := call_id, |
| 529 | bearer_cap := ?, /* mandatory */ |
| 530 | called := called, /* mandatory */ |
| 531 | calling := calling, /* optional */ |
| 532 | redirecting := omit, |
| 533 | connected := omit, |
| 534 | cause := omit, |
| 535 | progress := omit, |
| 536 | useruser := *, /* optional */ |
| 537 | facility := *, /* optional */ |
| 538 | cccap := *, /* optional */ |
| 539 | ssversion := *, /* optional */ |
| 540 | clir_sup := ?, /* optional */ |
| 541 | clir_inv := ?, /* optional */ |
| 542 | signal := omit, |
| 543 | keypad := omit, |
| 544 | more := 0, |
| 545 | notify := 0, |
| 546 | emergency := *, |
| 547 | imsi := imsi, |
| 548 | lchan_type := ?, |
| 549 | lchan_mode := ? |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | } |
| 554 | |
| 555 | /* MO: MSC <- MNCC: SETUP.cnf; Response to SETUP.ind */ |
| 556 | template MNCC_PDU ts_MNCC_SETUP_CNF(uint32_t call_id, template MNCC_number connected := omit) := { |
| 557 | msg_type := MNCC_SETUP_CNF, |
| 558 | u := { |
| 559 | signal := { /* See 24.008 9.3.5 */ |
| 560 | callref := call_id, |
| 561 | bearer_cap := omit, |
| 562 | called := omit, |
| 563 | calling := omit, |
| 564 | redirecting := omit, |
| 565 | connected := connected, |
| 566 | cause := omit, |
| 567 | progress := *, |
| 568 | useruser := *, |
| 569 | facility := *, |
| 570 | cccap := omit, |
| 571 | ssversion := omit, |
| 572 | clir_sup := 0, |
| 573 | clir_inv := 0, |
| 574 | signal := omit, |
| 575 | keypad := omit, |
| 576 | more := 0, |
| 577 | notify := 0, |
| 578 | emergency := *, |
| 579 | imsi := "", |
| 580 | lchan_type := ?, |
| 581 | lchan_mode := ? |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | /* MO: MSC <- MNCC: SETUP_COMPL.req; request to send CONNECT ACK */ |
| 587 | template MNCC_PDU ts_MNCC_SETUP_COMPL_req(uint32_t call_id) := |
| 588 | ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */ |
| 589 | |
| 590 | /* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */ |
| 591 | template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) := |
| 592 | tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 9.3.6 */ |
| 593 | |
| 594 | /* MT: MSC -> MNCC: REJ.req; reject MT call */ |
| 595 | template MNCC_PDU tr_MNCC_REJ_req(template uint32_t call_id, template MNCC_cause cause := *) := { |
| 596 | msg_type := MNCC_REJ_REQ, |
| 597 | u := { |
| 598 | signal := { /* See 24.008 9.3.19 */ |
| 599 | callref := call_id, |
| 600 | bearer_cap := omit, |
| 601 | called := omit, |
| 602 | calling := omit, |
| 603 | redirecting := omit, |
| 604 | connected := omit, |
| 605 | cause := cause, |
| 606 | progress := omit, |
| 607 | useruser := *, |
| 608 | facility := *, |
| 609 | cccap := omit, |
| 610 | ssversion := omit, |
| 611 | clir_sup := 0, |
| 612 | clir_inv := 0, |
| 613 | signal := omit, |
| 614 | keypad := omit, |
| 615 | more := 0, |
| 616 | notify := 0, |
| 617 | emergency := omit, |
| 618 | imsi := ?, |
| 619 | lchan_type := ?, |
| 620 | lchan_mode := ? |
| 621 | } |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | /* MO: MSC <- MNCC: REJ.ind; reject MO call */ |
| 626 | template MNCC_PDU ts_MNCC_REJ_ind(uint32_t call_id, template MNCC_cause cause := omit) := { |
| 627 | msg_type := MNCC_REJ_IND, |
| 628 | u := { |
| 629 | signal := { /* See 24.008 9.3.19 */ |
| 630 | callref := call_id, |
| 631 | bearer_cap := omit, |
| 632 | called := omit, |
| 633 | calling := omit, |
| 634 | redirecting := omit, |
| 635 | connected := omit, |
| 636 | cause := cause, |
| 637 | progress := omit, |
| 638 | useruser := omit, |
| 639 | facility := omit, |
| 640 | cccap := omit, |
| 641 | ssversion := omit, |
| 642 | clir_sup := 0, |
| 643 | clir_inv := 0, |
| 644 | signal := omit, |
| 645 | keypad := omit, |
| 646 | more := 0, |
| 647 | notify := 0, |
| 648 | emergency := omit, |
| 649 | imsi := "", |
| 650 | lchan_type := 0, |
| 651 | lchan_mode := 0 |
| 652 | } |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | /* MT: MSC <- MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */ |
| 657 | template MNCC_PDU ts_MNCC_CALL_CONF_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit, |
| 658 | template MNCC_cause cause := omit, |
| 659 | template MNCC_cccap cccap := omit) := { |
| 660 | msg_type := MNCC_CALL_CONF_IND, |
| 661 | u := { |
| 662 | signal := { /* See 24.008 9.3.2 */ |
| 663 | callref := call_id, |
| 664 | bearer_cap := bcap, |
| 665 | called := omit, |
| 666 | calling := omit, |
| 667 | redirecting := omit, |
| 668 | connected := omit, |
| 669 | cause := cause, |
| 670 | progress := omit, |
| 671 | useruser := omit, |
| 672 | facility := omit, |
| 673 | cccap := cccap, |
| 674 | ssversion := omit, |
| 675 | clir_sup := 0, |
| 676 | clir_inv := 0, |
| 677 | signal := omit, |
| 678 | keypad := omit, |
| 679 | more := 0, |
| 680 | notify := 0, |
| 681 | emergency := omit, |
| 682 | imsi := "", |
| 683 | lchan_type := 0, |
| 684 | lchan_mode := 0 |
| 685 | } |
| 686 | } |
| 687 | } |
| 688 | |
| 689 | /* MO: MSC <- MNCC: CALL_PROC.req; call establishment initiated in network */ |
| 690 | template MNCC_PDU ts_MNCC_CALL_PROC_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit, |
| 691 | template MNCC_progress prog := omit, |
| 692 | template charstring fac := omit, |
| 693 | template MNCC_cccap cccap := omit) := { |
| 694 | msg_type := MNCC_CALL_PROC_REQ, |
| 695 | u := { |
| 696 | signal := { /* See 24.008 9.3.2 */ |
| 697 | callref := call_id, |
| 698 | bearer_cap := bcap, |
| 699 | called := omit, |
| 700 | calling := omit, |
| 701 | redirecting := omit, |
| 702 | connected := omit, |
| 703 | cause := omit, |
| 704 | progress := prog, |
| 705 | useruser := omit, |
| 706 | facility := fac, |
| 707 | cccap := cccap, |
| 708 | ssversion := omit, |
| 709 | clir_sup := 0, |
| 710 | clir_inv := 0, |
| 711 | signal := omit, |
| 712 | keypad := omit, |
| 713 | more := 0, |
| 714 | notify := 0, |
| 715 | emergency := omit, |
| 716 | imsi := "", |
| 717 | lchan_type := 0, |
| 718 | lchan_mode := 0 |
| 719 | } |
| 720 | } |
| 721 | } |
| 722 | |
| 723 | /* MSC <- MNCC: PROGRESS.req; PROGRESS message from ISDN */ |
| 724 | template MNCC_PDU ts_MNCC_PROGRESS_req(uint32_t call_id, MNCC_progress prog, |
| 725 | template MNCC_useruser uu := omit) := { |
| 726 | msg_type := MNCC_PROGRESS_REQ, |
| 727 | u := { |
| 728 | signal := { /* See 24.008 9.3.17 */ |
| 729 | callref := call_id, |
| 730 | bearer_cap := omit, |
| 731 | called := omit, |
| 732 | calling := omit, |
| 733 | redirecting := omit, |
| 734 | connected := omit, |
| 735 | cause := omit, |
| 736 | progress := prog, |
| 737 | useruser := uu, |
| 738 | facility := omit, |
| 739 | cccap := omit, |
| 740 | ssversion := omit, |
| 741 | clir_sup := 0, |
| 742 | clir_inv := 0, |
| 743 | signal := omit, |
| 744 | keypad := omit, |
| 745 | more := 0, |
| 746 | notify := 0, |
| 747 | emergency := omit, |
| 748 | imsi := "", |
| 749 | lchan_type := 0, |
| 750 | lchan_mode := 0 |
| 751 | } |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | /* MO: MSC <- MNCC: ALERT.req; indicate that user alerting has been initiated */ |
| 756 | template MNCC_PDU ts_MNCC_ALERT_req(uint32_t call_id, template MNCC_progress prog := omit, |
| 757 | template charstring fac := omit, |
| 758 | template MNCC_useruser uu := omit) := { |
| 759 | msg_type := MNCC_ALERT_REQ, |
| 760 | u := { |
| 761 | signal := { /* See 24.008 9.3.1 */ |
| 762 | callref := call_id, |
| 763 | bearer_cap := omit, |
| 764 | called := omit, |
| 765 | calling := omit, |
| 766 | redirecting := omit, |
| 767 | connected := omit, |
| 768 | cause := omit, |
| 769 | progress := prog, |
| 770 | useruser := uu, |
| 771 | facility := fac, |
| 772 | cccap := omit, |
| 773 | ssversion := omit, |
| 774 | clir_sup := 0, |
| 775 | clir_inv := 0, |
| 776 | signal := omit, |
| 777 | keypad := omit, |
| 778 | more := 0, |
| 779 | notify := 0, |
| 780 | emergency := omit, |
| 781 | imsi := "", |
| 782 | lchan_type := 0, |
| 783 | lchan_mode := 0 |
| 784 | } |
| 785 | } |
| 786 | } |
| 787 | |
| 788 | |
| 789 | /* MT: MSC -> MNCC: ALERRT.ind; indicates that mobile user alerting has been initiated */ |
| 790 | template MNCC_PDU tr_MNCC_ALERT_ind(template uint32_t call_id, template MNCC_progress prog := omit, |
| 791 | template charstring fac := omit, |
| 792 | template MNCC_useruser uu := omit) := { |
| 793 | msg_type := MNCC_ALERT_REQ, |
| 794 | u := { |
| 795 | signal := { /* See 24.008 9.3.1 */ |
| 796 | callref := call_id, |
| 797 | bearer_cap := omit, |
| 798 | called := omit, |
| 799 | calling := omit, |
| 800 | redirecting := omit, |
| 801 | connected := omit, |
| 802 | cause := omit, |
| 803 | progress := prog, |
| 804 | useruser := uu, |
| 805 | facility := fac, |
| 806 | cccap := omit, |
| 807 | ssversion := omit, |
| 808 | clir_sup := 0, |
| 809 | clir_inv := 0, |
| 810 | signal := omit, |
| 811 | keypad := omit, |
| 812 | more := 0, |
| 813 | notify := 0, |
| 814 | emergency := *, |
| 815 | imsi := ?, |
| 816 | lchan_type := ?, |
| 817 | lchan_mode := ? |
| 818 | } |
| 819 | } |
| 820 | } |
| 821 | |
| 822 | /* : MSC <- MNCC: NOTIFY.req; request to send information pertaining to a call (such as user suspended) */ |
| 823 | template MNCC_PDU ts_MNCC_NOTIFY_req(uint32_t call_id, MNCC_notify notify) := { |
| 824 | msg_type := MNCC_NOTIFY_REQ, |
| 825 | u := { |
| 826 | signal := { /* See 24.008 9.3.16 */ |
| 827 | callref := call_id, |
| 828 | bearer_cap := omit, |
| 829 | called := omit, |
| 830 | calling := omit, |
| 831 | redirecting := omit, |
| 832 | connected := omit, |
| 833 | cause := omit, |
| 834 | progress := omit, |
| 835 | useruser := omit, |
| 836 | facility := omit, |
| 837 | cccap := omit, |
| 838 | ssversion := omit, |
| 839 | clir_sup := 0, |
| 840 | clir_inv := 0, |
| 841 | signal := omit, |
| 842 | keypad := omit, |
| 843 | more := 0, |
| 844 | notify := notify, |
| 845 | emergency := omit, |
| 846 | imsi := "", |
| 847 | lchan_type := 0, |
| 848 | lchan_mode := 0 |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | /* : MSC -> MNCC: NOTIFY.ind; indication to the mobile user */ |
| 854 | template MNCC_PDU tr_MNCC_NOTIFY_ind(template uint32_t call_id, template MNCC_notify notify) := { |
| 855 | msg_type := MNCC_NOTIFY_IND, |
| 856 | u := { |
| 857 | signal := { /* See 24.008 9.3.16 */ |
| 858 | callref := call_id, |
| 859 | bearer_cap := omit, |
| 860 | called := omit, |
| 861 | calling := omit, |
| 862 | redirecting := omit, |
| 863 | connected := omit, |
| 864 | cause := omit, |
| 865 | progress := omit, |
| 866 | useruser := omit, |
| 867 | facility := omit, |
| 868 | cccap := omit, |
| 869 | ssversion := omit, |
| 870 | clir_sup := 0, |
| 871 | clir_inv := 0, |
| 872 | signal := omit, |
| 873 | keypad := omit, |
| 874 | more := 0, |
| 875 | notify := notify, |
| 876 | emergency := *, |
| 877 | imsi := ?, |
| 878 | lchan_type := ?, |
| 879 | lchan_mode := ? |
| 880 | } |
| 881 | } |
| 882 | } |
| 883 | |
| 884 | /* : MSC -> MNCC: DISC.ind; mobile user requests disconnect */ |
| 885 | template MNCC_PDU tr_MNCC_DISC_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?, |
| 886 | template MNCC_progress prog := *, |
| 887 | template charstring fac := *, |
| 888 | template MNCC_useruser uu := *) := { |
| 889 | msg_type := MNCC_DISC_IND, |
| 890 | u := { |
| 891 | signal := { /* See 24.008 9.3.7 */ |
| 892 | callref := call_id, |
| 893 | bearer_cap := omit, |
| 894 | called := omit, |
| 895 | calling := omit, |
| 896 | redirecting := omit, |
| 897 | connected := omit, |
| 898 | cause := cause, |
| 899 | progress := prog, |
| 900 | useruser := uu, |
| 901 | facility := fac, |
| 902 | cccap := omit, |
| 903 | ssversion := omit, |
| 904 | clir_sup := 0, |
| 905 | clir_inv := 0, |
| 906 | signal := omit, |
| 907 | keypad := omit, |
| 908 | more := 0, |
| 909 | notify := 0, |
| 910 | emergency := *, |
| 911 | imsi := ?, |
| 912 | lchan_type := ?, |
| 913 | lchan_mode := ? |
| 914 | } |
| 915 | } |
| 916 | } |
| 917 | |
| 918 | /* : MSC <- MNCC: DISC.req; indicate disconnect to mobile user */ |
| 919 | template MNCC_PDU ts_MNCC_DISC_req(uint32_t call_id, MNCC_cause cause, |
| 920 | template MNCC_progress prog := omit, |
| 921 | template charstring fac := omit, |
| 922 | template MNCC_useruser uu := omit) := { |
| 923 | msg_type := MNCC_DISC_REQ, |
| 924 | u := { |
| 925 | signal := { /* See 24.008 9.3.7 */ |
| 926 | callref := call_id, |
| 927 | bearer_cap := omit, |
| 928 | called := omit, |
| 929 | calling := omit, |
| 930 | redirecting := omit, |
| 931 | connected := omit, |
| 932 | cause := cause, |
| 933 | progress := prog, |
| 934 | useruser := uu, |
| 935 | facility := fac, |
| 936 | cccap := omit, |
| 937 | ssversion := omit, |
| 938 | clir_sup := 0, |
| 939 | clir_inv := 0, |
| 940 | signal := omit, |
| 941 | keypad := omit, |
| 942 | more := 0, |
| 943 | notify := 0, |
| 944 | emergency := omit, |
| 945 | imsi := "", |
| 946 | lchan_type := 0, |
| 947 | lchan_mode := 0 |
| 948 | } |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | /* : MSC -> MNCC: REL.ind; mobile user informs network that user wants to release call + MM */ |
| 953 | template MNCC_PDU tr_MNCC_REL_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?, |
| 954 | template charstring fac := *, template MNCC_useruser uu := *) := { |
| 955 | msg_type := MNCC_REL_IND, |
| 956 | u := { |
| 957 | signal := { /* See 24.008 9.3.18 */ |
| 958 | callref := call_id, |
| 959 | bearer_cap := omit, |
| 960 | called := omit, |
| 961 | calling := omit, |
| 962 | redirecting := omit, |
| 963 | connected := omit, |
| 964 | cause := cause, |
| 965 | progress := omit, |
| 966 | useruser := uu, |
| 967 | facility := fac, |
| 968 | cccap := omit, |
| 969 | ssversion := omit, |
| 970 | clir_sup := 0, |
| 971 | clir_inv := 0, |
| 972 | signal := omit, |
| 973 | keypad := omit, |
| 974 | more := 0, |
| 975 | notify := 0, |
| 976 | emergency := *, |
| 977 | imsi := ?, |
| 978 | lchan_type := ?, |
| 979 | lchan_mode := ? |
| 980 | } |
| 981 | } |
| 982 | } |
| 983 | |
| 984 | /* : MSC <- MNCC: REL.req; indicate to mobile user tat network intents to release MM */ |
| 985 | template MNCC_PDU ts_MNCC_REL_req(uint32_t call_id, MNCC_cause cause, |
| 986 | template charstring fac := omit, template MNCC_useruser uu := omit) := { |
| 987 | msg_type := MNCC_REL_REQ, |
| 988 | u := { |
| 989 | signal := { /* See 24.008 9.3.18 */ |
| 990 | callref := call_id, |
| 991 | bearer_cap := omit, |
| 992 | called := omit, |
| 993 | calling := omit, |
| 994 | redirecting := omit, |
| 995 | connected := omit, |
| 996 | cause := cause, |
| 997 | progress := omit, |
| 998 | useruser := uu, |
| 999 | facility := fac, |
| 1000 | cccap := omit, |
| 1001 | ssversion := omit, |
| 1002 | clir_sup := 0, |
| 1003 | clir_inv := 0, |
| 1004 | signal := omit, |
| 1005 | keypad := omit, |
| 1006 | more := 0, |
| 1007 | notify := 0, |
| 1008 | emergency := omit, |
| 1009 | imsi := "", |
| 1010 | lchan_type := 0, |
| 1011 | lchan_mode := 0 |
| 1012 | } |
| 1013 | } |
| 1014 | } |
| 1015 | |
| 1016 | /* : MSC -> MNCC: REL.cnf; confirm REL_req */ |
| 1017 | template MNCC_PDU tr_MNCC_REL_cnf(template uint32_t call_id := ?, template MNCC_cause cause := ?, |
| 1018 | template charstring fac := *, template MNCC_useruser uu := *) |
| 1019 | modifies tr_MNCC_REL_ind := { |
| 1020 | msg_type := MNCC_REL_CNF |
| 1021 | }; |
| 1022 | |
| 1023 | /* : MSC <- MNCC: FACILITY.req; request transmission of facility */ |
| 1024 | template MNCC_PDU ts_MNCC_FACILITY_req(uint32_t call_id, charstring fac) := { |
| 1025 | msg_type := MNCC_FACILITY_REQ, |
| 1026 | u := { |
| 1027 | signal := { /* See 24.008 9.3.9 */ |
| 1028 | callref := call_id, |
| 1029 | bearer_cap := omit, |
| 1030 | called := omit, |
| 1031 | calling := omit, |
| 1032 | redirecting := omit, |
| 1033 | connected := omit, |
| 1034 | cause := omit, |
| 1035 | progress := omit, |
| 1036 | useruser := omit, |
| 1037 | facility := fac, |
| 1038 | cccap := omit, |
| 1039 | ssversion := omit, |
| 1040 | clir_sup := 0, |
| 1041 | clir_inv := 0, |
| 1042 | signal := omit, |
| 1043 | keypad := omit, |
| 1044 | more := 0, |
| 1045 | notify := 0, |
| 1046 | emergency := omit, |
| 1047 | imsi := "", |
| 1048 | lchan_type := 0, |
| 1049 | lchan_mode := 0 |
| 1050 | } |
| 1051 | } |
| 1052 | } |
| 1053 | |
| 1054 | /* : MSC -> MNCC: FACILITY.req; indicate reception of facility */ |
| 1055 | template MNCC_PDU tr_MNCC_FACILITY_ind(template uint32_t call_id := ?, template charstring fac := ?) := { |
| 1056 | msg_type := MNCC_FACILITY_IND, |
| 1057 | u := { |
| 1058 | signal := { /* See 24.008 9.3.9 */ |
| 1059 | callref := call_id, |
| 1060 | bearer_cap := omit, |
| 1061 | called := omit, |
| 1062 | calling := omit, |
| 1063 | redirecting := omit, |
| 1064 | connected := omit, |
| 1065 | cause := omit, |
| 1066 | progress := omit, |
| 1067 | useruser := omit, |
| 1068 | facility := fac, |
| 1069 | cccap := omit, |
| 1070 | ssversion := omit, |
| 1071 | clir_sup := 0, |
| 1072 | clir_inv := 0, |
| 1073 | signal := omit, |
| 1074 | keypad := omit, |
| 1075 | more := 0, |
| 1076 | notify := 0, |
| 1077 | emergency := *, |
| 1078 | imsi := ?, |
| 1079 | lchan_type := ?, |
| 1080 | lchan_mode := ? |
| 1081 | } |
| 1082 | } |
| 1083 | } |
| 1084 | |
| 1085 | /* : MSC -> MNCC: START_DTMF.ind; MS has */ |
| 1086 | template MNCC_PDU tr_MNCC_START_DTMF_ind(template uint32_t call_id := ?, template MNCC_keypad keypad := ?) := { |
| 1087 | msg_type := MNCC_START_DTMF_IND, |
| 1088 | u := { |
| 1089 | signal := { /* See 24.008 9.3.24 */ |
| 1090 | callref := call_id, |
| 1091 | bearer_cap := omit, |
| 1092 | called := omit, |
| 1093 | calling := omit, |
| 1094 | redirecting := omit, |
| 1095 | connected := omit, |
| 1096 | cause := omit, |
| 1097 | progress := omit, |
| 1098 | useruser := omit, |
| 1099 | facility := omit, |
| 1100 | cccap := omit, |
| 1101 | ssversion := omit, |
| 1102 | clir_sup := 0, |
| 1103 | clir_inv := 0, |
| 1104 | signal := omit, |
| 1105 | keypad := keypad, |
| 1106 | more := 0, |
| 1107 | notify := 0, |
| 1108 | emergency := *, |
| 1109 | imsi := ?, |
| 1110 | lchan_type := ?, |
| 1111 | lchan_mode := ? |
| 1112 | } |
| 1113 | } |
| 1114 | } |
| 1115 | |
| 1116 | /* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */ |
| 1117 | template MNCC_PDU ts_MNCC_START_DTMF_rsp(uint32_t call_id, MNCC_keypad keypad) := { |
| 1118 | msg_type := MNCC_START_DTMF_RSP, |
| 1119 | u := { |
| 1120 | signal := { /* See 24.008 9.3.25 */ |
| 1121 | callref := call_id, |
| 1122 | bearer_cap := omit, |
| 1123 | called := omit, |
| 1124 | calling := omit, |
| 1125 | redirecting := omit, |
| 1126 | connected := omit, |
| 1127 | cause := omit, |
| 1128 | progress := omit, |
| 1129 | useruser := omit, |
| 1130 | facility := omit, |
| 1131 | cccap := omit, |
| 1132 | ssversion := omit, |
| 1133 | clir_sup := 0, |
| 1134 | clir_inv := 0, |
| 1135 | signal := omit, |
| 1136 | keypad := keypad, |
| 1137 | more := 0, |
| 1138 | notify := 0, |
| 1139 | emergency := omit, |
| 1140 | imsi := "", |
| 1141 | lchan_type := 0, |
| 1142 | lchan_mode := 0 |
| 1143 | } |
| 1144 | } |
| 1145 | } |
| 1146 | |
| 1147 | /* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */ |
| 1148 | template MNCC_PDU ts_MNCC_START_DTMF_rej(uint32_t call_id, MNCC_cause cause) := { |
| 1149 | msg_type := MNCC_START_DTMF_REJ, |
| 1150 | u := { |
| 1151 | signal := { /* See 24.008 9.3.26 */ |
| 1152 | callref := call_id, |
| 1153 | bearer_cap := omit, |
| 1154 | called := omit, |
| 1155 | calling := omit, |
| 1156 | redirecting := omit, |
| 1157 | connected := omit, |
| 1158 | cause := cause, |
| 1159 | progress := omit, |
| 1160 | useruser := omit, |
| 1161 | facility := omit, |
| 1162 | cccap := omit, |
| 1163 | ssversion := omit, |
| 1164 | clir_sup := 0, |
| 1165 | clir_inv := 0, |
| 1166 | signal := omit, |
| 1167 | keypad := omit, |
| 1168 | more := 0, |
| 1169 | notify := 0, |
| 1170 | emergency := omit, |
| 1171 | imsi := "", |
| 1172 | lchan_type := 0, |
| 1173 | lchan_mode := 0 |
| 1174 | } |
| 1175 | } |
| 1176 | } |
| 1177 | |
| 1178 | /* : MSC -> MNCC: STOP_DTMF.ind */ |
| 1179 | template MNCC_PDU tr_MNCC_STOP_DTMF_ind(template uint32_t call_id := ?) := |
| 1180 | tr_MNCC_SIMPLE(MNCC_STOP_DTMF_IND, call_id); /* See 24.008 9.3.29 */ |
| 1181 | |
| 1182 | /* : MSC <- MNCC: STOP_DTMF.rsp; Acknowledge stop of DTMF */ |
| 1183 | template MNCC_PDU ts_MNCC_STOP_DTMF_rsp(uint32_t call_id) := |
| 1184 | ts_MNCC_SIMPLE(MNCC_STOP_DTMF_RSP, call_id); /* See 24.008 9.3.30 */ |
| 1185 | |
| 1186 | /* : MSC -> MNCC: MODIFY.ind; request to start MO in-call modification */ |
| 1187 | template MNCC_PDU tr_MNCC_MODIFY_ind(template uint32_t call_id := ?, template MNCC_bearer_cap bcap := ?) := { |
| 1188 | msg_type := MNCC_MODIFY_IND, |
| 1189 | u := { |
| 1190 | signal := { /* See 24.008 9.3.14 */ |
| 1191 | callref := call_id, |
| 1192 | bearer_cap := bcap, |
| 1193 | called := omit, |
| 1194 | calling := omit, |
| 1195 | redirecting := omit, |
| 1196 | connected := omit, |
| 1197 | cause := omit, |
| 1198 | progress := omit, |
| 1199 | useruser := omit, |
| 1200 | facility := omit, |
| 1201 | cccap := omit, |
| 1202 | ssversion := omit, |
| 1203 | clir_sup := 0, |
| 1204 | clir_inv := 0, |
| 1205 | signal := omit, |
| 1206 | keypad := omit, |
| 1207 | more := 0, |
| 1208 | notify := 0, |
| 1209 | emergency := *, |
| 1210 | imsi := ?, |
| 1211 | lchan_type := ?, |
| 1212 | lchan_mode := ? |
| 1213 | } |
| 1214 | } |
| 1215 | } |
| 1216 | |
| 1217 | /* : MSC <- MNCC: MODIFY.rsp; tespond to MO in-call modification */ |
| 1218 | template MNCC_PDU ts_MNCC_MODIFY_rsp(uint32_t call_id, MNCC_bearer_cap bcap) := { |
| 1219 | msg_type := MNCC_MODIFY_RSP, |
| 1220 | u := { |
| 1221 | signal := { /* See 24.008 9.3.14 */ |
| 1222 | callref := call_id, |
| 1223 | bearer_cap := bcap, |
| 1224 | called := omit, |
| 1225 | calling := omit, |
| 1226 | redirecting := omit, |
| 1227 | connected := omit, |
| 1228 | cause := omit, |
| 1229 | progress := omit, |
| 1230 | useruser := omit, |
| 1231 | facility := omit, |
| 1232 | cccap := omit, |
| 1233 | ssversion := omit, |
| 1234 | clir_sup := 0, |
| 1235 | clir_inv := 0, |
| 1236 | signal := omit, |
| 1237 | keypad := omit, |
| 1238 | more := 0, |
| 1239 | notify := 0, |
| 1240 | emergency := omit, |
| 1241 | imsi := "", |
| 1242 | lchan_type := 0, |
| 1243 | lchan_mode := 0 |
| 1244 | } |
| 1245 | } |
| 1246 | } |
| 1247 | |
| 1248 | /* : MSC <- MNCC: MODIFY.req; request to start MT in-call modification */ |
| 1249 | template MNCC_PDU ts_MNCC_MODIFY_req(uint32_t call_id, MNCC_bearer_cap bcap) := { |
| 1250 | msg_type := MNCC_MODIFY_REQ, |
| 1251 | u := { |
| 1252 | signal := { /* See 24.008 9.3.14 */ |
| 1253 | callref := call_id, |
| 1254 | bearer_cap := bcap, |
| 1255 | called := omit, |
| 1256 | calling := omit, |
| 1257 | redirecting := omit, |
| 1258 | connected := omit, |
| 1259 | cause := omit, |
| 1260 | progress := omit, |
| 1261 | useruser := omit, |
| 1262 | facility := omit, |
| 1263 | cccap := omit, |
| 1264 | ssversion := omit, |
| 1265 | clir_sup := 0, |
| 1266 | clir_inv := 0, |
| 1267 | signal := omit, |
| 1268 | keypad := omit, |
| 1269 | more := 0, |
| 1270 | notify := 0, |
| 1271 | emergency := omit, |
| 1272 | imsi := "", |
| 1273 | lchan_type := 0, |
| 1274 | lchan_mode := 0 |
| 1275 | } |
| 1276 | } |
| 1277 | } |
| 1278 | |
| 1279 | /* : MSC -> MNCC: MODIFY.cnf; MS has responded to MT in-call modification */ |
| 1280 | template MNCC_PDU tr_MNCC_MODIFY_cnf(template uint32_t call_id := ?, |
| 1281 | template MNCC_bearer_cap bcap := ?) := { |
| 1282 | msg_type := MNCC_MODIFY_CNF, |
| 1283 | u := { |
| 1284 | signal := { /* See 24.008 9.3.14 */ |
| 1285 | callref := call_id, |
| 1286 | bearer_cap := bcap, |
| 1287 | called := omit, |
| 1288 | calling := omit, |
| 1289 | redirecting := omit, |
| 1290 | connected := omit, |
| 1291 | cause := omit, |
| 1292 | progress := omit, |
| 1293 | useruser := omit, |
| 1294 | facility := omit, |
| 1295 | cccap := omit, |
| 1296 | ssversion := omit, |
| 1297 | clir_sup := 0, |
| 1298 | clir_inv := 0, |
| 1299 | signal := omit, |
| 1300 | keypad := omit, |
| 1301 | more := 0, |
| 1302 | notify := 0, |
| 1303 | emergency := *, |
| 1304 | imsi := ?, |
| 1305 | lchan_type := ?, |
| 1306 | lchan_mode := ? |
| 1307 | } |
| 1308 | } |
| 1309 | } |
| 1310 | |
| 1311 | /* : MSC <- MNCC: Request transmission of USERINFO to MS */ |
| 1312 | template MNCC_PDU ts_MNCC_USERINFO_req(uint32_t call_id, MNCC_useruser uu, integer more) := { |
| 1313 | msg_type := MNCC_USERINFO_REQ, |
| 1314 | u := { |
| 1315 | signal := { /* See 24.008 9.3.31 */ |
| 1316 | callref := call_id, |
| 1317 | bearer_cap := omit, |
| 1318 | called := omit, |
| 1319 | calling := omit, |
| 1320 | redirecting := omit, |
| 1321 | connected := omit, |
| 1322 | cause := omit, |
| 1323 | progress := omit, |
| 1324 | useruser := uu, |
| 1325 | facility := omit, |
| 1326 | cccap := omit, |
| 1327 | ssversion := omit, |
| 1328 | clir_sup := 0, |
| 1329 | clir_inv := 0, |
| 1330 | signal := omit, |
| 1331 | keypad := omit, |
| 1332 | more := more, |
| 1333 | notify := 0, |
| 1334 | emergency := omit, |
| 1335 | imsi := "", |
| 1336 | lchan_type := 0, |
| 1337 | lchan_mode := 0 |
| 1338 | } |
| 1339 | } |
| 1340 | } |
| 1341 | |
| 1342 | /* : MSC -> MNCC: Indicate reception of USERINFO from MS */ |
| 1343 | template MNCC_PDU tr_MNCC_USERINFO_ind(template uint32_t call_id := ?, template MNCC_useruser uu := ?, |
| 1344 | integer more) := { |
| 1345 | msg_type := MNCC_USERINFO_IND, |
| 1346 | u := { |
| 1347 | signal := { /* See 24.008 9.3.31 */ |
| 1348 | callref := call_id, |
| 1349 | bearer_cap := omit, |
| 1350 | called := omit, |
| 1351 | calling := omit, |
| 1352 | redirecting := omit, |
| 1353 | connected := omit, |
| 1354 | cause := omit, |
| 1355 | progress := omit, |
| 1356 | useruser := uu, |
| 1357 | facility := omit, |
| 1358 | cccap := omit, |
| 1359 | ssversion := omit, |
| 1360 | clir_sup := 0, |
| 1361 | clir_inv := 0, |
| 1362 | signal := omit, |
| 1363 | keypad := omit, |
| 1364 | more := more, |
| 1365 | notify := 0, |
| 1366 | emergency := omit, |
| 1367 | imsi := "", |
| 1368 | lchan_type := 0, |
| 1369 | lchan_mode := 0 |
| 1370 | } |
| 1371 | } |
| 1372 | } |
| 1373 | |
| 1374 | /* : MSC -> MNCC: HOLD.ind; MS requests hold of call */ |
| 1375 | template MNCC_PDU tr_MNCC_HOLD_ind(template uint32_t call_id := ?) := |
| 1376 | tr_MNCC_SIMPLE(MNCC_HOLD_IND, call_id); /* See 24.008 9.3.10 */ |
| 1377 | |
| 1378 | /* : MSC <- MNCC: HOLD.cnf; network confirms hold of call */ |
| 1379 | template MNCC_PDU ts_MNCC_HOLD_cnf(uint32_t call_id) := |
| 1380 | ts_MNCC_SIMPLE(MNCC_HOLD_CNF, call_id); /* See 24.008 9.3.11 */ |
| 1381 | |
| 1382 | /* : MSC <- MNCC: HOLD.rej; network rejects hold of call */ |
| 1383 | template MNCC_PDU ts_MNCC_HOLD_rej(uint32_t call_id, MNCC_cause cause) := { |
| 1384 | msg_type := MNCC_HOLD_REJ, |
| 1385 | u := { |
| 1386 | signal := { /* See 24.008 9.3.12 */ |
| 1387 | callref := call_id, |
| 1388 | bearer_cap := omit, |
| 1389 | called := omit, |
| 1390 | calling := omit, |
| 1391 | redirecting := omit, |
| 1392 | connected := omit, |
| 1393 | cause := cause, |
| 1394 | progress := omit, |
| 1395 | useruser := omit, |
| 1396 | facility := omit, |
| 1397 | cccap := omit, |
| 1398 | ssversion := omit, |
| 1399 | clir_sup := 0, |
| 1400 | clir_inv := 0, |
| 1401 | signal := omit, |
| 1402 | keypad := omit, |
| 1403 | more := 0, |
| 1404 | notify := 0, |
| 1405 | emergency := omit, |
| 1406 | imsi := "", |
| 1407 | lchan_type := 0, |
| 1408 | lchan_mode := 0 |
| 1409 | } |
| 1410 | } |
| 1411 | } |
| 1412 | |
| 1413 | /* : MSC -> MNCC: RETRIEVE.ind; MS requests retrieval of held call */ |
| 1414 | template MNCC_PDU tr_MNCC_RETRIEVE_ind(template uint32_t call_id := ?) := |
| 1415 | tr_MNCC_SIMPLE(MNCC_RETRIEVE_IND, call_id); /* See 24.008 9.3.20 */ |
| 1416 | |
| 1417 | /* : MSC <- MNCC: RETRIEVE.cnf; network confirms retrieve of call */ |
| 1418 | template MNCC_PDU ts_MNCC_RETRIEVE_cnf(uint32_t call_id) := |
| 1419 | ts_MNCC_SIMPLE(MNCC_RETRIEVE_CNF, call_id); /* See 24.008 9.3.21 */ |
| 1420 | |
| 1421 | /* : MSC <- MNCC: RETRIEVE.rej; network rejects retrieve of call */ |
| 1422 | template MNCC_PDU ts_MNCC_RETRIEVE_rej(uint32_t call_id, MNCC_cause cause) |
| 1423 | modifies ts_MNCC_HOLD_rej := { /* See 24.008 9.3.22 */ |
| 1424 | msg_type := MNCC_RETRIEVE_REJ |
| 1425 | } |
| 1426 | |
| 1427 | |
| 1428 | template MNCC_PDU ts_MNCC_SIMPLE_RTP(MNCC_MsgType msg_type, uint32_t call_id) := { |
| 1429 | msg_type := msg_type, |
| 1430 | u := { |
| 1431 | rtp := { |
| 1432 | callref := call_id, |
| 1433 | ip := 0, |
| 1434 | rtp_port := 0, |
| 1435 | payload_type := 0, |
| 1436 | payload_msg_type := 0 |
| 1437 | } |
| 1438 | } |
| 1439 | } |
| 1440 | |
| 1441 | /* MSC <- MNCC: RTP_CREATE.req; request creation of RTP */ |
| 1442 | template MNCC_PDU ts_MNCC_RTP_CREATE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_CREATE, call_id); |
| 1443 | |
| 1444 | /* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side IP/Port) */ |
| 1445 | template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?) := { |
| 1446 | msg_type := MNCC_RTP_CREATE, |
| 1447 | u := { |
| 1448 | rtp := { |
| 1449 | callref := call_id, |
| 1450 | ip := ?, |
| 1451 | rtp_port := ?, |
| 1452 | payload_type := ?, |
| 1453 | payload_msg_type := ? |
| 1454 | } |
| 1455 | } |
| 1456 | } |
| 1457 | |
| 1458 | /* MSC <- MNCC: RTP_CONNECT.req; request connect of RTP */ |
| 1459 | template MNCC_PDU ts_MNCC_RTP_CONNECT(uint32_t call_id, uint32_t ip, uint32_t rtp_port, uint32_t pt) := { |
| 1460 | msg_type := MNCC_RTP_CONNECT, |
| 1461 | u := { |
| 1462 | rtp := { |
| 1463 | callref := call_id, |
| 1464 | ip := ip, |
| 1465 | rtp_port := rtp_port, |
| 1466 | payload_type := pt, |
| 1467 | payload_msg_type := 0 |
| 1468 | } |
| 1469 | } |
| 1470 | } |
| 1471 | |
| 1472 | /* MSC <- MNCC: RTP_FREE.req; request connect of RTP */ |
| 1473 | template MNCC_PDU ts_MNCC_RTP_FREE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_FREE, call_id); |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 1474 | |
Harald Welte | 251b52b | 2018-01-17 13:58:16 +0100 | [diff] [blame] | 1475 | function f_mncc_get_call_id(MNCC_PDU pdu) return uint32_t { |
| 1476 | if (ischosen(pdu.u.rtp)) { |
| 1477 | return pdu.u.rtp.callref; |
| 1478 | } else if (ischosen(pdu.u.data)) { |
| 1479 | return pdu.u.data.callref; |
| 1480 | } else if (ischosen(pdu.u.signal)) { |
| 1481 | return pdu.u.signal.callref; |
| 1482 | } else { |
| 1483 | setverdict(fail, "Unable to determine Callref for MNCC", pdu); |
| 1484 | self.stop |
| 1485 | } |
| 1486 | } |
| 1487 | |
Harald Welte | 474fd7d | 2017-12-29 16:01:39 +0100 | [diff] [blame] | 1488 | } with { encode "RAW" ; variant "FIELDORDER(msb)" } |