diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-05-31 15:15:05 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-12-01 03:37:43 +0100 |
commit | bdbb7723fdef03c3f996a21f3fe3441623a9cc13 (patch) | |
tree | ab2709f1c4517b0128382a0b5d3deaeb7d904eb7 /src/libmsc/gsm_04_08.c | |
parent | 2544109c1be180bd67c5b929aabd67dd659bb4c1 (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.
Diffstat (limited to 'src/libmsc/gsm_04_08.c')
-rw-r--r-- | src/libmsc/gsm_04_08.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 75a77f5f5..402be2f34 100644 --- a/src/libmsc/gsm_04_08.c +++ b/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) |