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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_pjsip.c: Improve answer failure log messages.<br><br>* Balanced the session->inv_session refs on answer failure.<br><br>Change-Id: I33542d639d37e692cb46550b972a5fcfc3b804b8<br>---<br>M channels/chan_pjsip.c<br>1 file changed, 21 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c<br>index 0160425..e4e8fa5 100644<br>--- a/channels/chan_pjsip.c<br>+++ b/channels/chan_pjsip.c<br>@@ -672,7 +672,19 @@<br>         pjsip_inv_dec_ref(session->inv_session);<br> #endif<br> <br>-      return (status == PJ_SUCCESS) ? 0 : -1;<br>+      if (status != PJ_SUCCESS) {<br>+          char err[PJ_ERR_MSG_SIZE];<br>+<br>+                pj_strerror(status, err, sizeof(err));<br>+               ast_log(LOG_WARNING,"Cannot answer '%s': %s\n",<br>+                    ast_channel_name(session->channel), err);<br>+         /*<br>+            * Return this value so we can distinguish between this<br>+               * failure and the threadpool synchronous push failing.<br>+               */<br>+          return -2;<br>+   }<br>+    return 0;<br> }<br> <br> /*! \brief Function called by core when we should answer a PJSIP session */<br>@@ -680,6 +692,7 @@<br> {<br>       struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);<br>      struct ast_sip_session *session;<br>+     int res;<br> <br>   if (ast_channel_state(ast) == AST_STATE_UP) {<br>                 return 0;<br>@@ -700,11 +713,15 @@<br>         can occur between this thread and bridging (specifically when native bridging<br>         attempts to do direct media) */<br>    ast_channel_unlock(ast);<br>-     if (ast_sip_push_task_synchronous(session->serializer, answer, session)) {<br>-                ast_log(LOG_WARNING, "Unable to push answer task to the threadpool. Cannot answer call\n");<br>+        res = ast_sip_push_task_synchronous(session->serializer, answer, session);<br>+        if (res) {<br>+           if (res == -1) {<br>+                     ast_log(LOG_ERROR,"Cannot answer '%s': Unable to push answer task to the threadpool.\n",<br>+                           ast_channel_name(session->channel));<br> #ifdef HAVE_PJSIP_INV_SESSION_REF<br>-          pjsip_inv_dec_ref(session->inv_session);<br>+                  pjsip_inv_dec_ref(session->inv_session);<br> #endif<br>+         }<br>             ao2_ref(session, -1);<br>                 ast_channel_lock(ast);<br>                return -1;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7235">change 7235</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/7235"/><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: I33542d639d37e692cb46550b972a5fcfc3b804b8 </div>
<div style="display:none"> Gerrit-Change-Number: 7235 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>