codec t9n: include full gsm0808_speech_codec in mapping
Change-Id: I498da95dbc30e873512dacd079957b383be71571
diff --git a/include/osmocom/msc/codec_sdp_cc_t9n.h b/include/osmocom/msc/codec_sdp_cc_t9n.h
index 0934561..0c62b53 100644
--- a/include/osmocom/msc/codec_sdp_cc_t9n.h
+++ b/include/osmocom/msc/codec_sdp_cc_t9n.h
@@ -29,10 +29,9 @@
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 11345d3..4632fc1 100644
--- a/src/libmsc/codec_sdp_cc_t9n.c
+++ b/src/libmsc/codec_sdp_cc_t9n.c
@@ -48,8 +48,11 @@
.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 @@
.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 @@
.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 @@
.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 @@
.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 @@
.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 @@
.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 *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? */
}