aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-10-05 10:29:53 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2018-10-05 15:20:51 +0200
commit524a2d24b4f2280a9dd521cdaf5bea76790fd535 (patch)
treeaedcd5402854186cbe571fe9bd79c83e498f1f58 /src
parentb9d3c71af347906cef2bb54be57418a948d17b14 (diff)
osmo_bsc_msc: Set reasonable codec list defaults
When the user sets no codec-list in the msc node, the configuration will end up with an empty codec list. This is a useless configuration. There should be a sane default setting. - Set all possible codecs as default for codec-list Change-Id: I3749a65828c788f38c22f0a5314533f4516da3ed Related: OS#3625
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/osmo_bsc_msc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index e00c9ef81..71931e615 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -64,6 +64,7 @@ struct bsc_msc_data *osmo_msc_data_find(struct gsm_network *net, int nr)
struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *net, int nr)
{
struct bsc_msc_data *msc_data;
+ unsigned int i;
/* check if there is already one */
msc_data = osmo_msc_data_find(net, nr);
@@ -94,6 +95,27 @@ struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *net, int nr)
/* Defaults for the audio setup */
msc_data->amr_conf.m5_90 = 1;
+ /* Allow the full set of possible codecs by default */
+ msc_data->audio_length = 5;
+ msc_data->audio_support =
+ talloc_zero_array(msc_data, struct gsm_audio_support *,
+ msc_data->audio_length);
+ for (i = 0; i < msc_data->audio_length; i++) {
+ msc_data->audio_support[i] =
+ talloc_zero(msc_data->audio_support,
+ struct gsm_audio_support);
+ }
+ msc_data->audio_support[0]->ver = 1;
+ msc_data->audio_support[0]->hr = 0;
+ msc_data->audio_support[1]->ver = 1;
+ msc_data->audio_support[1]->hr = 1;
+ msc_data->audio_support[2]->ver = 2;
+ msc_data->audio_support[2]->hr = 0;
+ msc_data->audio_support[3]->ver = 3;
+ msc_data->audio_support[3]->hr = 0;
+ msc_data->audio_support[4]->ver = 3;
+ msc_data->audio_support[4]->hr = 1;
+
return msc_data;
}