<p>Salah Ahmed has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10431">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_sdp_rtp: Control endpoints media_address use per call basis<br><br>If we set media_address on an endpoint then all call on this endpoint<br>use that media address. Now by this changes, we can control<br>media_address use per call basis with a channel variable called<br>USE_MEDIA_ADDRESS. This channel variable has those following<br>effects.<br><br>USE_MEDIA_ADDRESS = "yes"<br>then pre-defined media address on endpoint will be used for<br>this call.<br><br>USE_MEDIA_ADDRESS = "no"<br>the behavior will be exactly the same as if we don't define<br>media_address.<br><br>USE_MEDIA_ADDRESS = NULL (Not Defined)<br>Then it has no effect, it works exactly the same as the original<br>configuration.<br><br>ASTERISK-28091<br><br>Change-Id: I852adbee9f8b034ec332fbe4e1b6692cb2939518<br>---<br>M res/res_pjsip_sdp_rtp.c<br>1 file changed, 9 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/31/10431/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c</span><br><span>index 7c7040e..b7360c7 100644</span><br><span>--- a/res/res_pjsip_sdp_rtp.c</span><br><span>+++ b/res/res_pjsip_sdp_rtp.c</span><br><span>@@ -1245,7 +1245,15 @@</span><br><span>      } else if (ast_strlen_zero(session->endpoint->media.address)) {</span><br><span>                hostip = ast_sip_get_host_ip_string(session->endpoint->media.rtp.ipv6 ? pj_AF_INET6() : pj_AF_INET());</span><br><span>         } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                hostip = session->endpoint->media.address;</span><br><span style="color: hsl(120, 100%, 40%);">+              if(!ast_strlen_zero(pbx_builtin_getvar_helper(session->channel, "USE_MEDIA_ADDRESS"))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 if(strcmp("yes", pbx_builtin_getvar_helper( session->channel, "USE_MEDIA_ADDRESS")) == 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+                            hostip = session->endpoint->media.address;</span><br><span style="color: hsl(120, 100%, 40%);">+                      } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                              hostip = ast_sip_get_host_ip_string(session->endpoint->media.rtp.ipv6 ? pj_AF_INET6() : pj_AF_INET());</span><br><span style="color: hsl(120, 100%, 40%);">+                  }</span><br><span style="color: hsl(120, 100%, 40%);">+             } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      hostip = session->endpoint->media.address;</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span>    }</span><br><span> </span><br><span>        if (ast_strlen_zero(hostip)) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10431">change 10431</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/10431"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I852adbee9f8b034ec332fbe4e1b6692cb2939518 </div>
<div style="display:none"> Gerrit-Change-Number: 10431 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Salah Ahmed <txrubel@gmail.com> </div>