From 524a2d24b4f2280a9dd521cdaf5bea76790fd535 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 5 Oct 2018 10:29:53 +0200 Subject: 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 --- src/osmo-bsc/osmo_bsc_msc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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; } -- cgit v1.2.3