<p>neels <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/24145">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  neels: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">add osmo_mgcpc_ep_ci_get_remote_rtp_info()<br><br>So far an mgcp_client user can get the RTP address+port information that<br>the MGW has returned upon a CRCX. Add this function to return the other<br>RTP end, i.e. address+port that the MGW was told to send RTP to.<br><br>This will be used to fix the MGCP in osmo-bsc, which so far mixes up the<br>two RTP ends and compares the MSC's RTP address+port with the MGW's one<br>and hence fails to skip unnecessary MDCX.<br><br>Change-Id: Ibb488925827d9dc0ccb1f8d6d84728745d086793<br>---<br>M include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h<br>M src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c<br>2 files changed, 14 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h b/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h</span><br><span>index 736da22..78e3a41 100644</span><br><span>--- a/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h</span><br><span>+++ b/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h</span><br><span>@@ -23,6 +23,8 @@</span><br><span> bool osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(const struct osmo_mgcpc_ep_ci *ci, struct sockaddr_storage *dest);</span><br><span> bool osmo_mgcpc_ep_ci_get_crcx_info_to_osmux_cid(const struct osmo_mgcpc_ep_ci *ci, uint8_t* cid);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+const struct mgcp_conn_peer *osmo_mgcpc_ep_ci_get_remote_rtp_info(const struct osmo_mgcpc_ep_ci *ci);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> void osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci,</span><br><span>                          enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info,</span><br><span>                         struct osmo_fsm_inst *notify,</span><br><span>diff --git a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c</span><br><span>index 2b94840..a55281c 100644</span><br><span>--- a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c</span><br><span>+++ b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c</span><br><span>@@ -508,7 +508,8 @@</span><br><span>       osmo_mgcpc_ep_fsm_check_state_chg_after_response(ci->ep->fi);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/*! Return the MGW's RTP port information for this connection, as returned by the last CRCX/MDCX OK message. */</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Return the MGW's local RTP port information for this connection, i.e. the local port that MGW is receiving on, as</span><br><span style="color: hsl(120, 100%, 40%);">+ * returned by the last CRCX-OK / MDCX-OK message. */</span><br><span> const struct mgcp_conn_peer *osmo_mgcpc_ep_ci_get_rtp_info(const struct osmo_mgcpc_ep_ci *ci)</span><br><span> {</span><br><span>      ci = osmo_mgcpc_ep_check_ci((struct osmo_mgcpc_ep_ci*)ci);</span><br><span>@@ -519,6 +520,16 @@</span><br><span>    return &ci->rtp_info;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Return the MGW's remote RTP port information for this connection, i.e. the remote RTP port that the MGW is sending</span><br><span style="color: hsl(120, 100%, 40%);">+ * to, as sent to the MGW by the last CRCX / MDCX message. */</span><br><span style="color: hsl(120, 100%, 40%);">+const struct mgcp_conn_peer *osmo_mgcpc_ep_ci_get_remote_rtp_info(const struct osmo_mgcpc_ep_ci *ci)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     ci = osmo_mgcpc_ep_check_ci((struct osmo_mgcpc_ep_ci*)ci);</span><br><span style="color: hsl(120, 100%, 40%);">+    if (!ci)</span><br><span style="color: hsl(120, 100%, 40%);">+              return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+  return &ci->verb_info;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! Return the MGW's RTP port information for this connection, as returned by the last CRCX/MDCX OK message. */</span><br><span> bool osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(const struct osmo_mgcpc_ep_ci *ci, struct sockaddr_storage *dest)</span><br><span> {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-mgw/+/24145">change 24145</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/c/osmo-mgw/+/24145"/><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-Change-Id: Ibb488925827d9dc0ccb1f8d6d84728745d086793 </div>
<div style="display:none"> Gerrit-Change-Number: 24145 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>