neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29857 )
Change subject: AMR->IuUP: log conversion, like for the flipside
......................................................................
AMR->IuUP: log conversion, like for the flipside
For IuUP -> AMR, we log a message like
Convert IuUP -> AMR OA:...
Do the same for the direction AMR -> IuUP.
Related: SYS#5092
Change-Id: I525685a7dedb6d5d1deecbd026844cbe23193fac
---
M src/libosmo-mgcp/mgcp_iuup.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/57/29857/1
diff --git a/src/libosmo-mgcp/mgcp_iuup.c b/src/libosmo-mgcp/mgcp_iuup.c
index 7d0e822..6bbc504 100644
--- a/src/libosmo-mgcp/mgcp_iuup.c
+++ b/src/libosmo-mgcp/mgcp_iuup.c
@@ -680,6 +680,7 @@
irp->u.data.fqc = amr_hdr->q ? IUUP_FQC_FRAME_GOOD : IUUP_FQC_FRAME_BAD;
irp->u.data.rfci = rfci;
msgb_pull(msg, 2);
+ LOGP(DLMGCP, LOGL_DEBUG, "Convert AMR OA -> IuUP: ft %d, len %d\n", amr_hdr->ft, msgb_length(msg));
} else {
uint8_t *amr_bwe_hdr = (uint8_t *) msgb_data(msg);
int8_t ft;
@@ -707,6 +708,7 @@
return rc;
}
msgb_trim(msg, iuup_length);
+ LOGP(DLMGCP, LOGL_DEBUG, "Convert AMR BE -> IuUP: ft %d -> rfci %d len %d\n", ft, rfci, msgb_length(msg));
}
irp->oph.msg->l3h = msgb_put(irp->oph.msg, msgb_length(msg));
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29857
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I525685a7dedb6d5d1deecbd026844cbe23193fac
Gerrit-Change-Number: 29857
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29855 )
Change subject: IuUP->AMR: do not patch payload type a second time
......................................................................
IuUP->AMR: do not patch payload type a second time
When converting IuUP to AMR/RTP, bridge_iuup_to_rtp_peer() sets the AMR
side's payload type number and then calls mgcp_send(). In mgcp_send(),
do not attempt to patch the payload type number a second time.
In mgcp_send(), skip patching payload type numbers if the source side is
IuUP. This matches exactly the case of converting IuUP to AMR/RTP.
There already is a check for IuUP, but for the wrong side. Drop that one
and explain in a comment why.
Move the comment about transcoding into the failure branch, where it is
relevant and doesn't clutter the new explanation of payload type
patching conditions.
Related: OS#5720
Related: SYS#5092
Change-Id: I7c722cd959f76bd104ae4941d182c77e5c025867
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 13 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/55/29855/1
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index bb8cfa3..29c0dc2 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1160,17 +1160,21 @@
else
LOGPENDP(endp, DRTP, LOGL_DEBUG, "delivering RTCP packet...\n");
- /* FIXME: It is legal that the payload type on the egress connection is
- * different from the payload type that has been negotiated on the
- * ingress connection. Essentially the codecs are the same so we can
- * match them and patch the payload type. However, if we can not find
- * the codec pendant (everything ist equal except the PT), we are of
- * course unable to patch the payload type. A situation like this
- * should not occur if transcoding is consequently avoided. Until
- * we have transcoding support in osmo-mgw we can not resolve this. */
- if (is_rtp && !mgcp_conn_rtp_is_iuup(conn_dst)) {
+ /* Patch the payload type number: translate from conn_src to conn_dst.
+ * Do not patch for IuUP, where the correct payload type number is already set in bridge_iuup_to_rtp_peer():
+ * IuUP -> AMR: calls this function, skip patching if conn_src is IuUP.
+ * {AMR or IuUP} -> IuUP: calls mgcp_udp_send() directly, skipping this function: No need to examine dst. */
+ if (is_rtp && !mgcp_conn_rtp_is_iuup(conn_src)) {
rc = mgcp_patch_pt(conn_src, conn_dst, msg);
if (rc < 0) {
+ /* FIXME: It is legal that the payload type on the egress connection is
+ * different from the payload type that has been negotiated on the
+ * ingress connection. Essentially the codecs are the same so we can
+ * match them and patch the payload type. However, if we can not find
+ * the codec pendant (everything ist equal except the PT), we are of
+ * course unable to patch the payload type. A situation like this
+ * should not occur if transcoding is consequently avoided. Until
+ * we have transcoding support in osmo-mgw we can not resolve this. */
LOGPENDP(endp, DRTP, LOGL_DEBUG,
"can not patch PT because no suitable egress codec was found.\n");
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29855
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I7c722cd959f76bd104ae4941d182c77e5c025867
Gerrit-Change-Number: 29855
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29853 )
Change subject: AMR->IuUP: do not crash on AMR data before IuUP Init
......................................................................
AMR->IuUP: do not crash on AMR data before IuUP Init
When translating AMR to IuUP, when AMR data arrives before the IuUP side
has negotiated an IuUP Initialization, do not crash osmo-mgw, but return
failure and drop the AMR packet.
As soon as IuUP Initialization occured and RFCIs are defined, the AMR
starts to pass through to the IuUP side.
Related: SYS#5092
Change-Id: Id9efb7e523d8d9af988e4bf4f5e925839204f934
---
M src/libosmo-mgcp/mgcp_iuup.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/53/29853/1
diff --git a/src/libosmo-mgcp/mgcp_iuup.c b/src/libosmo-mgcp/mgcp_iuup.c
index 90021f3..e3b7efa 100644
--- a/src/libosmo-mgcp/mgcp_iuup.c
+++ b/src/libosmo-mgcp/mgcp_iuup.c
@@ -98,7 +98,8 @@
uint8_t rfci_cnt = 0;
unsigned match_bytes = (unsigned)osmo_amr_bytes(ft);
struct osmo_iuup_rnl_prim *irp = conn_rtp->iuup.init_ind;
- OSMO_ASSERT(irp);
+ if (!irp)
+ return -1;
/* TODO: cache this somehow */
for (i = 0; i < ARRAY_SIZE(irp->u.status.u.initialization.rfci); i++) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29853
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Id9efb7e523d8d9af988e4bf4f5e925839204f934
Gerrit-Change-Number: 29853
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmocom-bb/+/29851 )
Change subject: trxcon: configure.ac: set -std=gnu11
......................................................................
trxcon: configure.ac: set -std=gnu11
The majority of Osmocom projects require -std=gnu11, and so we do.
Change-Id: Ia22adb18ea34690ef8e46dbf02308cbb1541a7ee
---
M src/host/trxcon/configure.ac
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/51/29851/2
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/29851
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ia22adb18ea34690ef8e46dbf02308cbb1541a7ee
Gerrit-Change-Number: 29851
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
fixeria has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmocom-bb/+/29852 )
Change subject: Revert "host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore"
......................................................................
Revert "host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore"
This reverts commit c5d9507b5ddd04d4ac14dc009b6df20c3098e2cc.
Using osmo_ubit2sbit() was a bad idea because this function treats
the input buffer as ubits (while we deal with usbits) and produces
absolute sbit values: either 127 or -127. This is wrong, because
all intermediate usbit values are getting converted to -127.
This bug remained unnoticed so far because trxcon is mostly used in
combination with fake_trx.py, a virtual Um interface which simulates
ideal RF conditions by default and feeds trxcon with 'perfect' bits.
Change-Id: I3a32da19c9f419d51d55b301461ce28ce11b2249
---
M src/host/trxcon/src/trx_if.c
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/52/29852/2
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/29852
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I3a32da19c9f419d51d55b301461ce28ce11b2249
Gerrit-Change-Number: 29852
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/29852 )
Change subject: Revert "host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore"
......................................................................
Revert "host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore"
This reverts commit c5d9507b5ddd04d4ac14dc009b6df20c3098e2cc.
Using osmo_ubit2sbit() was a bad idea because this function treats
the input buffer as ubits (while we deal with usbits) and produces
absolute sbit values: either 127 or -127. This is wrong, because
all intermediate usbit values are getting converted to -127.
This bug remained unnoticed so far because trxcon is mostly used in
combination with fake_trx.py, a virtual Um interface which simulates
ideal RF conditions by default and feeds trxcon with 'perfect' bits.
Change-Id: I3a32da19c9f419d51d55b301461ce28ce11b2249
---
M src/host/trxcon/src/trx_if.c
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/52/29852/1
diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index 7b1ca99..6f225ee 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -621,7 +621,12 @@
toa256 = ((int16_t) (buf[6] << 8) | buf[7]);
/* Copy and convert bits {254..0} to sbits {-127..127} */
- osmo_ubit2sbit(bits, buf + 8, 148);
+ for (unsigned int i = 0; i < 148; i++) {
+ if (buf[8 + i] == 255)
+ bits[i] = -127;
+ else
+ bits[i] = 127 - buf[8 + i];
+ }
if (tn >= 8) {
LOGPFSMSL(trx->fi, DTRXD, LOGL_ERROR, "Illegal TS %d\n", tn);
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/29852
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I3a32da19c9f419d51d55b301461ce28ce11b2249
Gerrit-Change-Number: 29852
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: fixeria.
msuraev has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/29847 )
Change subject: trxcon: grecefully exit on receipt of SIGTERM
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/29847
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Id33e598b5c7a7a474a383f815cdbda65b29d25a0
Gerrit-Change-Number: 29847
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 23 Oct 2022 14:07:36 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment