laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/41630?usp=email )
Change subject: MGW control: migrate to new API for codecs and payload types
......................................................................
MGW control: migrate to new API for codecs and payload types
struct mgcp_conn_peer in libosmo-mgcp-client API used to have a
mandatory codecs[] array for codec specification and an optional
ptmap[] array to be used only when the default payload type needs
to be overridden. But now the codecs[] array is deprecated,
and new API features (see following patches) require the use of
ptmap[] array, with mandatory specification of payload type by
the MGCP client. Convert osmo-bsc to this new API.
Change-Id: Iafc38a3da64ce7c2f060a32864174dcde9f57b56
---
M src/osmo-bsc/lchan_rtp_fsm.c
1 file changed, 59 insertions(+), 17 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c
index 559a30b..c348833 100644
--- a/src/osmo-bsc/lchan_rtp_fsm.c
+++ b/src/osmo-bsc/lchan_rtp_fsm.c
@@ -21,6 +21,7 @@
*/
#include <osmocom/core/fsm.h>
+#include <osmocom/gsm/protocol/gsm_48_103.h>
#include <osmocom/gsm/rtp_extensions.h>
#include <osmocom/netif/rtp.h>
#include <osmocom/mgcp_client/mgcp_client_endpoint_fsm.h>
@@ -894,9 +895,36 @@
}
}
+static int chan_mode_to_mgcp_aoip_pt(enum mgcp_codecs codec)
+{
+ switch (codec) {
+ case CODEC_GSM_8000_1:
+ return OSMO_AOIP_RTP_PT_FR1;
+
+ case CODEC_GSMEFR_8000_1:
+ return OSMO_AOIP_RTP_PT_EFR;
+
+ case CODEC_GSMHR_8000_1:
+ return OSMO_AOIP_RTP_PT_HR1;
+
+ case CODEC_AMR_8000_1:
+ return OSMO_AOIP_RTP_PT_AMR;
+
+ case CODEC_CLEARMODE:
+ return OSMO_AOIP_RTP_PT_CSD;
+
+ default:
+ /* Error: unknown codec */
+ return -1;
+ }
+}
+
static int chan_mode_to_mgcp_bss_pt(enum mgcp_codecs codec)
{
switch (codec) {
+ case CODEC_GSM_8000_1:
+ return RTP_PT_GSM_FULL;
+
case CODEC_GSMHR_8000_1:
return RTP_PT_GSM_HALF;
@@ -906,9 +934,11 @@
case CODEC_AMR_8000_1:
return RTP_PT_AMR;
+ case CODEC_CLEARMODE:
+ return RTP_PT_CSDATA;
+
default:
- /* Not an error, we just leave it to libosmo-mgcp-client to
- * decide over the PT. */
+ /* Error: unknown codec */
return -1;
}
}
@@ -917,34 +947,46 @@
{
enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->activate.ch_mode_rate.chan_mode,
lchan->type == GSM_LCHAN_TCH_H? false : true);
- int custom_pt;
+ int pt;
if (codec < 0) {
LOG_LCHAN(lchan, LOGL_ERROR,
"Unable to determine MGCP codec type for %s in chan-mode %s\n",
gsm_chan_t_name(lchan->type), gsm48_chan_mode_name(lchan->activate.ch_mode_rate.chan_mode));
- verb_info->codecs_len = 0;
+ verb_info->ptmap_len = 0;
return;
}
- verb_info->codecs[0] = codec;
- verb_info->codecs_len = 1;
-
- /* Setup custom payload types (only for BSS side and when required) */
- custom_pt = chan_mode_to_mgcp_bss_pt(codec);
- if (bss_side && custom_pt > 0) {
- verb_info->ptmap[0].codec = codec;
- verb_info->ptmap[0].pt = custom_pt;
- verb_info->ptmap_len = 1;
+ /* The new libosmo-mgcp-client API requires us to provide explicit
+ * payload type number for every codec - no more internal defaulting.
+ * Legacy payload types used on IPA/Osmocom Abis-IP are defined in
+ * <osmocom/netif/rtp.h> as RTP_PT_*, new TS 48.103 (AoIP user plane)
+ * payload types are defined in <osmocom/gsm/protocol/gsm_48_103.h>
+ * as OSMO_AOIP_RTP_PT_*.
+ */
+ if (bss_side)
+ pt = chan_mode_to_mgcp_bss_pt(codec);
+ else
+ pt = chan_mode_to_mgcp_aoip_pt(codec);
+ if (pt < 0) {
+ LOG_LCHAN(lchan, LOGL_ERROR,
+ "Unable to determine RTP payload type for %s in chan-mode %s\n",
+ gsm_chan_t_name(lchan->type), gsm48_chan_mode_name(lchan->activate.ch_mode_rate.chan_mode));
+ verb_info->ptmap_len = 0;
+ return;
}
+ verb_info->ptmap[0].codec = codec;
+ verb_info->ptmap[0].pt = pt;
+ verb_info->ptmap_len = 1;
+
/* AMR requires additional parameters to be set up (framing mode) */
- if (verb_info->codecs[0] == CODEC_AMR_8000_1) {
+ if (codec == CODEC_AMR_8000_1) {
verb_info->param_present = true;
verb_info->param.amr_octet_aligned_present = true;
}
- if (bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) {
+ if (bss_side && codec == CODEC_AMR_8000_1) {
/* FIXME: At the moment all BTSs we support are using the
* octet-aligned payload format. However, in the future
* we may support BTSs that are using bandwidth-efficient
@@ -952,7 +994,7 @@
* that distinguishes by the BTS model which mode to use. */
verb_info->param.amr_octet_aligned = true;
}
- else if (!bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) {
+ else if (!bss_side && codec == CODEC_AMR_8000_1) {
verb_info->param.amr_octet_aligned = lchan->conn->sccp.msc->amr_octet_aligned;
}
@@ -988,5 +1030,5 @@
bool mgcp_codec_is_picked(const struct mgcp_conn_peer *verb_info, enum mgcp_codecs codec)
{
- return verb_info->codecs[0] == codec;
+ return verb_info->ptmap[0].codec == codec;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/41630?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iafc38a3da64ce7c2f060a32864174dcde9f57b56
Gerrit-Change-Number: 41630
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Attention is currently required from: falconia, neels.
laforge has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/osmo-bsc/+/41630?usp=email )
Change subject: MGW control: migrate to new API for codecs and payload types
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/41630?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iafc38a3da64ce7c2f060a32864174dcde9f57b56
Gerrit-Change-Number: 41630
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 10 Dec 2025 13:36:46 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41641?usp=email )
Change subject: msc: Fix TC_stat_bsc_sctp_disconnected expectancies
......................................................................
msc: Fix TC_stat_bsc_sctp_disconnected expectancies
The test was passing when run alone, but was failing when run after
other tests using other BSCs/RNCs, since osmo-msc learned about them and
hence ran_peers.total was >1.
Change-Id: I22da7ae5c282a30e933f2f29b671ece8b6147ce9
---
M msc/MSC_Tests.ttcn
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 013ecfd..c85a458 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -7671,12 +7671,14 @@
var BSC_ConnHdlrPars pars;
var charstring msc_stats_prefix := f_msc_stats_prefix();
+ /* ran_peers.total: Despite we only use 1 RAN_CONN in this test, previous tests may have
+ * used more of them (up to configured NUM_BSC), and hence IUT may remember about them: */
var StatsDExpects expect_connected := {
- {name := msc_stats_prefix & "ran_peers.total", mtype := "g", min := 1, max := 1},
+ {name := msc_stats_prefix & "ran_peers.total", mtype := "g", min := 1, max := NUM_BSC},
{name := msc_stats_prefix & "ran_peers.active", mtype := "g", min := 1, max := 1}
};
var StatsDExpects expect_disconnected := {
- {name := msc_stats_prefix & "ran_peers.total", mtype := "g", min := 1, max := 1},
+ {name := msc_stats_prefix & "ran_peers.total", mtype := "g", min := 1, max := NUM_BSC},
{name := msc_stats_prefix & "ran_peers.active", mtype := "g", min := 0, max := 0}
};
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41641?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I22da7ae5c282a30e933f2f29b671ece8b6147ce9
Gerrit-Change-Number: 41641
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41640?usp=email )
Change subject: StatsD_Checker: Abort on expectancy failure with clear status message
......................................................................
StatsD_Checker: Abort on expectancy failure with clear status message
Before this commit, a statsd expect failure would let the test continue
the test for a while and then finally log a rellay generic timeout
message, which makes really difficult to understand what's going on and
why is the test failing.
Let's terminate the test early if a test expectation fails, so it's a
lot easier to debug.
Add an extra param to be able to use the API for test logic to check the
state without failing/aborting. This is not really used anywhere so far
but the API was built this way and I indeed think it may be handy in the
future.
Change-Id: Ibc3d079c2a45aa22f9e2e42d75109cae66530f86
---
M library/StatsD_Checker.ttcnpp
1 file changed, 24 insertions(+), 12 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
diff --git a/library/StatsD_Checker.ttcnpp b/library/StatsD_Checker.ttcnpp
index 081e6e1..9d0d823 100644
--- a/library/StatsD_Checker.ttcnpp
+++ b/library/StatsD_Checker.ttcnpp
@@ -90,7 +90,11 @@
signature STATSD_reset();
signature STATSD_snapshot(in StatsDMetricKeys keys, in boolean since_last_snapshot) return StatsDMetrics;
-signature STATSD_expect(in StatsDExpects expects, in boolean wait_converge, in boolean use_snapshot, in StatsDMetrics snapshot) return boolean;
+signature STATSD_expect(in StatsDExpects expects,
+ in boolean wait_converge,
+ in boolean abort_on_failure,
+ in boolean use_snapshot,
+ in StatsDMetrics snapshot) return boolean;
type port STATSD_PROC_PT procedure {
inout STATSD_reset, STATSD_snapshot, STATSD_expect;
@@ -106,6 +110,7 @@
var boolean since_last_snapshot;
var StatsDExpects expects;
var boolean wait_converge;
+ var boolean abort_on_failure;
var boolean use_snapshot;
var StatsDMetrics snapshot;
var Result res;
@@ -149,9 +154,9 @@
snapshot := f_statsd_checker_snapshot(keys, since_last_snapshot);
STATSD_PROC.reply(STATSD_snapshot:{keys, since_last_snapshot} value snapshot) to vc_conn;
}
- [] STATSD_PROC.getcall(STATSD_expect:{?, ?, ?, ?}) -> param(expects, wait_converge, use_snapshot, snapshot) sender vc_conn {
- var boolean success := f_statsd_checker_expect(expects, wait_converge, use_snapshot, snapshot);
- STATSD_PROC.reply(STATSD_expect:{expects, wait_converge, use_snapshot, snapshot} value success) to vc_conn;
+ [] STATSD_PROC.getcall(STATSD_expect:{?, ?, ?, ?, ?}) -> param(expects, wait_converge, abort_on_failure, use_snapshot, snapshot) sender vc_conn {
+ var boolean success := f_statsd_checker_expect(expects, wait_converge, abort_on_failure, use_snapshot, snapshot);
+ STATSD_PROC.reply(STATSD_expect:{expects, wait_converge, abort_on_failure, use_snapshot, snapshot} value success) to vc_conn;
}
}
}
@@ -318,6 +323,7 @@
private function f_statsd_checker_expect(StatsDExpects expects,
boolean wait_converge := false,
+ boolean abort_on_failure := true,
boolean use_snapshot := false,
StatsDMetrics snapshot := {}) runs on StatsD_Checker_CT return boolean {
var default t;
@@ -363,7 +369,10 @@
" (min: ", expects[i].min, ", max: ", expects[i].max, ")");
}
}
- setverdict(fail, "Timeout waiting for metrics");
+ if (abort_on_failure) {
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+ log2str("Timeout waiting for expect=", expects, " matched=", matched));
+ }
return false;
}
}
@@ -381,7 +390,10 @@
}
log("Metric: ", metric);
log("Expect: ", expects[res.idx]);
- setverdict(fail, "Metric failed expectation ", metric, " vs ", expects[res.idx]);
+ if (abort_on_failure) {
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+ log2str("Metric failed expectation ", metric, " vs ", expects[res.idx]));
+ }
return false;
}
if (res.kind == e_Matched) {
@@ -441,20 +453,20 @@
return snapshot;
}
-function f_statsd_expect(StatsDExpects expects, boolean wait_converge := false) runs on StatsD_ConnHdlr return boolean {
+function f_statsd_expect(StatsDExpects expects, boolean wait_converge := false, boolean abort_on_failure := true) runs on StatsD_ConnHdlr return boolean {
var boolean res;
if (not mp_enable_stats) {
return true;
}
- STATSD_PROC.call(STATSD_expect:{expects, wait_converge, false, {}}) {
- [] STATSD_PROC.getreply(STATSD_expect:{expects, wait_converge, false, {}}) -> value res;
+ STATSD_PROC.call(STATSD_expect:{expects, wait_converge, abort_on_failure, false, {}}) {
+ [] STATSD_PROC.getreply(STATSD_expect:{expects, wait_converge, abort_on_failure, false, {}}) -> value res;
}
return res;
}
-function f_statsd_expect_from_snapshot(StatsDExpects expects, boolean wait_converge := false,
+function f_statsd_expect_from_snapshot(StatsDExpects expects, boolean wait_converge := false, boolean abort_on_failure := true,
StatsDMetrics snapshot := {}) runs on StatsD_ConnHdlr return boolean {
var boolean res;
@@ -462,8 +474,8 @@
return true;
}
- STATSD_PROC.call(STATSD_expect:{expects, wait_converge, true, snapshot}) {
- [] STATSD_PROC.getreply(STATSD_expect:{expects, wait_converge, true, snapshot}) -> value res;
+ STATSD_PROC.call(STATSD_expect:{expects, wait_converge, abort_on_failure, true, snapshot}) {
+ [] STATSD_PROC.getreply(STATSD_expect:{expects, wait_converge, abort_on_failure, true, snapshot}) -> value res;
}
return res;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41640?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibc3d079c2a45aa22f9e2e42d75109cae66530f86
Gerrit-Change-Number: 41640
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41579?usp=email )
Change subject: pySim.runtime: Fix file selection by upper case hex FID
......................................................................
pySim.runtime: Fix file selection by upper case hex FID
When trying to remove a file (e.g. DF.5G_ProSe, 5FF0),
there seems to be a case sensitive check when checking for the dict:
pySim/runtime.py: get_file_for_filename():
478 def get_file_for_filename(self, name: str):
479 """Get the related CardFile object for a specified filename."""
480 sels = self.selected_file.get_selectables()
481 return sels[name]
The dict sels contains 5ff0, but not 5FF0.
The type of argument name is str. So a case sensitive check will be used.
Change-Id: Idd0db1f4bbd3ee9eec20f5fd0f4371c2882950cd
Closes: OS#6898
---
M pySim/runtime.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
dexter: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/runtime.py b/pySim/runtime.py
index 597323f..35452a0 100644
--- a/pySim/runtime.py
+++ b/pySim/runtime.py
@@ -477,11 +477,15 @@
def get_file_for_filename(self, name: str):
"""Get the related CardFile object for a specified filename."""
+ if is_hex(name):
+ name = name.lower()
sels = self.selected_file.get_selectables()
return sels[name]
def activate_file(self, name: str):
"""Request ACTIVATE FILE of specified file."""
+ if is_hex(name):
+ name = name.lower()
sels = self.selected_file.get_selectables()
f = sels[name]
data, sw = self.scc.activate_file(f.fid)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41579?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Idd0db1f4bbd3ee9eec20f5fd0f4371c2882950cd
Gerrit-Change-Number: 41579
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>