blob: 3a0db2cf7e9faa033e82b5209014b1172b2eb947 [file] [log] [blame]
Oliver Smith5375f782023-05-23 13:38:33 +02001/* Filter/overlay codec and CSD bearer service selections for voice calls/CSD,
2 * across MS, RAN and CN limitations
3 *
4 * (C) 2023 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
5 * All Rights Reserved
6 *
7 * Author: Oliver Smith
8 *
9 * SPDX-License-Identifier: AGPL-3.0+
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Affero General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Affero General Public License for more details.
20 *
21 * You should have received a copy of the GNU Affero General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 */
24
25#include <osmocom/msc/transaction_cc.h>
26
27void trans_cc_filter_set_ms_from_bc(struct gsm_trans *trans, const struct gsm_mncc_bearer_cap *bcap)
28{
29 trans->cc.codecs.ms = (struct sdp_audio_codecs){0};
30
31 if (!bcap)
32 return;
33
34 switch (bcap->transfer) {
35 case GSM48_BCAP_ITCAP_SPEECH:
36 sdp_audio_codecs_from_bearer_cap(&trans->cc.codecs.ms, bcap);
37 break;
38 default:
39 LOG_TRANS(trans, LOGL_ERROR, "Handling of information transfer capability %d not implemented\n",
40 bcap->transfer);
41 break;
42 }
43}