<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19465">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_rtp: Make usage of ast_rtp_instance_get_local_address clearer<br><br>unicast_rtp_request() was setting the channel variables like this:<br><br>pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_ADDRESS",<br>    ast_sockaddr_stringify_addr(&local_address));<br>ast_rtp_instance_get_local_address(instance, &local_address);<br>pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_PORT",<br>    ast_sockaddr_stringify_port(&local_address));<br><br>...which made it appear that UNICASTRTP_LOCAL_ADDRESS was being<br>set before local_address was set.  In fact, the address part of<br>local_address was set earlier in the function, just not the port.<br>This was confusing however so ast_rtp_instance_get_local_address()<br>is now being called before setting UNICASTRTP_LOCAL_ADDRESS.<br><br>ASTERISK-30281<br><br>Change-Id: I872ac49477100f4eb33891d46efc6ca21ec81aa4<br>---<br>M channels/chan_rtp.c<br>1 file changed, 26 insertions(+), 1 deletion(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_rtp.c b/channels/chan_rtp.c</span><br><span>index 087ddae..0740c2c 100644</span><br><span>--- a/channels/chan_rtp.c</span><br><span>+++ b/channels/chan_rtp.c</span><br><span>@@ -381,9 +381,9 @@</span><br><span> </span><br><span>   ast_channel_tech_pvt_set(chan, instance);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_rtp_instance_get_local_address(instance, &local_address);</span><br><span>    pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_ADDRESS",</span><br><span>                ast_sockaddr_stringify_addr(&local_address));</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_rtp_instance_get_local_address(instance, &local_address);</span><br><span>    pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_PORT",</span><br><span>           ast_sockaddr_stringify_port(&local_address));</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19465">change 19465</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/19465"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I872ac49477100f4eb33891d46efc6ca21ec81aa4 </div>
<div style="display:none"> Gerrit-Change-Number: 19465 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>