aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-05-31 15:15:05 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2013-07-29 12:44:14 +0200
commitb7a309ef219f5399772d787be187190b18854c67 (patch)
tree6b5f47e783b3871ee641a977c34b58f545e85dcb
parentbec07b0c3f74a5e593dc3d9c44ec583b5ac72a29 (diff)
HO: Remove all TCH rates from bearer capability that are not available
When the MNCC application negotiates the codec, it must be sure that the TCH rates of the neotiation results can be assigned to the MS. Therefore not only the codecs that are unsupported by BTS are removed, but also the codecs that require channels that are not available.
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 75a77f5f5..402be2f34 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -82,10 +82,21 @@ struct gsm_lai {
static int apply_codec_restrictions(struct gsm_bts *bts,
struct gsm_mncc_bearer_cap *bcap)
{
+ int tchf_count = lc_count_bts(bts, GSM_PCHAN_TCH_F);
+ int tchh_count = lc_count_bts(bts, GSM_PCHAN_TCH_H);
int i, j;
/* remove unsupported speech versions from list */
for (i = 0, j = 0; bcap->speech_ver[i] >= 0; i++) {
+ /* filter TCH rates currently available */
+ if ((bcap->speech_ver[i] & 1)) {
+ if (!tchh_count)
+ continue;
+ } else {
+ if (!tchf_count)
+ continue;
+ }
+ /* filter codecs supported by BTS */
if (bcap->speech_ver[i] == 0)
bcap->speech_ver[j++] = 0;
if (bcap->speech_ver[i] == 2 && bts->codec.efr)