<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10076">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">MGCP_Test: Make sure PT in RTP-Stream and MGCP match up<br><br>At the moment the RTP stream emulation is left in its default<br>configuration, this means that the payload type that appears in the RTP<br>stream is always 0. This may mismatch the payload type that is<br>configured with MGCP.<br><br>If nothing else is set, we should make sure that whan we create and modify<br>flows, the RTP emulation is always reconfigured to use the payload-type that<br>we set in the flow parameters. The other rtp-emulation parameters should<br>be set to their defaults.<br><br>- Make sure f_flow_modify and f_flow_create set the rtp flow parameters<br>  properly.<br><br>Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e<br>Related:OS#3384<br>---<br>M mgw/MGCP_Test.ttcn<br>1 file changed, 21 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/76/10076/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn</span><br><span>index d816a71..659d5f1 100644</span><br><span>--- a/mgw/MGCP_Test.ttcn</span><br><span>+++ b/mgw/MGCP_Test.ttcn</span><br><span>@@ -58,6 +58,7 @@</span><br><span>         private function f_init(template MgcpEndpoint ep := omit) runs on dummy_CT {</span><br><span>                 var Result res;</span><br><span>              var uint32_t ssrc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                 if (initialized == false) {</span><br><span>                  initialized := true;</span><br><span> </span><br><span>@@ -243,7 +244,8 @@</span><br><span>               HostPort mgw,   /* mgw side */</span><br><span>               uint7_t pt,</span><br><span>          charstring codec,</span><br><span style="color: hsl(0, 100%, 40%);">-               MgcpConnectionId mgcp_conn_id optional</span><br><span style="color: hsl(120, 100%, 40%);">+                MgcpConnectionId mgcp_conn_id optional,</span><br><span style="color: hsl(120, 100%, 40%);">+               RtpemConfig rtp_cfg optional</span><br><span>         }</span><br><span> </span><br><span>        /* Create an RTP flow (bidirectional, or receive-only) */</span><br><span>@@ -256,6 +258,15 @@</span><br><span>             /* bind local RTP emulation socket */</span><br><span>                f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+               /* configure rtp-emulation */</span><br><span style="color: hsl(120, 100%, 40%);">+         if (ispresent(flow.rtp_cfg)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        f_rtpem_configure(pt, flow.rtp_cfg);</span><br><span style="color: hsl(120, 100%, 40%);">+          } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      var RtpemConfig rtp_cfg := c_RtpemDefaultCfg;</span><br><span style="color: hsl(120, 100%, 40%);">+                 rtp_cfg.tx_payload_type := flow.pt</span><br><span style="color: hsl(120, 100%, 40%);">+                    f_rtpem_configure(pt, rtp_cfg);</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>          if (one_phase) {</span><br><span>                     /* Connect flow to MGW using a CRCX that also contains an SDP</span><br><span>                         * part that tells the MGW where we are listening for RTP streams</span><br><span>@@ -299,6 +310,15 @@</span><br><span>             /* rebind local RTP emulation socket to the new address */</span><br><span>           f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+               /* reconfigure rtp-emulation */</span><br><span style="color: hsl(120, 100%, 40%);">+               if (ispresent(flow.rtp_cfg)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        f_rtpem_configure(pt, flow.rtp_cfg);</span><br><span style="color: hsl(120, 100%, 40%);">+          } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      var RtpemConfig rtp_cfg := c_RtpemDefaultCfg;</span><br><span style="color: hsl(120, 100%, 40%);">+                 rtp_cfg.tx_payload_type := flow.pt</span><br><span style="color: hsl(120, 100%, 40%);">+                    f_rtpem_configure(pt, rtp_cfg);</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>          /* connect MGW side RTP socket to the emulation-side RTP socket using SDP */</span><br><span>                 cmd := ts_MDCX(get_next_trans_id(), ep, mode, call_id, flow.mgcp_conn_id);</span><br><span>           cmd.sdp := ts_SDP(flow.em.hostname, flow.em.hostname, "23", "42",</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10076">change 10076</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10076"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e </div>
<div style="display:none"> Gerrit-Change-Number: 10076 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>