<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9353">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_t38: Decline T.38 stream on failure case.<br><br>When negotiating an incoming T.38 stream the code incorrectly<br>returned failure instead of a decline for the stream when a<br>problem occurred or the configuration didn't allow it. This<br>resulted in SDP offers being rejected with a 488 response<br>in all cases, even when another valid stream was present.<br><br>This change makes it so the stream is now declined. If no<br>streams are accepted a 488 response is sent while if at least<br>one stream is accepted all the declined streams are, well,<br>declined.<br><br>ASTERISK-27763<br><br>Change-Id: I88bcf793788c412a9839d111a5c736bf6867807c<br>---<br>M res/res_pjsip_t38.c<br>1 file changed, 5 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c</span><br><span>index 8091bb3..24d1a0e 100644</span><br><span>--- a/res/res_pjsip_t38.c</span><br><span>+++ b/res/res_pjsip_t38.c</span><br><span>@@ -749,17 +749,17 @@</span><br><span> </span><br><span>     if (!session->endpoint->media.t38.enabled) {</span><br><span>           ast_debug(3, "Declining; T.38 not enabled on session\n");</span><br><span style="color: hsl(0, 100%, 40%);">-             return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+            return 0;</span><br><span>    }</span><br><span> </span><br><span>        if (!(state = t38_state_get_or_alloc(session))) {</span><br><span style="color: hsl(0, 100%, 40%);">-               return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+            return 0;</span><br><span>    }</span><br><span> </span><br><span>        if ((session->t38state == T38_REJECTED) || (session->t38state == T38_DISABLED)) {</span><br><span>              ast_debug(3, "Declining; T.38 state is rejected or declined\n");</span><br><span>           t38_change_state(session, session_media, state, T38_DISABLED);</span><br><span style="color: hsl(0, 100%, 40%);">-          return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+            return 0;</span><br><span>    }</span><br><span> </span><br><span>        ast_copy_pj_str(host, stream->conn ? &stream->conn->addr : &sdp->conn->addr, sizeof(host));</span><br><span>@@ -768,7 +768,7 @@</span><br><span>     if (ast_sockaddr_resolve(&addrs, host, PARSE_PORT_FORBID, AST_AF_INET) <= 0) {</span><br><span>                /* The provided host was actually invalid so we error out this negotiation */</span><br><span>                ast_debug(3, "Declining; provided host is invalid\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+            return 0;</span><br><span>    }</span><br><span> </span><br><span>        /* Check the address family to make sure it matches configured */</span><br><span>@@ -776,7 +776,7 @@</span><br><span>              (ast_sockaddr_is_ipv4(addrs) && session->endpoint->media.t38.ipv6)) {</span><br><span>          /* The address does not match configured */</span><br><span>          ast_debug(3, "Declining, provided host does not match configured address family\n");</span><br><span style="color: hsl(0, 100%, 40%);">-          return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+            return 0;</span><br><span>    }</span><br><span> </span><br><span>        return 1;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9353">change 9353</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/9353"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I88bcf793788c412a9839d111a5c736bf6867807c </div>
<div style="display:none"> Gerrit-Change-Number: 9353 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>