Attention is currently required from: falconia, fixeria, pespin.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32740 )
Change subject: gsm620: make osmo_hr_check_sid compatible with RFC 5993
......................................................................
Patch Set 2:
(2 comments)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/32740/comment/e685a4c8_4ef0857b
PS1, Line 7: gsm630: make osmo_hr_check_sid compatible with RFC 5993
> I assume you meant gsm620 here.
Done
Patchset:
PS1:
> @fixeria - I concur. […]
I was thinking about normalizing the to one format at the beginning but I quickly realized that this would mean that we would often end up with two unnecessary conversions. This is something I wanted to avoid.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32740
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I25728299b757fbc87dd1b3f5adaec9b8b240c5d1
Gerrit-Change-Number: 32740
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
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>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 23 May 2023 07:57:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: falconia, fixeria, pespin.
Hello Jenkins Builder, falconia, pespin, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/32740
to look at the new patch set (#2).
Change subject: gsm620: make osmo_hr_check_sid compatible with RFC 5993
......................................................................
gsm620: make osmo_hr_check_sid compatible with RFC 5993
RFC 5993 specifies a one byte TOC at the beginning of the RTP payload,
while TS 101 318 does not have such a TOC byte. Since both formats are
used in the field, let's make sure that osmo_hr_check_sid will work with
both formats.
Related: OS#5688
Related: OS#5996
Change-Id: I25728299b757fbc87dd1b3f5adaec9b8b240c5d1
---
M src/codec/gsm620.c
1 file changed, 28 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/32740/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32740
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I25728299b757fbc87dd1b3f5adaec9b8b240c5d1
Gerrit-Change-Number: 32740
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
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>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32290 )
(
6 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: mgcp_network: do not deliver RTP packets with unpatched PT
......................................................................
mgcp_network: do not deliver RTP packets with unpatched PT
When a call leg is set up, then the call agent (e.g. BSC, MSC, etc.)
will also negotiate a codec along with a payload type number. When
sending RTP packets, each RTP packet must also contain the negotiated
payload type number. To prevent the emission of RTP packets with an
incorrect payload type number, ensure that no packet is sent when
mgcp_patch_pt() fails.
Change-Id: I013a24c1e0f853557257368cfab9192d4611aafa
Related: OS#5461
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 20 insertions(+), 12 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 6b16907..33cd8af 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1164,18 +1164,9 @@
* 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_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");
+ if (mgcp_patch_pt(conn_dst, msg) < 0) {
+ LOGPENDP(endp, DRTP, LOGL_NOTICE, "unable to patch payload type RTP packet, discarding...\n");
+ return -EINVAL;
}
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32290
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I013a24c1e0f853557257368cfab9192d4611aafa
Gerrit-Change-Number: 32290
Gerrit-PatchSet: 8
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32506 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: mgcp_codec: move mgcp_codec_decide down
......................................................................
mgcp_codec: move mgcp_codec_decide down
In a follow up patch we intend to fix mgcp_codec_decide, since the
fixed version of mgcp_codec_decide will use some functions below its
current position let's move it down before fixing it to make reviewing
the changes easier.
Related: OS#5461
Change-Id: I2f2538ff912eae4d80d3b74b766e18c4da94d6b6
---
M src/libosmo-mgcp/mgcp_codec.c
1 file changed, 96 insertions(+), 81 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
msuraev: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c
index 003c4c4..7fada78 100644
--- a/src/libosmo-mgcp/mgcp_codec.c
+++ b/src/libosmo-mgcp/mgcp_codec.c
@@ -276,87 +276,6 @@
return -EINVAL;
}
-/* Check if the given codec is applicable on the specified endpoint
- * Helper function for mgcp_codec_decide() */
-static bool is_codec_compatible(const struct mgcp_endpoint *endp, const struct mgcp_rtp_codec *codec)
-{
- /* A codec name must be set, if not, this might mean that the codec
- * (payload type) that was assigned is unknown to us so we must stop
- * here. */
- if (!strlen(codec->subtype_name))
- return false;
-
- /* FIXME: implement meaningful checks to make sure that the given codec
- * is compatible with the given endpoint */
-
- return true;
-}
-
-/*! Decide for one suitable codec
- * \param[in] conn related rtp-connection.
- * \returns 0 on success, -EINVAL on failure. */
-int mgcp_codec_decide(struct mgcp_conn_rtp *conn)
-{
- struct mgcp_rtp_end *rtp;
- unsigned int i;
- struct mgcp_endpoint *endp;
- bool codec_assigned = false;
-
- endp = conn->conn->endp;
- rtp = &conn->end;
-
- /* This function works on the results the SDP/LCO parser has extracted
- * from the MGCP message. The goal is to select a suitable codec for
- * the given connection. When transcoding is available, the first codec
- * from the codec list is taken without further checking. When
- * transcoding is not available, then the choice must be made more
- * carefully. Each codec in the list is checked until one is found that
- * is rated compatible. The rating is done by the helper function
- * is_codec_compatible(), which does the actual checking. */
- for (i = 0; i < rtp->codecs_assigned; i++) {
- /* When no transcoding is available, avoid codecs that would
- * require transcoding. */
- if (endp->trunk->no_audio_transcoding && !is_codec_compatible(endp, &rtp->codecs[i])) {
- LOGP(DLMGCP, LOGL_NOTICE, "transcoding not available, skipping codec: %d/%s\n",
- rtp->codecs[i].payload_type, rtp->codecs[i].subtype_name);
- continue;
- }
-
- rtp->codec = &rtp->codecs[i];
- codec_assigned = true;
- break;
- }
-
- /* FIXME: To the reviewes: This is problematic. I do not get why we
- * need to reset the packet_duration_ms depending on the codec
- * selection. I thought it were all 20ms? Is this to address some
- * cornercase. (This piece of code was in the code path before,
- * together with the note: "TODO/XXX: Store this per codec and derive
- * it on use" */
- if (codec_assigned) {
- if (rtp->maximum_packet_time >= 0
- && rtp->maximum_packet_time * rtp->codec->frame_duration_den >
- rtp->codec->frame_duration_num * 1500)
- rtp->packet_duration_ms = 0;
-
- return 0;
- }
-
- return -EINVAL;
-}
-
-/* Check if the codec has a specific AMR mode (octet-aligned or bandwith-efficient) set. */
-bool mgcp_codec_amr_align_mode_is_indicated(const struct mgcp_rtp_codec *codec)
-{
- if (codec->param_present == false)
- return false;
- if (!codec->param.amr_octet_aligned_present)
- return false;
- if (strcmp(codec->subtype_name, "AMR") != 0)
- return false;
- return true;
-}
-
/* Return true if octet-aligned is set in the given codec. Default to octet-aligned=0, i.e. bandwidth-efficient mode.
* See RFC4867 "RTP Payload Format for AMR and AMR-WB" sections "8.1. AMR Media Type Registration" and "8.2. AMR-WB
* Media Type Registration":
@@ -463,6 +382,87 @@
return codec_convertible;
}
+/* Check if the given codec is applicable on the specified endpoint
+ * Helper function for mgcp_codec_decide() */
+static bool is_codec_compatible(const struct mgcp_endpoint *endp, const struct mgcp_rtp_codec *codec)
+{
+ /* A codec name must be set, if not, this might mean that the codec
+ * (payload type) that was assigned is unknown to us so we must stop
+ * here. */
+ if (!strlen(codec->subtype_name))
+ return false;
+
+ /* FIXME: implement meaningful checks to make sure that the given codec
+ * is compatible with the given endpoint */
+
+ return true;
+}
+
+/*! Decide for one suitable codec
+ * \param[in] conn related rtp-connection.
+ * \returns 0 on success, -EINVAL on failure. */
+int mgcp_codec_decide(struct mgcp_conn_rtp *conn)
+{
+ struct mgcp_rtp_end *rtp;
+ unsigned int i;
+ struct mgcp_endpoint *endp;
+ bool codec_assigned = false;
+
+ endp = conn->conn->endp;
+ rtp = &conn->end;
+
+ /* This function works on the results the SDP/LCO parser has extracted
+ * from the MGCP message. The goal is to select a suitable codec for
+ * the given connection. When transcoding is available, the first codec
+ * from the codec list is taken without further checking. When
+ * transcoding is not available, then the choice must be made more
+ * carefully. Each codec in the list is checked until one is found that
+ * is rated compatible. The rating is done by the helper function
+ * is_codec_compatible(), which does the actual checking. */
+ for (i = 0; i < rtp->codecs_assigned; i++) {
+ /* When no transcoding is available, avoid codecs that would
+ * require transcoding. */
+ if (endp->trunk->no_audio_transcoding && !is_codec_compatible(endp, &rtp->codecs[i])) {
+ LOGP(DLMGCP, LOGL_NOTICE, "transcoding not available, skipping codec: %d/%s\n",
+ rtp->codecs[i].payload_type, rtp->codecs[i].subtype_name);
+ continue;
+ }
+
+ rtp->codec = &rtp->codecs[i];
+ codec_assigned = true;
+ break;
+ }
+
+ /* FIXME: To the reviewes: This is problematic. I do not get why we
+ * need to reset the packet_duration_ms depending on the codec
+ * selection. I thought it were all 20ms? Is this to address some
+ * cornercase. (This piece of code was in the code path before,
+ * together with the note: "TODO/XXX: Store this per codec and derive
+ * it on use" */
+ if (codec_assigned) {
+ if (rtp->maximum_packet_time >= 0
+ && rtp->maximum_packet_time * rtp->codec->frame_duration_den >
+ rtp->codec->frame_duration_num * 1500)
+ rtp->packet_duration_ms = 0;
+
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
+/* Check if the codec has a specific AMR mode (octet-aligned or bandwith-efficient) set. */
+bool mgcp_codec_amr_align_mode_is_indicated(const struct mgcp_rtp_codec *codec)
+{
+ if (codec->param_present == false)
+ return false;
+ if (!codec->param.amr_octet_aligned_present)
+ return false;
+ if (strcmp(codec->subtype_name, "AMR") != 0)
+ return false;
+ return true;
+}
+
/* Find the payload type number configured for a specific codec by SDP.
* For example, IuUP gets assigned a payload type number, and the endpoint needs to translate that to the number
* assigned to "AMR" on the other conn (by a=rtpmap:N).
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32506
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I2f2538ff912eae4d80d3b74b766e18c4da94d6b6
Gerrit-Change-Number: 32506
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged