<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/5816">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">SDP: Set the remote c= line in RTP instance.<br><br>Change-Id: I23b646392082deab65bedeb19b12dcbcb9216d0c<br>---<br>M include/asterisk/sdp_state.h<br>M main/sdp_state.c<br>2 files changed, 36 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/16/5816/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/include/asterisk/sdp_state.h b/include/asterisk/sdp_state.h<br>index c2122fb..b8209e1 100644<br>--- a/include/asterisk/sdp_state.h<br>+++ b/include/asterisk/sdp_state.h<br>@@ -146,6 +146,10 @@<br> * \param sdp_state<br> * \param sdp<br> *<br>+ * \note It is assumed that the passed in SDP has been checked for sanity<br>+ * already. e.g., There are no syntax errors, a c= line is reachable for<br>+ * each m= line, etc...<br>+ *<br> * \retval 0 Success<br> * \retval non-0 Failure<br> *<br>diff --git a/main/sdp_state.c b/main/sdp_state.c<br>index a5f1167..f27da21 100644<br>--- a/main/sdp_state.c<br>+++ b/main/sdp_state.c<br>@@ -997,9 +997,30 @@<br> const struct ast_sdp *remote_sdp,<br> const struct ast_sdp_m_line *remote_m_line)<br> {<br>+ struct ast_sdp_c_line *c_line;<br>+ struct ast_sockaddr *addrs;<br>+<br> if (!rtp) {<br> /* This is a dummy stream */<br> return;<br>+ }<br>+<br>+ c_line = remote_m_line->c_line;<br>+ if (!c_line) {<br>+ c_line = remote_sdp->c_line;<br>+ }<br>+ /*<br>+ * There must be a c= line somewhere but that would be an error by<br>+ * the far end that should have been caught by a validation check<br>+ * before we processed the SDP.<br>+ */<br>+ ast_assert(c_line != NULL);<br>+<br>+ if (ast_sockaddr_resolve(&addrs, c_line->address, PARSE_PORT_FORBID, AST_AF_UNSPEC) > 0) {<br>+ /* Apply connection information to the RTP instance */<br>+ ast_sockaddr_set_port(addrs, remote_m_line->port);<br>+ ast_rtp_instance_set_remote_address(rtp->instance, addrs);<br>+ ast_free(addrs);<br> }<br> <br> if (ast_sdp_options_get_rtcp_mux(options)<br>@@ -1011,9 +1032,7 @@<br> AST_RTP_INSTANCE_RTCP_STANDARD);<br> }<br> <br>- if (ast_sdp_options_get_ice(options) == AST_SDP_ICE_ENABLED_STANDARD) {<br>- update_ice(state, rtp->instance, options, remote_sdp, remote_m_line);<br>- }<br>+ update_ice(state, rtp->instance, options, remote_sdp, remote_m_line);<br> }<br> <br> /*!<br>@@ -1066,12 +1085,19 @@<br> }<br> }<br> <br>- c_line = remote_sdp->c_line;<br>- if (remote_m_line->c_line) {<br>- c_line = remote_m_line->c_line;<br>+ c_line = remote_m_line->c_line;<br>+ if (!c_line) {<br>+ c_line = remote_sdp->c_line;<br> }<br>+ /*<br>+ * There must be a c= line somewhere but that would be an error by<br>+ * the far end that should have been caught by a validation check<br>+ * before we processed the SDP.<br>+ */<br>+ ast_assert(c_line != NULL);<br> <br> if (ast_sockaddr_resolve(&addrs, c_line->address, PARSE_PORT_FORBID, AST_AF_UNSPEC) > 0) {<br>+ /* Apply connection information to the UDPTL instance */<br> ast_sockaddr_set_port(addrs, remote_m_line->port);<br> ast_udptl_set_peer(udptl->instance, addrs);<br> ast_free(addrs);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5816">change 5816</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.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.asterisk.org/5816"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I23b646392082deab65bedeb19b12dcbcb9216d0c </div>
<div style="display:none"> Gerrit-Change-Number: 5816 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>