dexter has uploaded this change for review.

View Change

mgcp_network: do not try to convert RTCP packets

Make sure that RTCP packets do not enter the code path where AMR OA and BWE
is converted. The conversion will fail and the RTCP packet will be
dropped.

Change-Id: Ic850344d8b5f7710d12e4553a4033b733dced52b
Related: SYS#5902
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 4 insertions(+), 4 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/06/27606/1
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 0ea8c25..ba4d5ee 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -75,7 +75,7 @@
rtpconn_rate_ctr_add(conn_rtp, endp, id, 1);
}

-static int rx_rtp(struct msgb *msg);
+static int rx_rtp(struct msgb *msg, enum rtp_proto proto);

static bool addr_is_any(const struct osmo_sockaddr *osa)
{
@@ -1511,14 +1511,14 @@
/* Forward a copy of the RTP data to a debug ip/port */
forward_data_tap(fd->fd, &conn_src->tap_in, msg);

- rc = rx_rtp(msg);
+ rc = rx_rtp(msg, proto);

out:
msgb_free(msg);
return rc;
}

-static int rx_rtp(struct msgb *msg)
+static int rx_rtp(struct msgb *msg, enum rtp_proto proto)
{
struct osmo_rtp_msg_ctx *mc = OSMO_RTP_MSG_CTX(msg);
struct mgcp_conn_rtp *conn_src = mc->conn_src;
@@ -1534,7 +1534,7 @@
* framing mode (octet-aligned vs. bandwith-efficient is explicitly
* define, then we check if the incoming payload matches that
* expectation. */
- if (amr_oa_bwe_convert_indicated(conn_src->end.codec)) {
+ if (proto == MGCP_PROTO_RTP && amr_oa_bwe_convert_indicated(conn_src->end.codec)) {
int oa = amr_oa_check((char*)msgb_data(msg), msgb_length(msg));
if (oa < 0)
return -1;

To view, visit change 27606. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ic850344d8b5f7710d12e4553a4033b733dced52b
Gerrit-Change-Number: 27606
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>
Gerrit-MessageType: newchange