aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-01-22 11:29:06 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2019-01-30 16:54:17 +0100
commit641bcb5633f6d7dc1e5348e1cf6228f9bec724f5 (patch)
treeb2a3ffd8663c32c021b55c4586fc72f947dced5a /include
parent6d4273d7115361f4c0df54ef1a71da6ffef5a733 (diff)
assignment_fsm: fix channel allocator preferences
When the MSC allocates a channel through the ASSIGNMENT REQUEST, it may ask for a TCH/H and a TCH/F at the same time and tell which of the two types it prefers. The process of channel allocation currently selects, based on the BTS, MSC and MS capabilites exactly one apropriate codec/rate (e.g. TCH/H) and then tries to allocate it. If that allocation fails, there is no way to try the second choice and the assignment fails. For example: The MSC asks for TCH/F and TCH/H, prefering TCH/F, then the channel allocator will try TCH/F and if it fails (all TCH/F are currently in use), then TCH/H is never tried. Since the BSC currently only trys the first best codec/rate that is supported it also ignores the preference. Lets fix those problems by including the preference information and both possible codec/rate settings into the channel allocation decision. Change-Id: I5239e05c1cfbcb8af28f43373a58fa6c2d216c51 Related: OS#3503
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/codec_pref.h13
-rw-r--r--include/osmocom/bsc/gsm_data.h22
2 files changed, 28 insertions, 7 deletions
diff --git a/include/osmocom/bsc/codec_pref.h b/include/osmocom/bsc/codec_pref.h
index 51340c118..adefe0473 100644
--- a/include/osmocom/bsc/codec_pref.h
+++ b/include/osmocom/bsc/codec_pref.h
@@ -9,14 +9,19 @@ struct gsm_audio_support;
struct bts_codec_conf;
struct bsc_msc_data;
struct gsm_bts;
+struct channel_mode_and_rate;
-int match_codec_pref(enum gsm48_chan_mode *chan_mode,
- bool *full_rate,
- uint16_t *s15_s0,
+enum rate_pref {
+ RATE_PREF_NONE,
+ RATE_PREF_HR,
+ RATE_PREF_FR,
+};
+
+int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate,
const struct gsm0808_channel_type *ct,
const struct gsm0808_speech_codec_list *scl,
const struct bsc_msc_data *msc,
- const struct gsm_bts *bts);
+ const struct gsm_bts *bts, enum rate_pref rate_pref);
void gen_bss_supported_codec_list(struct gsm0808_speech_codec_list *scl,
const struct bsc_msc_data *msc,
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index c3d8d64c5..3d5c19163 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -99,6 +99,12 @@ enum subscr_sccp_state {
SUBSCR_SCCP_ST_CONNECTED
};
+struct channel_mode_and_rate {
+ enum gsm48_chan_mode chan_mode;
+ bool full_rate;
+ uint16_t s15_s0;
+};
+
struct assignment_request {
bool aoip;
@@ -107,9 +113,19 @@ struct assignment_request {
char msc_rtp_addr[INET_ADDRSTRLEN];
uint16_t msc_rtp_port;
- enum gsm48_chan_mode chan_mode;
- bool full_rate;
- uint16_t s15_s0;
+ /* Prefered rate/codec setting (mandatory) */
+ struct channel_mode_and_rate ch_mode_rate_pref;
+
+ /* Alternate rate/codec setting (optional) */
+ bool ch_mode_rate_alt_present;
+ struct channel_mode_and_rate ch_mode_rate_alt;
+
+ /* Depending on the preferences that where submitted together with
+ * the assignment and the current channel load, the BSC has to select
+ * one of the offered codec/rates. The final selection by the BSC is
+ * stored here and is used when sending the assignment complete or
+ * when performing a handover procedure. */
+ struct channel_mode_and_rate ch_mode_rate;
};
struct assignment_fsm_data {