Attention is currently required from: osmith.
laforge has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email )
Change subject: contrib/jenkins: run pysim tests too
......................................................................
Patch Set 3: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I6bb7f137d3124e68574bc599969a8e7fd8b68904
Gerrit-Change-Number: 38268
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 23 Sep 2024 10:59:48 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
jolly has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/38197?usp=email )
Change subject: Remove speech codec list from bearer_cap for phase 1 mobile station
......................................................................
Remove speech codec list from bearer_cap for phase 1 mobile station
According to TS 04.08 Clause 10.5.4.5.1, the octet 3a etc. shall not be
included, if only GSM full/half rate speech version 1 is supported.
As phase 1 mobile stations only support FR and HR speech, the speech
list in the bearer capability must be reduced to the codecs listed
above. If there is none of these codecs left, the call is rejected.
The octet 3a etc. must be omitted when encoding bearer capability for
phase 1 mobile stations. This is done by removing the speech list.
I do not use a "codec filter", because it is not required. The phase 1
mobile station can only respond with codecs it supports, so no filtering
is required.
Related: OS#6461
Change-Id: Idd267dad0ade18cee7d5be813a57e1ee3168e2db
---
M include/osmocom/msc/codec_mapping.h
M src/libmsc/codec_mapping.c
M src/libmsc/gsm_04_08_cc.c
3 files changed, 43 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/include/osmocom/msc/codec_mapping.h b/include/osmocom/msc/codec_mapping.h
index 3b502a9..79925c9 100644
--- a/include/osmocom/msc/codec_mapping.h
+++ b/include/osmocom/msc/codec_mapping.h
@@ -47,6 +47,7 @@
const struct codec_mapping *codec_mapping_by_mgcp_codec(enum mgcp_codecs mgcp);
int bearer_cap_add_speech_ver(struct gsm_mncc_bearer_cap *bearer_cap, enum gsm48_bcap_speech_ver speech_ver);
+int bearer_cap_filter_rev_lev(struct gsm_mncc_bearer_cap *bearer_cap, uint8_t rev_lev);
int sdp_audio_codec_add_to_bearer_cap(struct gsm_mncc_bearer_cap *bearer_cap, const struct sdp_audio_codec *codec);
int sdp_audio_codecs_to_bearer_cap(struct gsm_mncc_bearer_cap *bearer_cap, const struct sdp_audio_codecs *ac);
int bearer_cap_set_radio(struct gsm_mncc_bearer_cap *bearer_cap);
diff --git a/src/libmsc/codec_mapping.c b/src/libmsc/codec_mapping.c
index bb5968f..f3a707b 100644
--- a/src/libmsc/codec_mapping.c
+++ b/src/libmsc/codec_mapping.c
@@ -343,6 +343,37 @@
return 0;
}
+/* Bearer capability for phase 1 mobile stations must not have a speech version list. It uses the the radio capability
+ * to select the codec. The speech version list is removed. If no phase 1 codec was in the speech version list, an
+ * error is returned also. */
+int bearer_cap_filter_rev_lev(struct gsm_mncc_bearer_cap *bearer_cap, uint8_t rev_lev)
+{
+ bool fr_present = false, hr_present = false;
+ int i;
+
+ if (rev_lev > 0)
+ return 0;
+
+
+ for (i = 0; bearer_cap->speech_ver[i] >= 0; i++) {
+ switch (bearer_cap->speech_ver[i]) {
+ case GSM48_BCAP_SV_FR:
+ fr_present = true;
+ break;
+ case GSM48_BCAP_SV_HR:
+ hr_present = true;
+ break;
+ }
+ }
+
+ bearer_cap->speech_ver[0] = -1;
+
+ if (!fr_present && !hr_present)
+ return -ENOTSUP;
+
+ return 0;
+}
+
/* Try to convert the SDP audio codec name to Speech Versions to append to Bearer Capabilities.
* Return the number of Speech Version entries added (some may add more than one, others may be unknown/unapplicable and
* return 0). */
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index fc4f730..c27caab 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -950,6 +950,13 @@
msgb_free(msg);
return rc;
}
+ rc = bearer_cap_filter_rev_lev(&bearer_cap, trans->vsub->classmark.classmark1.rev_lev);
+ if (rc) {
+ LOG_TRANS(trans, LOGL_ERROR, "No codec offered is supported by phase 1 mobile.\n");
+ trans_free(trans);
+ msgb_free(msg);
+ return rc;
+ }
break;
case GSM48_BCAP_ITCAP_3k1_AUDIO:
case GSM48_BCAP_ITCAP_FAX_G3:
@@ -1136,6 +1143,7 @@
trans->bearer_cap.transfer);
return -EINVAL;
}
+ bearer_cap_filter_rev_lev(&proceeding->bearer_cap, trans->vsub->classmark.classmark1.rev_lev);
gsm48_encode_bearer_cap(msg, 0, &proceeding->bearer_cap);
memcpy(&trans->bearer_cap, &proceeding->bearer_cap, sizeof(trans->bearer_cap));
}
@@ -1851,6 +1859,7 @@
gsm48_start_cc_timer(trans, 0x323, GSM48_T323);
/* bearer capability */
+ bearer_cap_filter_rev_lev(&modify->bearer_cap, trans->vsub->classmark.classmark1.rev_lev);
gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap);
memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap));
@@ -1898,6 +1907,7 @@
gh->msg_type = GSM48_MT_CC_MODIFY_COMPL;
/* bearer capability */
+ bearer_cap_filter_rev_lev(&modify->bearer_cap, trans->vsub->classmark.classmark1.rev_lev);
gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap);
memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap));
@@ -1951,6 +1961,7 @@
gh->msg_type = GSM48_MT_CC_MODIFY_REJECT;
/* bearer capability */
+ bearer_cap_filter_rev_lev(&modify->bearer_cap, trans->vsub->classmark.classmark1.rev_lev);
gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap);
memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap));
/* cause */
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38197?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Idd267dad0ade18cee7d5be813a57e1ee3168e2db
Gerrit-Change-Number: 38197
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: nt2mku <degrunert.web(a)googlemail.com>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email )
Change subject: contrib/jenkins: run pysim tests too
......................................................................
Set Ready For Review
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I6bb7f137d3124e68574bc599969a8e7fd8b68904
Gerrit-Change-Number: 38268
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 23 Sep 2024 10:56:22 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email )
Change subject: contrib/jenkins: run pysim tests too
......................................................................
contrib/jenkins: run pysim tests too
Related: OS#6570
Change-Id: I6bb7f137d3124e68574bc599969a8e7fd8b68904
---
M contrib/jenkins.sh
1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/68/38268/1
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index afd66eb..a990e0e 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -48,7 +48,29 @@
make -C "docs" publish publish-html
fi
;;
+"pysim")
+ # Run the pysim tests with pyosmocom from this tree (OS#6570)
+ virtualenv -p python3 venv --system-site-packages
+ . venv/bin/activate
+ pip install . --force-reinstall
+ deactivate
+ # Clone pysim and remove pyosmocom from requirements.txt, we want to
+ # use the version that was just installed into the venv instead
+ git clone https://gerrit.osmocom.org/pysim --depth=1 --branch=master
+ cd pysim
+ sed -i '/^pyosmocom>=.*/d' requirements.txt
+ if grep -q pyosmocom requirements.txt; then
+ cat requirements.txt
+ set +x
+ echo "ERROR: failed to remove pyosmocom from pysim's requirements.txt"
+ exit 1
+ fi
+
+ # Let pysim enter the same venv and run the tests
+ ln -s $PWD/venv pysim/venv
+ SKIP_CLEAN_WORKSPACE=1 JOB_TYPE="test" contrib/jenkins.sh
+ ;;
*)
set +x
echo "ERROR: JOB_TYPE has unexpected value '$JOB_TYPE'."
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I6bb7f137d3124e68574bc599969a8e7fd8b68904
Gerrit-Change-Number: 38268
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>