dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/32290 )


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 will also negoatiate 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, 19 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/90/32290/1

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 43ea161..1238c74 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_DEBUG, "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: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-MessageType: newchange

Reply via email to