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 <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to