falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/37299?usp=email )
Change subject: E1: support HRv1 codec on both 16k and 8k subslots ......................................................................
E1: support HRv1 codec on both 16k and 8k subslots
HRv1 support in OsmoMGW-E1 was previously broken (couldn't work on either 16k or 8k subslots) because of inconsistency: the TRAU frame type was set to OSMO_TRAU16_FT_HR, but the TRAU sync pattern was set to OSMO_TRAU_SYNCP_8_HR. However, now that libosmotrau has proper support for HRv1 TRAU frame encoding and RTP conversion in both 16k and 8k formats, drive it correctly in OsmoMGW-E1.
Change-Id: Ifadbdc68905178c6ffdd673a6fb71c18610c9847 --- M src/libosmo-mgcp/mgcp_e1.c 1 file changed, 38 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/37299/1
diff --git a/src/libosmo-mgcp/mgcp_e1.c b/src/libosmo-mgcp/mgcp_e1.c index 20aff95..28d943d 100644 --- a/src/libosmo-mgcp/mgcp_e1.c +++ b/src/libosmo-mgcp/mgcp_e1.c @@ -467,9 +467,17 @@ return OSMO_TRAU16_FT_FR; else if (strcmp(sdp_subtype_name, "GSM-EFR") == 0) return OSMO_TRAU16_FT_EFR; - else if (strcmp(sdp_subtype_name, "GSM-HR-08") == 0) - return OSMO_TRAU16_FT_HR; - else if (strcmp(sdp_subtype_name, "AMR") == 0) { + else if (strcmp(sdp_subtype_name, "GSM-HR-08") == 0) { + if (i460_rate == OSMO_I460_RATE_16k) + return OSMO_TRAU16_FT_HR; + else if (i460_rate == OSMO_I460_RATE_8k) + return OSMO_TRAU8_SPEECH; + else { + LOGPENDP(endp, DE1, LOGL_ERROR, + "E1-TRAU-TX: unsupported or illegal I.460 rate for HR\n"); + return OSMO_TRAU_FT_NONE; + } + } else if (strcmp(sdp_subtype_name, "AMR") == 0) { if (i460_rate == OSMO_I460_RATE_8k) { switch (amr_ft) { case AMR_4_75: @@ -502,9 +510,17 @@ return OSMO_TRAU_SYNCP_16_FR_EFR; else if (strcmp(sdp_subtype_name, "GSM-EFR") == 0) return OSMO_TRAU_SYNCP_16_FR_EFR; - else if (strcmp(sdp_subtype_name, "GSM-HR-08") == 0) - return OSMO_TRAU_SYNCP_8_HR; - else if (strcmp(sdp_subtype_name, "AMR") == 0) { + else if (strcmp(sdp_subtype_name, "GSM-HR-08") == 0) { + if (i460_rate == OSMO_I460_RATE_16k) + return OSMO_TRAU_SYNCP_16_FR_EFR; + else if (i460_rate == OSMO_I460_RATE_8k) + return OSMO_TRAU_SYNCP_8_HR; + else { + LOGPENDP(endp, DE1, LOGL_ERROR, + "E1-TRAU-TX: unsupported or illegal I.460 rate for HR\n"); + return OSMO_TRAU_SYNCP_16_FR_EFR; + } + } else if (strcmp(sdp_subtype_name, "AMR") == 0) { if (i460_rate == OSMO_I460_RATE_8k) { switch (amr_ft) { case AMR_4_75: