aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-08 19:11:09 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-10-13 16:12:26 +0200
commitabf41fa68a1689a189396f2888ba63e071360f8f (patch)
tree5d8b77ac8f0db20c4885305367817f0a54e2f91f
parent9b82b17c5eea1a419d9e436d276dc7c4c8969512 (diff)
codec t9n: include full gsm0808_speech_codec in mapping
-rw-r--r--include/osmocom/msc/codec_sdp_cc_t9n.h7
-rw-r--r--src/libmsc/codec_sdp_cc_t9n.c58
2 files changed, 45 insertions, 20 deletions
diff --git a/include/osmocom/msc/codec_sdp_cc_t9n.h b/include/osmocom/msc/codec_sdp_cc_t9n.h
index 093456133..0c62b5361 100644
--- a/include/osmocom/msc/codec_sdp_cc_t9n.h
+++ b/include/osmocom/msc/codec_sdp_cc_t9n.h
@@ -29,10 +29,9 @@ struct codec_mapping {
enum gsm48_bcap_speech_ver speech_ver[8];
/* If applicable, one of GSM_TCHF_FRAME, GSM_TCHF_FRAME_EFR, GSM_TCHH_FRAME, GSM_TCH_FRAME_AMR; or zero. */
uint32_t mncc_payload_msg_type;
- /* Set to true if gsm0808_speech_codec_type below reflects a meaningful value. */
- bool has_gsm0808_speech_codec_type;
- /* gsm0808_speech_codec_type corresponds to gsm0808_speech_codec[_list]->type */
- enum gsm0808_speech_codec_type gsm0808_speech_codec_type;
+ /* Set to true if gsm0808_speech_codec below reflects a meaningful value. */
+ bool has_gsm0808_speech_codec;
+ struct gsm0808_speech_codec gsm0808_speech_codec;
/* If applicable, entries to add to Permitted Speech lists when this codec is present; or zero. */
enum gsm0808_permitted_speech perm_speech;
/* If applicable, indicator whether this codec can work on a GERAN half-rate lchan, or whether full-rate is
diff --git a/src/libmsc/codec_sdp_cc_t9n.c b/src/libmsc/codec_sdp_cc_t9n.c
index 11345d3e9..4632fc106 100644
--- a/src/libmsc/codec_sdp_cc_t9n.c
+++ b/src/libmsc/codec_sdp_cc_t9n.c
@@ -48,8 +48,11 @@ const struct codec_mapping codec_map[] = {
.speech_ver_count = 1,
.speech_ver = { GSM48_BCAP_SV_FR },
.mncc_payload_msg_type = GSM_TCHF_FRAME,
- .has_gsm0808_speech_codec_type = true,
- .gsm0808_speech_codec_type = GSM0808_SCT_FR1,
+ .has_gsm0808_speech_codec = true,
+ .gsm0808_speech_codec = {
+ .fi = true,
+ .type = GSM0808_SCT_FR1,
+ },
.perm_speech = GSM0808_PERM_FR1,
.frhr = CODEC_FRHR_FR,
},
@@ -79,8 +82,11 @@ const struct codec_mapping codec_map[] = {
.speech_ver_count = 1,
.speech_ver = { GSM48_BCAP_SV_EFR },
.mncc_payload_msg_type = GSM_TCHF_FRAME_EFR,
- .has_gsm0808_speech_codec_type = true,
- .gsm0808_speech_codec_type = GSM0808_SCT_FR2,
+ .has_gsm0808_speech_codec = true,
+ .gsm0808_speech_codec = {
+ .fi = true,
+ .type = GSM0808_SCT_FR2,
+ },
.perm_speech = GSM0808_PERM_FR2,
.frhr = CODEC_FRHR_FR,
},
@@ -94,8 +100,12 @@ const struct codec_mapping codec_map[] = {
.speech_ver_count = 1,
.speech_ver = { GSM48_BCAP_SV_HR },
.mncc_payload_msg_type = GSM_TCHH_FRAME,
- .has_gsm0808_speech_codec_type = true,
- .gsm0808_speech_codec_type = GSM0808_SCT_HR1,
+ .has_gsm0808_speech_codec = true,
+ .gsm0808_speech_codec = {
+ .fi = true,
+ .type = GSM0808_SCT_HR1,
+ .cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR,
+ },
.perm_speech = GSM0808_PERM_HR1,
.frhr = CODEC_FRHR_HR,
},
@@ -117,8 +127,12 @@ const struct codec_mapping codec_map[] = {
.speech_ver_count = 1,
.speech_ver = { GSM48_BCAP_SV_AMR_F },
.mncc_payload_msg_type = GSM_TCH_FRAME_AMR,
- .has_gsm0808_speech_codec_type = true,
- .gsm0808_speech_codec_type = GSM0808_SCT_FR3,
+ .has_gsm0808_speech_codec = true,
+ .gsm0808_speech_codec = {
+ .fi = true,
+ .type = GSM0808_SCT_FR3,
+ .cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR,
+ },
.perm_speech = GSM0808_PERM_FR3,
.frhr = CODEC_FRHR_FR,
},
@@ -133,8 +147,12 @@ const struct codec_mapping codec_map[] = {
.speech_ver_count = 2,
.speech_ver = { GSM48_BCAP_SV_AMR_H, GSM48_BCAP_SV_AMR_OH },
.mncc_payload_msg_type = GSM_TCH_FRAME_AMR,
- .has_gsm0808_speech_codec_type = true,
- .gsm0808_speech_codec_type = GSM0808_SCT_HR3,
+ .has_gsm0808_speech_codec = true,
+ .gsm0808_speech_codec = {
+ .fi = true,
+ .type = GSM0808_SCT_HR3,
+ .cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR,
+ },
.perm_speech = GSM0808_PERM_HR3,
.frhr = CODEC_FRHR_HR,
},
@@ -149,8 +167,12 @@ const struct codec_mapping codec_map[] = {
.speech_ver_count = 2,
.speech_ver = { GSM48_BCAP_SV_AMR_OFW, GSM48_BCAP_SV_AMR_FW },
.mncc_payload_msg_type = GSM_TCH_FRAME_AMR,
- .has_gsm0808_speech_codec_type = true,
- .gsm0808_speech_codec_type = GSM0808_SCT_FR5,
+ .has_gsm0808_speech_codec = true,
+ .gsm0808_speech_codec = {
+ .fi = true,
+ .type = GSM0808_SCT_FR5,
+ .cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB,
+ },
.perm_speech = GSM0808_PERM_FR5,
.frhr = CODEC_FRHR_FR,
},
@@ -165,8 +187,12 @@ const struct codec_mapping codec_map[] = {
.speech_ver_count = 1,
.speech_ver = { GSM48_BCAP_SV_AMR_OHW },
.mncc_payload_msg_type = GSM_TCH_FRAME_AMR,
- .has_gsm0808_speech_codec_type = true,
- .gsm0808_speech_codec_type = GSM0808_SCT_HR4,
+ .has_gsm0808_speech_codec = true,
+ .gsm0808_speech_codec = {
+ .fi = true,
+ .type = GSM0808_SCT_HR4,
+ .cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB,
+ },
.perm_speech = GSM0808_PERM_HR4,
.frhr = CODEC_FRHR_HR,
},
@@ -201,9 +227,9 @@ const struct codec_mapping *codec_mapping_by_gsm0808_speech_codec_type(enum gsm0
{
const struct codec_mapping *m;
foreach_codec_mapping(m) {
- if (!m->has_gsm0808_speech_codec_type)
+ if (!m->has_gsm0808_speech_codec)
continue;
- if (m->gsm0808_speech_codec_type == sct)
+ if (m->gsm0808_speech_codec.type == sct)
return m;
/* TODO: evaluate cfg bits? */
}