diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-08-06 07:00:52 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-05-02 19:24:30 +0200 |
commit | 3488d8eb86f5d4138b24cbec1019f9a06baa4e3d (patch) | |
tree | 2d2832f11a56f7ee2fd0e34c57ee559bb49a69da /openbsc/src/osmo-bsc | |
parent | 079765ad420812bc9b9f9143735ebcb76a649783 (diff) |
audio: Make the BSC handle the new mr_config request of the BSC API
Handle the mr_config request and set the AMR multirate config for
the given MSC. Initialize the mr_config with the AMR5.9 default we
have been using until now.
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_api.c | 29 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_msc.c | 3 |
2 files changed, 32 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/openbsc/src/osmo-bsc/osmo_bsc_api.c index 015972678..e48458ab7 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_api.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_api.c @@ -296,6 +296,34 @@ static int bsc_clear_request(struct gsm_subscriber_connection *conn, uint32_t ca return 0; } +static void bsc_mr_config(struct gsm_subscriber_connection *conn, + struct gsm48_multi_rate_conf *conf) +{ + struct osmo_msc_data *msc; + + if (!conn->sccp_con) { + LOGP(DMSC, LOGL_ERROR, + "No msc data available on conn %p. Audio will be broken.\n", + conn); + return; + } + + msc = conn->sccp_con->msc; + + conf->ver = 1; + conf->icmi = 1; + + /* maybe gcc see's it is copy of _one_ byte */ + conf->m4_75 = msc->amr_conf.m4_75; + conf->m5_15 = msc->amr_conf.m5_15; + conf->m5_90 = msc->amr_conf.m5_90; + conf->m6_70 = msc->amr_conf.m6_70; + conf->m7_40 = msc->amr_conf.m7_40; + conf->m7_95 = msc->amr_conf.m7_95; + conf->m10_2 = msc->amr_conf.m10_2; + conf->m12_2 = msc->amr_conf.m12_2; +} + static struct bsc_api bsc_handler = { .sapi_n_reject = bsc_sapi_n_reject, .cipher_mode_compl = bsc_cipher_mode_compl, @@ -304,6 +332,7 @@ static struct bsc_api bsc_handler = { .assign_compl = bsc_assign_compl, .assign_fail = bsc_assign_fail, .clear_request = bsc_clear_request, + .mr_config = bsc_mr_config, }; struct bsc_api *osmo_bsc_api() diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 40d8366ca..6f319f9a7 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -491,5 +491,8 @@ struct osmo_msc_data *osmo_msc_data_alloc(struct gsm_network *net, int nr) msc_data->nr = nr; msc_data->allow_emerg = 1; + /* Defaults for the audio setup */ + msc_data->amr_conf.m5_90 = 1; + return msc_data; } |