jolly has uploaded this change for review. (
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 ect. 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.
The octet 3a ect. 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 src/libmsc/gsm_04_08_cc.c
1 file changed, 38 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/38197/1
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index fc4f730..bd07b34 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -926,6 +926,21 @@
.speech_ver = { -1 },
};
sdp_audio_codecs_to_bearer_cap(&bearer_cap, &trans->cc.local.audio_codecs);
+ /* Remove codecs in bearer_cap that are unsupported by phase 1 mobile stations.
+ * This is required, because phase 1 mobile stations do not support octets 3a ect. */
+ if (trans->vsub->classmark.classmark1.rev_lev == 0) {
+ int i, j;
+
+ for (i = 0, j = 0; bearer_cap.speech_ver[i] >= 0; i++) {
+ if (bearer_cap.speech_ver[i] == GSM48_BCAP_SV_FR ||
+ bearer_cap.speech_ver[i] == GSM48_BCAP_SV_HR)
+ bearer_cap.speech_ver[j++] = bearer_cap.speech_ver[i];
+ LOG_TRANS(trans, LOGL_DEBUG, "Removing speech version %d for phase 1
MS.\n",
+ bearer_cap.speech_ver[i]);
+ }
+ bearer_cap.speech_ver[j] = -1;
+ }
+ /* Set radio channel requirements accroding to available speech codecs. */
rc = bearer_cap_set_radio(&bearer_cap);
if (rc) {
LOG_TRANS(trans, LOGL_ERROR, "Error composing Bearer Capability for CC
Setup\n");
@@ -972,6 +987,10 @@
/* Create a copy of the bearer capability in the transaction struct, so we can use this
information later */
trans->bearer_cap = bearer_cap;
+ /* Speech codec list (oictets 3a ect.) must not be sent to phase 1 mobile stations.
+ * These mobile stations may reject the call, if present. */
+ if (trans->vsub->classmark.classmark1.rev_lev == 0)
+ bearer_cap.speech_ver[0] = -1;
gsm48_encode_bearer_cap(msg, 0, &bearer_cap);
/* facility */
@@ -1136,6 +1155,10 @@
trans->bearer_cap.transfer);
return -EINVAL;
}
+ /* Speech codec list (oictets 3a ect.) must not be sent to phase 1 mobile stations.
+ * These mobile stations may reject the call, if present. */
+ if (trans->vsub->classmark.classmark1.rev_lev == 0)
+ proceeding->bearer_cap.speech_ver[0] = -1;
gsm48_encode_bearer_cap(msg, 0, &proceeding->bearer_cap);
memcpy(&trans->bearer_cap, &proceeding->bearer_cap,
sizeof(trans->bearer_cap));
}
@@ -1851,6 +1874,11 @@
gsm48_start_cc_timer(trans, 0x323, GSM48_T323);
/* bearer capability */
+
+ /* Speech codec list (oictets 3a ect.) must not be sent to phase 1 mobile stations.
+ * These mobile stations may reject the call, if present. */
+ if (trans->vsub->classmark.classmark1.rev_lev == 0)
+ modify->bearer_cap.speech_ver[0] = -1;
gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap);
memcpy(&trans->bearer_cap, &modify->bearer_cap,
sizeof(trans->bearer_cap));
@@ -1898,6 +1926,11 @@
gh->msg_type = GSM48_MT_CC_MODIFY_COMPL;
/* bearer capability */
+
+ /* Speech codec list (oictets 3a ect.) must not be sent to phase 1 mobile stations.
+ * These mobile stations may reject the call, if present. */
+ if (trans->vsub->classmark.classmark1.rev_lev == 0)
+ modify->bearer_cap.speech_ver[0] = -1;
gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap);
memcpy(&trans->bearer_cap, &modify->bearer_cap,
sizeof(trans->bearer_cap));
@@ -1951,6 +1984,11 @@
gh->msg_type = GSM48_MT_CC_MODIFY_REJECT;
/* bearer capability */
+
+ /* Speech codec list (oictets 3a ect.) must not be sent to phase 1 mobile stations.
+ * These mobile stations may reject the call, if present. */
+ if (trans->vsub->classmark.classmark1.rev_lev == 0)
+ modify->bearer_cap.speech_ver[0] = -1;
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: newchange
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Idd267dad0ade18cee7d5be813a57e1ee3168e2db
Gerrit-Change-Number: 38197
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>