falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/41631?usp=email )
Change subject: MGW control: migrate to new API for fmtp
......................................................................
MGW control: migrate to new API for fmtp
Some codecs have additional parameters that need to be communicated
to the MGW using fmtp lines in SDP. We use this mechanism to
indicate octet-align=0|1 for AMR and signal the use of TW-TS-001
and TW-TS-002 extensions for FR/EFR and HR, respectively.
Migrate from legacy struct mgcp_codec_param (now deprecated)
to the new fmtp string API.
Depends: I84ba2ed5ab9d379ac0b675520796446ad6ee0710 (osmo-mgw.git)
Change-Id: Id869c9fa33a3ca6fecd30d5630741fbbf21cf6ed
---
M TODO-RELEASE
M src/osmo-bsc/lchan_rtp_fsm.c
2 files changed, 27 insertions(+), 45 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/31/41631/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..1d65ba1 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
+libosmo-mgcp-client >1.15.0 new API of fmtp in struct ptmap
diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c
index c348833..8095378 100644
--- a/src/osmo-bsc/lchan_rtp_fsm.c
+++ b/src/osmo-bsc/lchan_rtp_fsm.c
@@ -947,7 +947,7 @@
{
enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->activate.ch_mode_rate.chan_mode,
lchan->type == GSM_LCHAN_TCH_H? false : true);
- int pt;
+ int pt, amr_oa;
if (codec < 0) {
LOG_LCHAN(lchan, LOGL_ERROR,
@@ -980,51 +980,32 @@
verb_info->ptmap[0].pt = pt;
verb_info->ptmap_len = 1;
- /* AMR requires additional parameters to be set up (framing mode) */
- if (codec == CODEC_AMR_8000_1) {
- verb_info->param_present = true;
- verb_info->param.amr_octet_aligned_present = true;
- }
-
- if (bss_side && codec == CODEC_AMR_8000_1) {
- /* FIXME: At the moment all BTSs we support are using the
- * octet-aligned payload format. However, in the future
- * we may support BTSs that are using bandwidth-efficient
- * format. In this case we will have to add functionality
- * that distinguishes by the BTS model which mode to use. */
- verb_info->param.amr_octet_aligned = true;
- }
- else if (!bss_side && codec == CODEC_AMR_8000_1) {
- verb_info->param.amr_octet_aligned = lchan->conn->sccp.msc->amr_octet_aligned;
- }
-
- /* If the CN has requested RTP payload format extensions (change from
- * RFC 3551 to TW-TS-001 for FR/EFR, or from RFC 5993 to TW-TS-002
- * for HRv1) via BSSMAP IE of TW-TS-003, we need to pass this request
- * to the MGW. With E1 BTS our MGW is the origin of the RTP stream
- * and thus the party responsible for payload format choices; with
- * IP BTS our MGW is merely a forwarder and thus can get by without
- * this detailed knowledge, but it doesn't hurt to inform the MGW
- * in all cases.
- *
- * Note that the following code does not perform conditional checks
- * of whether the selected codec is FR/EFR for TW-TS-001 or HRv1
- * for TW-TS-002, but instead checks only the extension mode bits.
- * This simplification is allowed by libosmo-mgcp-client API:
- * struct mgcp_codec_param has dedicated fields for fr_efr_twts001
- * and hr_twts002 parameters, and the code in libosmo-mgcp-client
- * then emits the corresponding a=fmtp lines only when the SDP
- * includes those codecs to which these attributes apply.
+ /* Some codecs require fmtp parameters, either always (AMR)
+ * or conditionally (FR & EFR with TW-TS-001, HR with TW-TS-002).
+ * Use the new fmtp string API to insert them into our outgoing
+ * CRCX/MDCX.
*/
- if (lchan->conn->user_plane.rtp_extensions & OSMO_RTP_EXT_TWTS001) {
- verb_info->param_present = true;
- verb_info->param.fr_efr_twts001_present = true;
- verb_info->param.fr_efr_twts001 = true;
- }
- if (lchan->conn->user_plane.rtp_extensions & OSMO_RTP_EXT_TWTS002) {
- verb_info->param_present = true;
- verb_info->param.hr_twts002_present = true;
- verb_info->param.hr_twts002 = true;
+ switch (codec) {
+ case CODEC_AMR_8000_1:
+ if (bss_side)
+ amr_oa = 1;
+ else
+ amr_oa = lchan->conn->sccp.msc->amr_octet_aligned;
+ snprintf(verb_info->ptmap[0].fmtp,
+ sizeof(verb_info->ptmap[0].fmtp),
+ "octet-align=%d", amr_oa);
+ break;
+ case CODEC_GSM_8000_1:
+ case CODEC_GSMEFR_8000_1:
+ if (lchan->conn->user_plane.rtp_extensions & OSMO_RTP_EXT_TWTS001)
+ OSMO_STRLCPY_ARRAY(verb_info->ptmap[0].fmtp, "tw-ts-001=1");
+ break;
+ case CODEC_GSMHR_8000_1:
+ if (lchan->conn->user_plane.rtp_extensions & OSMO_RTP_EXT_TWTS002)
+ OSMO_STRLCPY_ARRAY(verb_info->ptmap[0].fmtp, "tw-ts-002=1");
+ break;
+ default:
+ break;
}
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/41631?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id869c9fa33a3ca6fecd30d5630741fbbf21cf6ed
Gerrit-Change-Number: 41631
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/41630?usp=email )
Change subject: MGW control: migrate to new API for codecs and payload types
......................................................................
MGW control: migrate to new API for codecs and payload types
struct mgcp_conn_peer in libosmo-mgcp-client API used to have a
mandatory codecs[] array for codec specification and an optional
ptmap[] array to be used only when the default payload type needs
to be overridden. But now the codecs[] array is deprecated,
and new API features (see following patches) require the use of
ptmap[] array, with mandatory specification of payload type by
the MGCP client. Convert osmo-bsc to this new API.
Change-Id: Iafc38a3da64ce7c2f060a32864174dcde9f57b56
---
M src/osmo-bsc/lchan_rtp_fsm.c
1 file changed, 59 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/30/41630/1
diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c
index 559a30b..c348833 100644
--- a/src/osmo-bsc/lchan_rtp_fsm.c
+++ b/src/osmo-bsc/lchan_rtp_fsm.c
@@ -21,6 +21,7 @@
*/
#include <osmocom/core/fsm.h>
+#include <osmocom/gsm/protocol/gsm_48_103.h>
#include <osmocom/gsm/rtp_extensions.h>
#include <osmocom/netif/rtp.h>
#include <osmocom/mgcp_client/mgcp_client_endpoint_fsm.h>
@@ -894,9 +895,36 @@
}
}
+static int chan_mode_to_mgcp_aoip_pt(enum mgcp_codecs codec)
+{
+ switch (codec) {
+ case CODEC_GSM_8000_1:
+ return OSMO_AOIP_RTP_PT_FR1;
+
+ case CODEC_GSMEFR_8000_1:
+ return OSMO_AOIP_RTP_PT_EFR;
+
+ case CODEC_GSMHR_8000_1:
+ return OSMO_AOIP_RTP_PT_HR1;
+
+ case CODEC_AMR_8000_1:
+ return OSMO_AOIP_RTP_PT_AMR;
+
+ case CODEC_CLEARMODE:
+ return OSMO_AOIP_RTP_PT_CSD;
+
+ default:
+ /* Error: unknown codec */
+ return -1;
+ }
+}
+
static int chan_mode_to_mgcp_bss_pt(enum mgcp_codecs codec)
{
switch (codec) {
+ case CODEC_GSM_8000_1:
+ return RTP_PT_GSM_FULL;
+
case CODEC_GSMHR_8000_1:
return RTP_PT_GSM_HALF;
@@ -906,9 +934,11 @@
case CODEC_AMR_8000_1:
return RTP_PT_AMR;
+ case CODEC_CLEARMODE:
+ return RTP_PT_CSDATA;
+
default:
- /* Not an error, we just leave it to libosmo-mgcp-client to
- * decide over the PT. */
+ /* Error: unknown codec */
return -1;
}
}
@@ -917,34 +947,46 @@
{
enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->activate.ch_mode_rate.chan_mode,
lchan->type == GSM_LCHAN_TCH_H? false : true);
- int custom_pt;
+ int pt;
if (codec < 0) {
LOG_LCHAN(lchan, LOGL_ERROR,
"Unable to determine MGCP codec type for %s in chan-mode %s\n",
gsm_chan_t_name(lchan->type), gsm48_chan_mode_name(lchan->activate.ch_mode_rate.chan_mode));
- verb_info->codecs_len = 0;
+ verb_info->ptmap_len = 0;
return;
}
- verb_info->codecs[0] = codec;
- verb_info->codecs_len = 1;
-
- /* Setup custom payload types (only for BSS side and when required) */
- custom_pt = chan_mode_to_mgcp_bss_pt(codec);
- if (bss_side && custom_pt > 0) {
- verb_info->ptmap[0].codec = codec;
- verb_info->ptmap[0].pt = custom_pt;
- verb_info->ptmap_len = 1;
+ /* The new libosmo-mgcp-client API requires us to provide explicit
+ * payload type number for every codec - no more internal defaulting.
+ * Legacy payload types used on IPA/Osmocom Abis-IP are defined in
+ * <osmocom/netif/rtp.h> as RTP_PT_*, new TS 48.103 (AoIP user plane)
+ * payload types are defined in <osmocom/gsm/protocol/gsm_48_103.h>
+ * as OSMO_AOIP_RTP_PT_*.
+ */
+ if (bss_side)
+ pt = chan_mode_to_mgcp_bss_pt(codec);
+ else
+ pt = chan_mode_to_mgcp_aoip_pt(codec);
+ if (pt < 0) {
+ LOG_LCHAN(lchan, LOGL_ERROR,
+ "Unable to determine RTP payload type for %s in chan-mode %s\n",
+ gsm_chan_t_name(lchan->type), gsm48_chan_mode_name(lchan->activate.ch_mode_rate.chan_mode));
+ verb_info->ptmap_len = 0;
+ return;
}
+ verb_info->ptmap[0].codec = codec;
+ verb_info->ptmap[0].pt = pt;
+ verb_info->ptmap_len = 1;
+
/* AMR requires additional parameters to be set up (framing mode) */
- if (verb_info->codecs[0] == CODEC_AMR_8000_1) {
+ if (codec == CODEC_AMR_8000_1) {
verb_info->param_present = true;
verb_info->param.amr_octet_aligned_present = true;
}
- if (bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) {
+ if (bss_side && codec == CODEC_AMR_8000_1) {
/* FIXME: At the moment all BTSs we support are using the
* octet-aligned payload format. However, in the future
* we may support BTSs that are using bandwidth-efficient
@@ -952,7 +994,7 @@
* that distinguishes by the BTS model which mode to use. */
verb_info->param.amr_octet_aligned = true;
}
- else if (!bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) {
+ else if (!bss_side && codec == CODEC_AMR_8000_1) {
verb_info->param.amr_octet_aligned = lchan->conn->sccp.msc->amr_octet_aligned;
}
@@ -988,5 +1030,5 @@
bool mgcp_codec_is_picked(const struct mgcp_conn_peer *verb_info, enum mgcp_codecs codec)
{
- return verb_info->codecs[0] == codec;
+ return verb_info->ptmap[0].codec == codec;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/41630?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iafc38a3da64ce7c2f060a32864174dcde9f57b56
Gerrit-Change-Number: 41630
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/41632?usp=email )
Change subject: E1: add support for AMR in TW-TS-006 enhanced RTP format
......................................................................
E1: add support for AMR in TW-TS-006 enhanced RTP format
AMR speech codec on E1 BTS is currently possible at all only with
tw-e1abis-mgw and not with classic osmo-mgw. This new E1 AMR MGW
support includes all 3 possible RTP formats from the beginning:
RFC 4867 BWE, RFC 4867 OA and TW-TS-006 OAX.
Because TW-TS-006 is non-standard outside of GSM networks
specifically built with Osmocom+ThemWi hybrid stack, use of this
RTP format has to be explicitly requested by the CN via BSSMAP
extension of TW-TS-003, which OsmoBSC already understands.
Add TW-TS-006 to the set of supported RTP extensions with E1 BTS,
joining already supported TW-TS-001 and TW-TS-002.
Change-Id: Icf859ca4975079c91a2f41190da0ce94aa686365
---
M src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/lchan_rtp_fsm.c
2 files changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/41632/1
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index 4c54632..c5363b8 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -545,7 +545,10 @@
* Note that specific BTS features are needed only for IP-based BTS;
* for E1 BTS no special support is needed from the BTS itself in order
* to enable these RTP extensions, as they are implemented entirely
- * in the BSC-controlled MGW in this case.
+ * in the BSC-controlled MGW in this case. Furthermore, in the case of
+ * E1 BTS with either AMR or CSD, the MGW can be assumed to be tw-e1abis-mgw
+ * or a potential future Osmo-branded copy or derivative thereof,
+ * since classic osmo-mgw supports neither AMR nor CSD with E1 Abis.
*/
static void handle_rtp_extensions(struct gsm_subscriber_connection *conn,
struct gsm_bts *bts)
@@ -562,6 +565,9 @@
(osmo_bts_has_feature(&bts->features, BTS_FEAT_TWTS002) || is_e1_bts(bts)))
accepted_ext |= OSMO_RTP_EXT_TWTS002;
+ if ((requested_ext & OSMO_RTP_EXT_TWTS006) && is_e1_bts(bts))
+ accepted_ext |= OSMO_RTP_EXT_TWTS006;
+
conn->user_plane.rtp_extensions = accepted_ext;
}
diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c
index 8095378..7d80a73 100644
--- a/src/osmo-bsc/lchan_rtp_fsm.c
+++ b/src/osmo-bsc/lchan_rtp_fsm.c
@@ -987,6 +987,18 @@
*/
switch (codec) {
case CODEC_AMR_8000_1:
+ /* Right now AMR with TW-TS-006 is supported only on E1 BTS,
+ * in which case there is no BSS side, only AoIP side.
+ * However, if TW-TS-006 support gets added to IP-native
+ * OsmoBTS in the future, it will strictly require no-alteration
+ * pass-through from the BSC-associated MGW. Therefore,
+ * indicate this format on both sides when it is enabled. */
+ if (lchan->conn->user_plane.rtp_extensions & OSMO_RTP_EXT_TWTS006) {
+ OSMO_STRLCPY_ARRAY(verb_info->ptmap[0].fmtp,
+ "octet-align=1;tw-ts-006=1");
+ break;
+ }
+ /* standard 3GPP/Osmocom/etc operation with RFC 4867 format */
if (bss_side)
amr_oa = 1;
else
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/41632?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icf859ca4975079c91a2f41190da0ce94aa686365
Gerrit-Change-Number: 41632
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/41629?usp=email )
Change subject: mgcp_client: add fmtp string to struct ptmap
......................................................................
mgcp_client: add fmtp string to struct ptmap
Allow MGCP clients to pass arbitrary fmtp strings to MGWs, beyond
the fixed set of parameters captured in legacy struct mgcp_codec_param,
and set a different fmtp string per payload type, as opposed to global.
Credit: this patch is a derivative work based on Neels Hofmeyr's
patch If58590bda8627519ff07e0b6f43aa47a274f052b from WIP branch
neels/sdp, reduced to just libosmo-mgcp-client.
Present necessity: this functional addition is needed in order to
allow osmo-bsc to pass this construct to its MGW when the CN
requested the use of TW-TS-006 extended payload format for AMR:
a=rtpmap:112 AMR/8000/1
a=fmtp:112 octet-align=1; tw-ts-006=1
AMR codec fmtp parameter tw-ts-006 (defined in TW-TS-006 spec
section B.1) is not supported by osmo-mgw; however, it is supported
by tw-e1abis-mgw, which is the OsmoBSC-compatible MGW needed for
E1 BTS with AMR and CSD.
Change-Id: I84ba2ed5ab9d379ac0b675520796446ad6ee0710
---
M TODO-RELEASE
M include/osmocom/mgcp_client/mgcp_client.h
M include/osmocom/mgcp_client/mgcp_client_fsm.h
M src/libosmo-mgcp-client/mgcp_client.c
4 files changed, 49 insertions(+), 30 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/29/41629/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..582e4ce 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
+libosmo-mgcp-client ABI break struct ptmap extended
diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h
index d53f442..2cddf00 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -78,6 +78,9 @@
/*! payload type number (96-127) */
unsigned int pt;
+
+ /*! the MGCP 'a=fmtp:N <...>' string, e.g. "mode-set=1,2,3;octet-align=0". */
+ char fmtp[256];
};
int ptmap_cmp(const struct ptmap *a, const struct ptmap *b);
diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h
index dbd5128..3e31e9c 100644
--- a/include/osmocom/mgcp_client/mgcp_client_fsm.h
+++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h
@@ -57,10 +57,11 @@
* address is set. If != MGCP_CONN_NONE, force this conn mode. */
enum mgcp_connection_mode conn_mode;
- /*! If the codec requires additional format parameters (fmtp), those cann be set here, see also
- * mgcp_common.h */
- bool param_present;
- struct mgcp_codec_param param;
+ /*! Deprectated, use ptmap[].fmtp instead.
+ * Global codec params. In case the codec requires additional format parameters (fmtp), those can be set
+ * here, see also mgcp_common.h. The format parameters will be applied on all codecs where applicable. */
+ bool param_present OSMO_DEPRECATED_OUTSIDE_LIBOSMOMGCPCLIENT("use ptmap[].fmtp instead");
+ struct mgcp_codec_param param OSMO_DEPRECATED_OUTSIDE_LIBOSMOMGCPCLIENT("use ptmap[].fmtp instead");
};
struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt,
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 4924be4..09c273c 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -1425,34 +1425,45 @@
MSGB_PRINTF_OR_RET("\r\n");
/* Add optional codec parameters (fmtp) */
- if (mgcp_msg->param_present) {
- for (i = 0; i < mgcp_msg->ptmap_len; i++) {
- pt = mgcp_msg->ptmap[i].pt;
- switch (mgcp_msg->ptmap[i].codec) {
- case CODEC_AMR_8000_1:
- case CODEC_AMRWB_16000_1:
- if (!mgcp_msg->param.amr_octet_aligned_present)
- break;
- MSGB_PRINTF_OR_RET("a=fmtp:%u octet-align=%d\r\n",
- pt, (int)mgcp_msg->param.amr_octet_aligned);
+ for (i = 0; i < mgcp_msg->ptmap_len; i++) {
+ pt = mgcp_msg->ptmap[i].pt;
+
+ /* Add fmtp string, if any is set. */
+ if (mgcp_msg->ptmap[i].fmtp[0]) {
+ MSGB_PRINTF_OR_RET("a=fmtp:%u %s\r\n", pt,
+ mgcp_msg->ptmap[i].fmtp);
+ continue;
+ }
+
+ /* LEGACY COMPAT. Fill in fmtp with the legacy mgcp_msg->param,
+ * if any, when no individual fmtp is set on the codec. */
+ if (!mgcp_msg->param_present)
+ continue;
+
+ switch (mgcp_msg->ptmap[i].codec) {
+ case CODEC_AMR_8000_1:
+ case CODEC_AMRWB_16000_1:
+ if (!mgcp_msg->param.amr_octet_aligned_present)
break;
- case CODEC_GSM_8000_1:
- case CODEC_GSMEFR_8000_1:
- if (!mgcp_msg->param.fr_efr_twts001_present)
- break;
- MSGB_PRINTF_OR_RET("a=fmtp:%u tw-ts-001=%d\r\n",
- pt, (int)mgcp_msg->param.fr_efr_twts001);
+ MSGB_PRINTF_OR_RET("a=fmtp:%u octet-align=%d\r\n",
+ pt, (int)mgcp_msg->param.amr_octet_aligned);
+ break;
+ case CODEC_GSM_8000_1:
+ case CODEC_GSMEFR_8000_1:
+ if (!mgcp_msg->param.fr_efr_twts001_present)
break;
- case CODEC_GSMHR_8000_1:
- if (!mgcp_msg->param.hr_twts002_present)
- break;
- MSGB_PRINTF_OR_RET("a=fmtp:%u tw-ts-002=%d\r\n",
- pt, (int)mgcp_msg->param.hr_twts002);
+ MSGB_PRINTF_OR_RET("a=fmtp:%u tw-ts-001=%d\r\n",
+ pt, (int)mgcp_msg->param.fr_efr_twts001);
+ break;
+ case CODEC_GSMHR_8000_1:
+ if (!mgcp_msg->param.hr_twts002_present)
break;
- default:
- /* no parameters for the remaining codecs */
- break;
- }
+ MSGB_PRINTF_OR_RET("a=fmtp:%u tw-ts-002=%d\r\n",
+ pt, (int)mgcp_msg->param.hr_twts002);
+ break;
+ default:
+ /* no parameters for the remaining codecs */
+ break;
}
}
@@ -1686,5 +1697,8 @@
rc = OSMO_CMP(a->codec, b->codec);
if (rc)
return rc;
- return OSMO_CMP(a->pt, b->pt);
+ rc = OSMO_CMP(a->pt, b->pt);
+ if (rc)
+ return rc;
+ return strcmp(a->fmtp, b->fmtp);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/41629?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I84ba2ed5ab9d379ac0b675520796446ad6ee0710
Gerrit-Change-Number: 41629
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/41536?usp=email )
Change subject: amr_trau: add osmo_amrt_fill_with_dhf() function
......................................................................
amr_trau: add osmo_amrt_fill_with_dhf() function
It is useful to have a function that fills struct osmo_amrt_if
with constant DHF bits. In an E1 Abis MGW this function is needed
in order to emit DHFs on Abis DL during initial or prolonged absence
of RTP input; it can also be used in a transcoding CN MGW to emit
DHFs in RTP on AoIP interface during similar conditions of no G.711
input being transcoded or TFO-handled.
Depends: I1f8f8ec36cc13270a1d1fa633583107317abe894 (libosmocore)
Change-Id: Ie085e593d6326072295a8cedf2c2c103883f93d5
---
M TODO-RELEASE
M include/osmocom/trau/amr_trau.h
M src/Makefile.am
A src/trau/amr_misc.c
4 files changed, 97 insertions(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..d07457d 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
+libosmotrau add osmo_amrt_fill_with_dhf()
diff --git a/include/osmocom/trau/amr_trau.h b/include/osmocom/trau/amr_trau.h
index 83780e6..9ae0f65 100644
--- a/include/osmocom/trau/amr_trau.h
+++ b/include/osmocom/trau/amr_trau.h
@@ -344,4 +344,6 @@
const struct osmo_amrt_if *fr,
enum osmo_amrt_rtp_format fmt);
+int osmo_amrt_fill_with_dhf(struct osmo_amrt_if *fr, enum osmo_amr_type mode);
+
/*! @} */
diff --git a/src/Makefile.am b/src/Makefile.am
index 8e1453c..4dc7cfe 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,7 +52,8 @@
-no-undefined \
$(NULL)
libosmotrau_la_LIBADD = $(COMMONLIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS)
-libosmotrau_la_SOURCES = trau/amr_rtp.c \
+libosmotrau_la_SOURCES = trau/amr_misc.c \
+ trau/amr_rtp.c \
trau/amr_trau.c \
trau/csd_ra2.c \
trau/csd_v110.c \
diff --git a/src/trau/amr_misc.c b/src/trau/amr_misc.c
new file mode 100644
index 0000000..47db8fc
--- /dev/null
+++ b/src/trau/amr_misc.c
@@ -0,0 +1,92 @@
+/*
+ * AMR TRAU interworking facility: miscellaneous functions.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <errno.h>
+
+#include <osmocom/core/bits.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/codec/codec.h>
+#include <osmocom/trau/amr_trau.h>
+
+/*! \addgroup amr_trau
+ * @{
+ */
+
+/*! Fill AMR frame buffer with constant DHF
+ *
+ * \param[out] fr AMR frame buffer in intermediate format of the present
+ * library.
+ * \param[in] mode One of 8 AMR codec modes, AMR_4_75 through AMR_12_2.
+ * \returns 0 if successful, or negative if \ref mode is invalid.
+ *
+ * IMPORTANT NOTE: unlike osmo_amrt_decode_trau_frame() and
+ * osmo_amrt_decode_rtp(), this function does NOT fully fill out
+ * struct osmo_amrt_if - instead it operates as follows:
+ *
+ * - frame_class, cmi, cmi_valid and s_bits are set by this function.
+ *
+ * - Fields related to CMR, RIF, TA+DTXd+TFOE and 3GPP Rel4 TFO configuration
+ * protocol are the responsibility of the application. If they were
+ * already filled before calling this function, they will not be overwritten;
+ * alternatively the application may fill them after calling this function.
+ *
+ * This function is needed for implementation of an MGW that interfaces to
+ * E1 Abis in the place of a TRAU: during prolonged absence of RTP input
+ * (not yet connected through, call on hold etc), the BTS needs to be
+ * supplied with valid traffic other than endless No_Data frames; filling
+ * with constant DHFs, with mode selected per CMR from the BTS/CCU, is
+ * the simplest solution. The resulting effect is also indistinguishable
+ * from a real TRAU operating with G.711 A-law (although not mu-law)
+ * when that G.711 A-law input is pure 0xD5 silence.
+ */
+int osmo_amrt_fill_with_dhf(struct osmo_amrt_if *fr, enum osmo_amr_type mode)
+{
+ const uint16_t *param;
+
+ switch (mode) {
+ case AMR_4_75:
+ param = osmo_amr_dhf_4_75;
+ break;
+ case AMR_5_15:
+ param = osmo_amr_dhf_5_15;
+ break;
+ case AMR_5_90:
+ param = osmo_amr_dhf_5_90;
+ break;
+ case AMR_6_70:
+ param = osmo_amr_dhf_6_70;
+ break;
+ case AMR_7_40:
+ param = osmo_amr_dhf_7_40;
+ break;
+ case AMR_7_95:
+ param = osmo_amr_dhf_7_95;
+ break;
+ case AMR_10_2:
+ param = osmo_amr_dhf_10_2;
+ break;
+ case AMR_12_2:
+ param = osmo_amr_dhf_12_2;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ fr->frame_class = OSMO_AMRT_FC_SPEECH_GOOD;
+ fr->cmi = mode;
+ fr->cmi_valid = true;
+ osmo_amr_param_to_sbits(fr->s_bits, param, mode);
+
+ return 0;
+}
+
+/*! @} */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/41536?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ie085e593d6326072295a8cedf2c2c103883f93d5
Gerrit-Change-Number: 41536
Gerrit-PatchSet: 4
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41614?usp=email )
Change subject: sctp_proxy: fix wrong operator in connecting/3
......................................................................
sctp_proxy: fix wrong operator in connecting/3
We need to update the map, thus the update operation (`=>`) needs
to be used, not the matching (`:=`). We're lucky that eNBs usually
do not send anything before the MME responds to the S1Setup request;
otherwise the S1GW would crash here due to a mismatch.
Change-Id: I26d8a8da5cce89324a9e1150e4ecdf2084d097c8
---
M src/sctp_proxy.erl
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl
index ad58d4b..458c53a 100644
--- a/src/sctp_proxy.erl
+++ b/src/sctp_proxy.erl
@@ -133,7 +133,7 @@
#{tx_queue := Pending} = S) ->
s1gw_metrics:ctr_inc(?S1GW_CTR_S1AP_PROXY_UPLINK_PACKETS_QUEUED),
s1gw_metrics:gauge_inc(?S1GW_GAUGE_S1AP_PROXY_UPLINK_PACKETS_QUEUED),
- {keep_state, S#{tx_queue := [Data | Pending]}};
+ {keep_state, S#{tx_queue => [Data | Pending]}};
%% Handle an #sctp_assoc_change event (connection state)
connecting(info, {sctp, _Socket, MmeAddr, MmePort,
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41614?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I26d8a8da5cce89324a9e1150e4ecdf2084d097c8
Gerrit-Change-Number: 41614
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>