<p>Neels Hofmeyr <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/10118">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">IuUP hack: make RTP patching less general<br><br>We currently still patch over an RTP message to make it look like an IuUP<br>Initialization Ack specifically for the ip.access nano3G femto cell.<br><br>Be more specific about it:<br><br>- only patch over RTP in 'loopback' mode. osmo-msc specifically leaves the<br>  endpoint in loopback mode for this hack, so if we're not in 'loopback', then<br>  this hack is out of place.<br><br>- only patch over RTP if the header indicates an IuUP Initialization (check for<br>  0xe4 byte).<br><br>Change-Id: Ia9ec4debc138b34f6ca6a871a8778eafa6c0ba21<br>---<br>M src/libosmo-mgcp/mgcp_network.c<br>1 file changed, 11 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c</span><br><span>index 7d98d07..3ac93be 100644</span><br><span>--- a/src/libosmo-mgcp/mgcp_network.c</span><br><span>+++ b/src/libosmo-mgcp/mgcp_network.c</span><br><span>@@ -732,11 +732,18 @@</span><br><span>                      * 'e400', or it will reject the RAB assignment. It seems to not harm other femto</span><br><span>                     * cells (as long as we patch only the first RTP payload in each stream).</span><br><span>                     */</span><br><span style="color: hsl(0, 100%, 40%);">-                     if (!rtp_state->patched_first_rtp_payload) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       if (!rtp_state->patched_first_rtp_payload</span><br><span style="color: hsl(120, 100%, 40%);">+                      && conn_src->conn->mode == MGCP_CONN_LOOPBACK) {</span><br><span>                           uint8_t *data = (uint8_t *) & buf[12];</span><br><span style="color: hsl(0, 100%, 40%);">-                              data[0] = 0xe4;</span><br><span style="color: hsl(0, 100%, 40%);">-                         data[1] = 0x00;</span><br><span style="color: hsl(0, 100%, 40%);">-                         rtp_state->patched_first_rtp_payload = true;</span><br><span style="color: hsl(120, 100%, 40%);">+                               if (data[0] == 0xe0) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                        data[0] = 0xe4;</span><br><span style="color: hsl(120, 100%, 40%);">+                                       data[1] = 0x00;</span><br><span style="color: hsl(120, 100%, 40%);">+                                       rtp_state->patched_first_rtp_payload = true;</span><br><span style="color: hsl(120, 100%, 40%);">+                                       LOGP(DRTP, LOGL_DEBUG,</span><br><span style="color: hsl(120, 100%, 40%);">+                                             "endpoint:0x%x Patching over first two bytes"</span><br><span style="color: hsl(120, 100%, 40%);">+                                       " to fake an IuUP Initialization Ack\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                                            ENDPOINT_NUMBER(endp));</span><br><span style="color: hsl(120, 100%, 40%);">+                          }</span><br><span>                    }</span><br><span> </span><br><span>                        len = mgcp_udp_send(rtp_end->rtp.fd,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10118">change 10118</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/10118"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia9ec4debc138b34f6ca6a871a8778eafa6c0ba21 </div>
<div style="display:none"> Gerrit-Change-Number: 10118 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>