diff options
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) |