lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2023

  • 1 participants
  • 2601 discussions
[S] Change in libosmocore[master]: gsm0808_enc/dec_channel_type: fix transparent flag
by osmith 27 Feb '23

27 Feb '23
osmith has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31536 ) Change subject: gsm0808_enc/dec_channel_type: fix transparent flag ...................................................................... gsm0808_enc/dec_channel_type: fix transparent flag According to 3GPP TS 48.008 3.2.2.11, it is inverted. 0: Transparent service 1: Non-transparent service Change-Id: I2e5786ad053ee871079b4a8d95caccd6b03b59b6 --- M src/gsm/gsm0808_utils.c M tests/gsm0808/gsm0808_test.c 2 files changed, 21 insertions(+), 7 deletions(-) Approvals: fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index d8c275a..efa9305 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -510,7 +510,7 @@ case GSM0808_CHAN_DATA: byte = ct->data_rate; - if (ct->data_transparent) + if (!ct->data_transparent) byte |= 0x40; /* Set T/NT */ if (ct->data_rate_allowed_is_set) { @@ -580,7 +580,7 @@ case GSM0808_CHAN_DATA: byte = *elem; elem++; - ct->data_transparent = byte & 0x40; /* T/NT */ + ct->data_transparent = !(byte & 0x40); /* T/NT */ ct->data_rate = byte & 0x3f; /* Optional extension for non-transparent service */ diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 9a6de1e..d7c278f 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -1098,7 +1098,7 @@ struct gsm0808_channel_type dec_ct = {}; struct msgb *msg; uint8_t ct_enc_expected[] = { GSM0808_IE_CHANNEL_TYPE, - 0x03, 0x02, 0x0b, 0x51, + 0x03, 0x02, 0x0b, 0x11, }; uint8_t rc_enc; int rc_dec; @@ -1142,7 +1142,7 @@ struct gsm0808_channel_type dec_ct = {}; struct msgb *msg; uint8_t ct_enc_expected[] = { GSM0808_IE_CHANNEL_TYPE, - 0x05, 0x02, 0x0b, 0x91, 0x8b, 0x20, + 0x05, 0x02, 0x0b, 0xd1, 0x8b, 0x20, }; uint8_t rc_enc; int rc_dec; @@ -1237,17 +1237,17 @@ OSMO_ASSERT(rc == -ENOTSUP); /* Data: ext in Octet 5 with transparent service */ - const uint8_t hex2[] = { 0x02, 0x0b, 0xc0, 0x00 }; + const uint8_t hex2[] = { 0x02, 0x0b, 0x80, 0x00 }; rc = gsm0808_dec_channel_type(&ct, hex2, sizeof(hex2)); OSMO_ASSERT(rc == -EINVAL); /* Data: ext in Octet 5, but too short */ - const uint8_t hex3[] = { 0x02, 0x0b, 0x80 }; + const uint8_t hex3[] = { 0x02, 0x0b, 0xc0 }; rc = gsm0808_dec_channel_type(&ct, hex3, sizeof(hex3)); OSMO_ASSERT(rc == -EOVERFLOW); /* Data: ext in Octet 5a, but too short */ - const uint8_t hex4[] = { 0x02, 0x0b, 0x80, 0x80 }; + const uint8_t hex4[] = { 0x02, 0x0b, 0xc0, 0x80 }; rc = gsm0808_dec_channel_type(&ct, hex4, sizeof(hex4)); OSMO_ASSERT(rc == -EOVERFLOW); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31536 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I2e5786ad053ee871079b4a8d95caccd6b03b59b6 Gerrit-Change-Number: 31536 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: gsm0808_enc/dec_channel_type: fix transparent flag
by fixeria 27 Feb '23

27 Feb '23
Attention is currently required from: osmith. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31536 ) Change subject: gsm0808_enc/dec_channel_type: fix transparent flag ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31536 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I2e5786ad053ee871079b4a8d95caccd6b03b59b6 Gerrit-Change-Number: 31536 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 27 Feb 2023 13:42:49 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: TC_assignment_csd: expect BSC to handle CSD
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31557 ) Change subject: TC_assignment_csd: expect BSC to handle CSD ...................................................................... TC_assignment_csd: expect BSC to handle CSD Related: OS#4393 Change-Id: Iff19dc704af09d09d2265d8da38fc745a3936ce4 --- M bsc/BSC_Tests.ttcn M library/BSSMAP_Templates.ttcn 2 files changed, 51 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/31557/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 965873e..f6f1219 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1837,13 +1837,40 @@ } return dt; } -testcase TC_assignment_csd() runs on test_CT { - var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail; + +private function f_tc_assignment_csd(charstring id) runs on MSC_ConnHdlr { + var template PDU_BSSAP exp_compl := f_gen_exp_compl(); var PDU_BSSAP ass_cmd := f_gen_ass_req(); + var octetstring oct5; + ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCSD); - //exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7); - var DchanTuple dt := f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for CSD"); - f_perform_clear_test_ct(dt); + ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecCSData})); + + /* See 3GPP TS 48.008 § 3.2.2.11 Channel Type, octet 5 */ + oct5 := bit2oct('00010001'B); /* 4800 bps / transparent */ + ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := oct5; + + f_establish_fully(ass_cmd, exp_compl); + f_perform_clear(); +} +testcase TC_assignment_csd() runs on test_CT { + if (Misc_Helpers.f_osmo_repo_is("nightly")) { /* osmo-bsc > 1.10.0 */ + var MSC_ConnHdlr vc_conn; + var TestHdlrParams pars := f_gen_test_hdlr_pars(); + pars.encr := valueof(t_EncrParams('01'O, f_rnd_octstring(8))); + + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_assignment_csd), pars); + vc_conn.done; + } else { + var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail; + var PDU_BSSAP ass_cmd := f_gen_ass_req(); + ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCSD); + //exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7); + var DchanTuple dt := f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for CSD"); + f_perform_clear_test_ct(dt); + } f_shutdown_helper(); } diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 1eebb02..cbf1981 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -603,6 +603,15 @@ codecType := FR_AMR_WB, s0_7 := '00000001'B } +template (value) BSSMAP_FIELD_CodecElement ts_CodecCSData modifies ts_CodecBase := { + codecType := CodecExtension, + tF := '0'B, /* Spare */ + pT := '0'B, /* CSDoTDM */ + pI := '1'B, /* CSDoIP */ + fI := '0'B, /* Spare */ + extendedCodecType := 'FD'O, /* CSData */ + s0_7 := '00000000'B /* R2, R3, Spare */ +} template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := { elementIdentifier := '7D'O, lengthIndicator := 0, /* overwritten */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31557 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Iff19dc704af09d09d2265d8da38fc745a3936ce4 Gerrit-Change-Number: 31557 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: library/RSL_Types: RSL_SpeechAlgo: support CSD
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31556 ) Change subject: library/RSL_Types: RSL_SpeechAlgo: support CSD ...................................................................... library/RSL_Types: RSL_SpeechAlgo: support CSD Add data rates from 3GPP TS 48.058 § 9.3.6 octet 6 to the enum, and rename it from RSL_SpeechAlgo to RSL_SpeechAlgoDataRate so it's clear that it contains both. Rename RSL_CMOD_SP_GSM3 to RSL_CMOD_SP_GSM3_DT_NT1 and RSL_CMOD_SP_GSM4 to RSL_CMOD_SP_GSM4_DT_NT8 because their values are shared between a speech and a data entry. Related: OS#4393 Change-Id: Ief2d95c7e9d71afb26fa74da755294226c8e158d --- M bsc/BSC_Tests.ttcn M bts/BTS_Tests.ttcn M bts/BTS_Tests_VAMOS.ttcn M library/RSL_Types.ttcn 4 files changed, 70 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/31556/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index b9182e3..965873e 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -4273,12 +4273,12 @@ } } case (FR_AMR) { - if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3))) { + if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3_DT_NT1))) { return true; } } case (HR_AMR) { - if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3))) { + if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3_DT_NT1))) { return true; } } @@ -4361,11 +4361,11 @@ } case (FR_AMR) { mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F; - mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3; + mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3_DT_NT1; } case (HR_AMR) { mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_H; - mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3; + mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3_DT_NT1; } } return mode_ie; diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 1859eed..54c27a2 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -871,7 +871,7 @@ ch_act.ies := ch_act.ies & { valueof(t_RSL_IE(RSL_IE_ENCR_INFO, RSL_IE_Body:{encr_info := encr_info})) }; } - if (mode.coding_alg_rate == RSL_CMOD_SP_GSM3) { + if (mode.coding_alg_rate == RSL_CMOD_SP_GSM3_DT_NT1) { ch_act.ies := ch_act.ies & { valueof(t_RSL_IE(RSL_IE_MR_CONFIG, RSL_IE_Body:{multirate_cfg := g_pars.mr_conf})) }; } @@ -2546,7 +2546,7 @@ case (RSL_CMOD_NO_RESOURCE) { tch_mode := L1CTL_CHAN_MODE_SIGN; } case (RSL_CMOD_SP_GSM1) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V1; } case (RSL_CMOD_SP_GSM2) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V2; } - case (RSL_CMOD_SP_GSM3) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V3; + case (RSL_CMOD_SP_GSM3_DT_NT1) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V3; amr_codecs_bitmask := g_pars.mr_conf.codec_modes; } case else { @@ -2611,13 +2611,13 @@ { payload_len := 15; hdr := '00'O; } case (tr_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM2)) /* TCH/EFS */ { payload_len := 31; hdr := 'C0'O; } - case (tr_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3)) /* TCH/AFS */ + case (tr_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3_DT_NT1)) /* TCH/AFS */ { var integer amr_ft := get_start_amr_ft(); payload_len := f_amrft_payload_len(amr_ft) + 2; hdr := enc_RTP_AMR_Hdr(valueof(ts_RTP_AMR_Hdr(amr_ft, amr_ft, '1'B))); } - case (tr_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3)) /* TCH/AHS */ + case (tr_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3_DT_NT1)) /* TCH/AHS */ { var integer amr_ft := get_start_amr_ft(); payload_len := f_amrft_payload_len(amr_ft) + 2; @@ -8312,7 +8312,7 @@ vc_conn.done; /* TS1, TCH/F, V3 (AMR codec) */ - pars := valueof(t_Pars(ts_RslChanNr_Bm(1), ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3))); + pars := valueof(t_Pars(ts_RslChanNr_Bm(1), ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3_DT_NT1))); pars.mr_conf := valueof(ts_RSL_MultirateCfg); vc_conn := f_start_handler(refers(f_TC_speech_rtp), pars); vc_conn.done; @@ -8331,7 +8331,7 @@ vc_conn.done; /* TS1, TCH/H0, V3 (AMR codec) */ - pars := valueof(t_Pars(ts_RslChanNr_Lm(5, 0), ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3))); + pars := valueof(t_Pars(ts_RslChanNr_Lm(5, 0), ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3_DT_NT1))); pars.mr_conf := valueof(ts_RSL_MultirateCfg); vc_conn := f_start_handler(refers(f_TC_speech_rtp), pars); vc_conn.done; @@ -8431,7 +8431,7 @@ f_init(); /* TS5, TCH/H0, V3 (AMR codec) */ - pars := valueof(t_Pars(ts_RslChanNr_Bm(1), ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3))); + pars := valueof(t_Pars(ts_RslChanNr_Bm(1), ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3_DT_NT1))); pars.mr_conf := valueof(ts_RSL_MultirateCfg); vc_conn := f_start_handler(refers(f_TC_speech_osmux), pars); vc_conn.done; @@ -8445,7 +8445,7 @@ f_init(); /* TS5, TCH/H0, V3 (AMR codec) */ - pars := valueof(t_Pars(ts_RslChanNr_Lm(5, 0), ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3))); + pars := valueof(t_Pars(ts_RslChanNr_Lm(5, 0), ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3_DT_NT1))); pars.mr_conf := valueof(ts_RSL_MultirateCfg); vc_conn := f_start_handler(refers(f_TC_speech_osmux), pars); vc_conn.done; diff --git a/bts/BTS_Tests_VAMOS.ttcn b/bts/BTS_Tests_VAMOS.ttcn index 2d03411..a71a047 100644 --- a/bts/BTS_Tests_VAMOS.ttcn +++ b/bts/BTS_Tests_VAMOS.ttcn @@ -57,13 +57,13 @@ { ts_RslChanNr_Bm(tn), /* V0(TCH/F), EFR codec */ ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM2) }, { ts_RslChanNr_Osmo_VAMOS_Bm(tn), /* V1(TCH/F), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3) } + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) } }, { { ts_RslChanNr_Bm(tn), /* V0(TCH/F), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3) }, + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) }, { ts_RslChanNr_Osmo_VAMOS_Bm(tn), /* V1(TCH/F), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3) } + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) } } }; @@ -94,7 +94,7 @@ { ts_RslChanNr_Lm(tn, 0), /* V0(TCH/H0), HR codec */ ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM1) }, { ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }, + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) }, { ts_RslChanNr_Osmo_VAMOS_Lm(tn, 0), /* V1(TCH/H0), signalling */ ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) }, { ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), signalling */ @@ -102,13 +102,13 @@ }, { { ts_RslChanNr_Lm(tn, 0), /* V0(TCH/H0), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }, + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) }, { ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }, + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) }, { ts_RslChanNr_Osmo_VAMOS_Lm(tn, 0), /* V1(TCH/H0), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }, + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) }, { ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) } + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) } } }; @@ -127,9 +127,9 @@ { ts_RslChanNr_Lm(tn, 0), /* TCH/H0, signalling */ ts_RSL_ChanMode_SIGN(RSL_CHRT_TCH_H) }, { ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }, + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) }, { ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) } + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) } }, { { ts_RslChanNr_Lm(tn, 0), /* TCH/H0, HR codec */ @@ -137,15 +137,15 @@ { ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), HR codec */ ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM1) }, { ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) } + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) } }, { { ts_RslChanNr_Lm(tn, 0), /* TCH/H0, AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3) }, + ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3_DT_NT1) }, { ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }, + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) }, { ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), AMR codec */ - ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) } + ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3_DT_NT1) } } }; @@ -174,7 +174,7 @@ for (var integer ch := 0; ch < lengthof(test[i]); ch := ch + 1) { pars[ch] := valueof(t_Pars(test[i][ch].chan_nr, test[i][ch].chan_mode)); - if (test[i][ch].chan_mode.coding_alg_rate == RSL_CMOD_SP_GSM3) { + if (test[i][ch].chan_mode.coding_alg_rate == RSL_CMOD_SP_GSM3_DT_NT1) { pars[ch].mr_conf := valueof(ts_RSL_MultirateCfg); } vc_conn[ch] := f_start_handler(handler, pars[ch], l1ctl := false); diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index cad8a34..085784c 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -386,14 +386,30 @@ RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B), RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B) } with { variant "FIELDLENGTH(8)" }; - type enumerated RSL_SpeechAlgo { + type enumerated RSL_SpeechAlgoDataRate { RSL_CMOD_NO_RESOURCE ('00000000'B), RSL_CMOD_SP_GSM1 ('00000001'B), RSL_CMOD_SP_GSM2 ('00010001'B), - RSL_CMOD_SP_GSM3 ('00100001'B), - RSL_CMOD_SP_GSM4 ('00110001'B), + RSL_CMOD_SP_GSM3_DT_NT1 ('00100001'B), + RSL_CMOD_SP_GSM4_DT_NT8 ('00110001'B), RSL_CMOD_SP_GSM5 ('00001001'B), - RSL_CMOD_SP_GSM6 ('00001101'B) + RSL_CMOD_SP_GSM6 ('00001101'B), + RSL_CMOD_DT_NT2 ('00100010'B), + RSL_CMOD_DT_NT3 ('00100011'B), + RSL_CMOD_DT_NT4 ('00101001'B), + RSL_CMOD_DT_NT5 ('00101010'B), + RSL_CMOD_DT_NT6 ('00101011'B), + RSL_CMOD_DT_NT7 ('00110100'B), + RSL_CMOD_DT_NT9 ('00011000'B), + RSL_CMOD_DT_T1 ('01111000'B), + RSL_CMOD_DT_T2 ('01111001'B), + RSL_CMOD_DT_T3 ('01011000'B), + RSL_CMOD_DT_T4 ('01010000'B), + RSL_CMOD_DT_T5 ('01010001'B), + RSL_CMOD_DT_T6 ('01010010'B), + RSL_CMOD_DT_T7 ('01010011'B), + RSL_CMOD_DT_T8 ('01010100'B), + RSL_CMOD_DT_T9 ('01010101'B) } with { variant "FIELDLENGTH(8)" }; type record RSL_IE_ChannelMode { uint8_t len, @@ -402,7 +418,7 @@ boolean dtx_u, RSL_SpeechDataInd spd_ind, RSL_ChanRateType ch_rate_type, - RSL_SpeechAlgo coding_alg_rate + RSL_SpeechAlgoDataRate coding_alg_rate } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" } template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH, @@ -416,7 +432,7 @@ coding_alg_rate := RSL_CMOD_NO_RESOURCE } - template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg, + template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgoDataRate alg_rate, boolean dtx_downlink := false) := { len := 0, /* overwritten */ reserved := '000000'B, @@ -424,17 +440,17 @@ dtx_u := false, spd_ind := RSL_SPDI_SPEECH, ch_rate_type := t, - coding_alg_rate := alg + coding_alg_rate := alg_rate } template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t, - template RSL_SpeechAlgo alg) := { + template RSL_SpeechAlgoDataRate alg_rate) := { len := ?, reserved := '000000'B, dtx_d := ?, dtx_u := ?, spd_ind := RSL_SPDI_SPEECH, ch_rate_type := t, - coding_alg_rate := alg + coding_alg_rate := alg_rate } /* 9.3.4 BS Power IE */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31556 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ief2d95c7e9d71afb26fa74da755294226c8e158d Gerrit-Change-Number: 31556 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: chan_mode_to_mgcp_codec: support CSD
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31554 ) Change subject: chan_mode_to_mgcp_codec: support CSD ...................................................................... chan_mode_to_mgcp_codec: support CSD Related: OS#4393 Change-Id: Ib5876ee4dac9e8000cc3ae0c5dd87aae3d723829 --- M src/osmo-bsc/lchan_rtp_fsm.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/54/31554/1 diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index d128463..c658d00 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -852,6 +852,12 @@ static enum mgcp_codecs chan_mode_to_mgcp_codec(enum gsm48_chan_mode chan_mode, bool full_rate) { switch (gsm48_chan_mode_to_non_vamos(chan_mode)) { + case GSM48_CMODE_DATA_14k5: + case GSM48_CMODE_DATA_12k0: + case GSM48_CMODE_DATA_6k0: + case GSM48_CMODE_DATA_3k6: + return CODEC_CLEARMODE; + case GSM48_CMODE_SPEECH_V1: if (full_rate) return CODEC_GSM_8000_1; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31554 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ib5876ee4dac9e8000cc3ae0c5dd87aae3d723829 Gerrit-Change-Number: 31554 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: Cosmetic: channel_mode_from_lchan: remove fixme
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31555 ) Change subject: Cosmetic: channel_mode_from_lchan: remove fixme ...................................................................... Cosmetic: channel_mode_from_lchan: remove fixme Remove the FIXME comment, as the function handles CSD now. Related: OS#4393 Change-Id: Ic074cb814662d73f52d4401d1cf9cdbf682040a9 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/55/31555/1 diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index ae0bf31..08f3134 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -410,7 +410,6 @@ int rc; memset(cm, 0, sizeof(*cm)); - /* FIXME: what to do with data calls ? */ cm->dtx_dtu = 0; if (lchan->ts->trx->bts->dtxu != GSM48_DTX_SHALL_NOT_BE_USED) cm->dtx_dtu |= RSL_CMOD_DTXu; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31555 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ic074cb814662d73f52d4401d1cf9cdbf682040a9 Gerrit-Change-Number: 31555 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: Cosmetic: codec_pref: tweak comments
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31540 ) Change subject: Cosmetic: codec_pref: tweak comments ...................................................................... Cosmetic: codec_pref: tweak comments Remove "Helper function for match_codec_pref()" at the beginning of the descriptions of these functions, looks like a leftover from before this was moved to its own c file. Remove a duplicated "received" in a comment. Change-Id: I30f0744db9aebf2f05077fef840097c332b9dafd --- M src/osmo-bsc/codec_pref.c 1 file changed, 23 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/40/31540/1 diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index 3824e14..a64425a 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -61,8 +61,7 @@ return 0; } -/* Helper function for match_codec_pref(), looks up a matching chan mode for - * a given permitted speech value */ +/* Look up a matching chan mode for a given permitted speech value */ static enum gsm48_chan_mode gsm88_to_chan_mode(enum gsm0808_permitted_speech speech) { switch (speech) { @@ -88,8 +87,7 @@ } } -/* Helper function for match_codec_pref(), looks up a matching permitted speech - * value for a given msc audio codec pref */ +/* Look up a matching permitted speech value for a given msc audio codec pref */ static enum gsm0808_permitted_speech audio_support_to_gsm88(const struct gsm_audio_support *audio) { if (audio->hr) { @@ -125,10 +123,9 @@ } } -/* Helper function for match_codec_pref(), tests if a given audio support - * matches one of the permitted speech settings of the channel type element. - * The matched permitted speech value is then also compared against the - * speech codec list. (optional, only relevant for AoIP) */ +/* Test if a given audio support matches one of the permitted speech settings + * of the channel type element. The matched permitted speech value is then also + * compared against the speech codec list. (optional, only relevant for AoIP) */ static bool test_codec_pref(const struct gsm0808_speech_codec **sc_match, const struct gsm0808_speech_codec_list *scl, const struct gsm0808_channel_type *ct, @@ -177,8 +174,8 @@ return false; } -/* Helper function to check if the given permitted speech value is supported - * by the BTS. (vty option bts->codec-support). */ +/* Check if the given permitted speech value is supported by the BTS + * (vty option bts->codec-support). */ static bool test_codec_support_bts(const struct gsm_bts *bts, uint8_t perm_spch) { struct gsm_bts_trx *trx; @@ -308,8 +305,8 @@ return 0; } -/*! Match the codec preferences from local config with a received codec preferences IEs received from the - * MSC and the BTS' codec configuration. +/*! Match the codec preferences from local config with codec preference IEs + * received from the MSC and the BTS' codec configuration. * \param[out] ch_mode_rate resulting codec and rate information * \param[in] ct GSM 08.08 channel type received from MSC. * \param[in] scl GSM 08.08 speech codec list received from MSC (optional). -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31540 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I30f0744db9aebf2f05077fef840097c332b9dafd Gerrit-Change-Number: 31540 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: Cosmetic: fix various typos
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31539 ) Change subject: Cosmetic: fix various typos ...................................................................... Cosmetic: fix various typos Change-Id: I9225e733e3afa8171f24253e21eaffc654f689af --- M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/codec_pref.c 2 files changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/39/31539/1 diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index e2213d4..d382f10 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -389,7 +389,7 @@ return 0; } -/* Check if the incoming assignment requests requires a voice stream or not, +/* Check if the incoming assignment request requires a voice stream or not, * we will look at the preferred and the alternate channel mode and also make * sure that both are consistent. */ static int check_requires_voice_stream(struct gsm_subscriber_connection *conn) diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index 9b4b37f..3824e14 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -376,7 +376,7 @@ break; } - /* Exit without result, in case no match can be deteched */ + /* Exit without result, in case no match can be detected */ if (!match) { ch_mode_rate->chan_mode = GSM48_CMODE_SIGN; ch_mode_rate->chan_rate = CH_RATE_SDCCH; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31539 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I9225e733e3afa8171f24253e21eaffc654f689af Gerrit-Change-Number: 31539 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in osmo-bsc[master]: bssmap_handle_assignm_req: split up
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31541 ) Change subject: bssmap_handle_assignm_req: split up ...................................................................... bssmap_handle_assignm_req: split up Prepare to implement GSM0808_CHAN_DATA without making this function even longer. Related: OS#4393 Change-Id: I8580e75e292cff1b52b6ba1bafd12c155c3bbe93 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 157 insertions(+), 123 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/41/31541/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 6e78f47..d0ff1cf 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -796,6 +796,148 @@ return nc > 0 ? 0 : -EINVAL; } +static int bssmap_handle_ass_req_ct_speech(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, + struct gsm0808_channel_type *ct, struct assignment_request *req, + uint8_t *cause) +{ + uint16_t cic = 0; + bool aoip = gscon_is_aoip(conn); + bool use_osmux = false; + uint8_t osmux_cid = 0; + struct sockaddr_storage rtp_addr; + int rc; + + if (TLVP_PRESENT(tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)) { + /* CIC is permitted in both AoIP and SCCPlite */ + cic = osmo_load16be(TLVP_VAL(tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)); + } else { + if (!aoip) { + /* no CIC but SCCPlite: illegal */ + LOGP(DMSC, LOGL_ERROR, "SCCPlite MSC, but no CIC in ASSIGN REQ?\n"); + *cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; + return -1; + } + } + if (TLVP_PRESENT(tp, GSM0808_IE_AOIP_TRASP_ADDR)) { + if (!aoip) { + /* SCCPlite and AoIP transport address: illegal */ + LOGP(DMSC, LOGL_ERROR, "AoIP Transport address over IPA ?!?\n"); + *cause = GSM0808_CAUSE_INCORRECT_VALUE; + return -1; + } + /* Decode AoIP transport address element */ + rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, + TLVP_VAL(tp, GSM0808_IE_AOIP_TRASP_ADDR), + TLVP_LEN(tp, GSM0808_IE_AOIP_TRASP_ADDR)); + if (rc < 0) { + LOGP(DMSC, LOGL_ERROR, "Unable to decode AoIP transport address.\n"); + *cause = GSM0808_CAUSE_INCORRECT_VALUE; + return -1; + } + } else if (aoip) { + /* no AoIP transport level address but AoIP transport: illegal */ + LOGP(DMSC, LOGL_ERROR, "AoIP transport address missing in ASSIGN REQ, " + "audio would not work; rejecting\n"); + *cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; + return -1; + } + + if (TLVP_PRESENT(tp, GSM0808_IE_OSMO_OSMUX_CID)) { + if (conn->sccp.msc->use_osmux == OSMUX_USAGE_OFF) { + LOGP(DMSC, LOGL_ERROR, "MSC using Osmux but we have it disabled.\n"); + *cause = GSM0808_CAUSE_INCORRECT_VALUE; + return -1; + } + use_osmux = true; + rc = gsm0808_dec_osmux_cid(&osmux_cid, + TLVP_VAL(tp, GSM0808_IE_OSMO_OSMUX_CID), + TLVP_LEN(tp, GSM0808_IE_OSMO_OSMUX_CID)); + if (rc < 0) { + LOGP(DMSC, LOGL_ERROR, "Unable to decode Osmux CID.\n"); + *cause = GSM0808_CAUSE_INCORRECT_VALUE; + return -1; + } + } else { + if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ONLY) { + LOGP(DMSC, LOGL_ERROR, "MSC not using Osmux but we are forced to use it.\n"); + *cause = GSM0808_CAUSE_INCORRECT_VALUE; + return -1; + } else if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ON) + LOGP(DMSC, LOGL_NOTICE, "MSC not using Osmux but we have Osmux enabled.\n"); + } + + /* Decode speech codec list. First set len = 0. */ + conn->codec_list = (struct gsm0808_speech_codec_list){}; + /* Check for speech codec list element */ + if (TLVP_PRESENT(tp, GSM0808_IE_SPEECH_CODEC_LIST)) { + /* Decode Speech Codec list */ + rc = gsm0808_dec_speech_codec_list(&conn->codec_list, + TLVP_VAL(tp, GSM0808_IE_SPEECH_CODEC_LIST), + TLVP_LEN(tp, GSM0808_IE_SPEECH_CODEC_LIST)); + if (rc < 0) { + LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); + *cause = GSM0808_CAUSE_INCORRECT_VALUE; + return -1; + } + } + + if (aoip && !conn->codec_list.len) { + LOGP(DMSC, LOGL_ERROR, "%s: AoIP speech mode Assignment Request:" + " Missing or empty Speech Codec List IE\n", bsc_subscr_name(conn->bsub)); + *cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; + return -1; + } + + *req = (struct assignment_request){ + .assign_for = ASSIGN_FOR_BSSMAP_REQ, + .aoip = aoip, + .msc_assigned_cic = cic, + .use_osmux = use_osmux, + .osmux_cid = osmux_cid, + }; + + /* Match codec information from the assignment command against the + * local preferences of the BSC and BTS */ + rc = select_codecs(req, ct, conn); + if (rc < 0) { + *cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL; + return -1; + } + + if (aoip) { + unsigned int rc = osmo_sockaddr_to_str_and_uint(req->msc_rtp_addr, + sizeof(req->msc_rtp_addr), + &req->msc_rtp_port, + (const struct sockaddr *)&rtp_addr); + if (!rc || rc >= sizeof(req->msc_rtp_addr)) { + LOGP(DMSC, LOGL_ERROR, "Assignment request: RTP address is too long\n"); + *cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL; + return -1; + } + } + + return 0; +} + +static int bssmap_handle_ass_req_ct_sign(struct gsm_subscriber_connection *conn, struct gsm0808_channel_type *ct, + struct assignment_request *req, uint8_t *cause) +{ + int rc; + + *req = (struct assignment_request){ + .assign_for = ASSIGN_FOR_BSSMAP_REQ, + .aoip = gscon_is_aoip(conn), + }; + + rc = select_sign_chan(req, ct); + if (rc < 0) { + *cause = GSM0808_CAUSE_INCORRECT_VALUE; + return rc; + } + + return 0; +} + /* * Handle the assignment request message. * @@ -806,11 +948,6 @@ { struct msgb *resp; struct tlv_parsed tp; - uint16_t cic = 0; - bool aoip = false; - bool use_osmux = false; - uint8_t osmux_cid = 0; - struct sockaddr_storage rtp_addr; struct gsm0808_channel_type ct; uint8_t cause; int rc; @@ -822,8 +959,6 @@ return -1; } - aoip = gscon_is_aoip(conn); - if (osmo_bssap_tlv_parse(&tp, msg->l4h + 1, length - 1) < 0) { LOGPFSML(conn->fi, LOGL_ERROR, "%s(): tlv_parse() failed\n", __func__); return -1; @@ -855,126 +990,12 @@ cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP; goto reject; case GSM0808_CHAN_SPEECH: - if (TLVP_PRESENT(&tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)) { - /* CIC is permitted in both AoIP and SCCPlite */ - cic = osmo_load16be(TLVP_VAL(&tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)); - } else { - if (!aoip) { - /* no CIC but SCCPlite: illegal */ - LOGP(DMSC, LOGL_ERROR, "SCCPlite MSC, but no CIC in ASSIGN REQ?\n"); - cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; - goto reject; - } - } - if (TLVP_PRESENT(&tp, GSM0808_IE_AOIP_TRASP_ADDR)) { - if (!aoip) { - /* SCCPlite and AoIP transport address: illegal */ - LOGP(DMSC, LOGL_ERROR, "AoIP Transport address over IPA ?!?\n"); - cause = GSM0808_CAUSE_INCORRECT_VALUE; - goto reject; - } - /* Decode AoIP transport address element */ - rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, - TLVP_VAL(&tp, GSM0808_IE_AOIP_TRASP_ADDR), - TLVP_LEN(&tp, GSM0808_IE_AOIP_TRASP_ADDR)); - if (rc < 0) { - LOGP(DMSC, LOGL_ERROR, "Unable to decode AoIP transport address.\n"); - cause = GSM0808_CAUSE_INCORRECT_VALUE; - goto reject; - } - } else if (aoip) { - /* no AoIP transport level address but AoIP transport: illegal */ - LOGP(DMSC, LOGL_ERROR, "AoIP transport address missing in ASSIGN REQ, " - "audio would not work; rejecting\n"); - cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; + if (bssmap_handle_ass_req_ct_speech(conn, &tp, &ct, &req, &cause) < 0) goto reject; - } - - if (TLVP_PRESENT(&tp, GSM0808_IE_OSMO_OSMUX_CID)) { - if (conn->sccp.msc->use_osmux == OSMUX_USAGE_OFF) { - LOGP(DMSC, LOGL_ERROR, "MSC using Osmux but we have it disabled.\n"); - cause = GSM0808_CAUSE_INCORRECT_VALUE; - goto reject; - } - use_osmux = true; - rc = gsm0808_dec_osmux_cid(&osmux_cid, - TLVP_VAL(&tp, GSM0808_IE_OSMO_OSMUX_CID), - TLVP_LEN(&tp, GSM0808_IE_OSMO_OSMUX_CID)); - if (rc < 0) { - LOGP(DMSC, LOGL_ERROR, "Unable to decode Osmux CID.\n"); - cause = GSM0808_CAUSE_INCORRECT_VALUE; - goto reject; - } - } else { - if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ONLY) { - LOGP(DMSC, LOGL_ERROR, "MSC not using Osmux but we are forced to use it.\n"); - cause = GSM0808_CAUSE_INCORRECT_VALUE; - goto reject; - } else if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ON) - LOGP(DMSC, LOGL_NOTICE, "MSC not using Osmux but we have Osmux enabled.\n"); - } - - /* Decode speech codec list. First set len = 0. */ - conn->codec_list = (struct gsm0808_speech_codec_list){}; - /* Check for speech codec list element */ - if (TLVP_PRESENT(&tp, GSM0808_IE_SPEECH_CODEC_LIST)) { - /* Decode Speech Codec list */ - rc = gsm0808_dec_speech_codec_list(&conn->codec_list, - TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST), - TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST)); - if (rc < 0) { - LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); - cause = GSM0808_CAUSE_INCORRECT_VALUE; - goto reject; - } - } - - if (aoip && !conn->codec_list.len) { - LOGP(DMSC, LOGL_ERROR, "%s: AoIP speech mode Assignment Request:" - " Missing or empty Speech Codec List IE\n", bsc_subscr_name(conn->bsub)); - cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; - goto reject; - } - - req = (struct assignment_request){ - .assign_for = ASSIGN_FOR_BSSMAP_REQ, - .aoip = aoip, - .msc_assigned_cic = cic, - .use_osmux = use_osmux, - .osmux_cid = osmux_cid, - }; - - /* Match codec information from the assignment command against the - * local preferences of the BSC and BTS */ - rc = select_codecs(&req, &ct, conn); - if (rc < 0) { - cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL; - goto reject; - } - - if (aoip) { - unsigned int rc = osmo_sockaddr_to_str_and_uint(req.msc_rtp_addr, - sizeof(req.msc_rtp_addr), - &req.msc_rtp_port, - (const struct sockaddr*)&rtp_addr); - if (!rc || rc >= sizeof(req.msc_rtp_addr)) { - LOGP(DMSC, LOGL_ERROR, "Assignment request: RTP address is too long\n"); - cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL; - goto reject; - } - } break; case GSM0808_CHAN_SIGN: - req = (struct assignment_request){ - .assign_for = ASSIGN_FOR_BSSMAP_REQ, - .aoip = aoip, - }; - - rc = select_sign_chan(&req, &ct); - if (rc < 0) { - cause = GSM0808_CAUSE_INCORRECT_VALUE; + if (bssmap_handle_ass_req_ct_sign(conn, &ct, &req, &cause) < 0) goto reject; - } break; default: cause = GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31541 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I8580e75e292cff1b52b6ba1bafd12c155c3bbe93 Gerrit-Change-Number: 31541 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: codec_pref: split test_codec_support_bts_rate
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31544 ) Change subject: codec_pref: split test_codec_support_bts_rate ...................................................................... codec_pref: split test_codec_support_bts_rate Move the check for the rate into an extra function, so it can be used for CSD without checking a speech codec at the same time. Related: OS#4393 Change-Id: Iea8a23ef3c66ed556110038fe9f3bc7f6eef3e96 --- M src/osmo-bsc/codec_pref.c 1 file changed, 35 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/44/31544/1 diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index a64425a..0cf98c6 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -174,37 +174,41 @@ return false; } -/* Check if the given permitted speech value is supported by the BTS - * (vty option bts->codec-support). */ -static bool test_codec_support_bts(const struct gsm_bts *bts, uint8_t perm_spch) +static bool test_codec_support_bts_rate(const struct gsm_bts *bts, const bool full_rate) { - struct gsm_bts_trx *trx; - const struct bts_codec_conf *bts_codec = &bts->codec; unsigned int i; - bool full_rate; - int rc; + struct gsm_bts_trx *trx; enum gsm_phys_chan_config pchan; - bool rate_match = false; - /* Check if the BTS provides a physical channel that matches the - * bandwidth of the desired codec. */ - rc = full_rate_from_perm_spch(&full_rate, perm_spch); - if (rc < 0) - return false; llist_for_each_entry(trx, &bts->trx_list, list) { for (i = 0; i < TRX_NR_TS; i++) { pchan = trx->ts[i].pchan_from_config; if (pchan == GSM_PCHAN_OSMO_DYN) - rate_match = true; + return true; else if (full_rate && pchan == GSM_PCHAN_TCH_F) - rate_match = true; + return true; else if (full_rate && pchan == GSM_PCHAN_TCH_F_PDCH) - rate_match = true; + return true; else if (!full_rate && pchan == GSM_PCHAN_TCH_H) - rate_match = true; + return true; } } - if (!rate_match) + + return false; +} + +/* Check if the given permitted speech value is supported by the BTS + * (vty option bts->codec-support). */ +static bool test_codec_support_bts(const struct gsm_bts *bts, uint8_t perm_spch) +{ + const struct bts_codec_conf *bts_codec = &bts->codec; + bool full_rate; + int rc; + + /* Check if the BTS provides a physical channel that matches the + * bandwidth of the desired codec. */ + rc = full_rate_from_perm_spch(&full_rate, perm_spch); + if (rc < 0 || !test_codec_support_bts_rate(bts, full_rate)) return false; /* Check codec support */ -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Iea8a23ef3c66ed556110038fe9f3bc7f6eef3e96 Gerrit-Change-Number: 31544 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • ...
  • 261
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.