<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19526">View Change</a></p><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 make 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>While in that module anyway, MULTICASTRTP_LOCAL_ADDRESS and<br>MULTICASTRTP_LOCAL_PORT are now being set as well.<br><br>ASTERISK-30281<br><br>Change-Id: I872ac49477100f4eb33891d46efc6ca21ec81aa4<br>---<br>M channels/chan_rtp.c<br>A doc/CHANGES-staging/chan_rtp.txt<br>2 files changed, 39 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/26/19526/1</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..12f07c1 100644</span><br><span>--- a/channels/chan_rtp.c</span><br><span>+++ b/channels/chan_rtp.c</span><br><span>@@ -230,6 +230,12 @@</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, &control_address);</span><br><span style="color: hsl(120, 100%, 40%);">+   pbx_builtin_setvar_helper(chan, "MULTICASTRTP_LOCAL_ADDRESS",</span><br><span style="color: hsl(120, 100%, 40%);">+               ast_sockaddr_stringify_addr(&control_address));</span><br><span style="color: hsl(120, 100%, 40%);">+   pbx_builtin_setvar_helper(chan, "MULTICASTRTP_LOCAL_PORT",</span><br><span style="color: hsl(120, 100%, 40%);">+          ast_sockaddr_stringify_port(&control_address));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>        ast_channel_unlock(chan);</span><br><span> </span><br><span>        ao2_ref(fmt, -1);</span><br><span>@@ -381,9 +387,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>diff --git a/doc/CHANGES-staging/chan_rtp.txt b/doc/CHANGES-staging/chan_rtp.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..fe49494</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/chan_rtp.txt</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: chan_rtp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+MULTICASTRTP_LOCAL_ADDRESS and MULTICASTRTP_LOCAL_PORT channel</span><br><span style="color: hsl(120, 100%, 40%);">+variables are now available for MulticastRTP channels.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19526">change 19526</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/+/19526"/><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-Change-Id: I872ac49477100f4eb33891d46efc6ca21ec81aa4 </div>
<div style="display:none"> Gerrit-Change-Number: 19526 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>