<p>Joshua Colp <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/8374">View Change</a></p><p>Patch set 8:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p>(1 comment)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/8374/8/res/res_pjsip_notify.c">File res/res_pjsip_notify.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8374/8/res/res_pjsip_notify.c@847">Patch Set #8, Line 847:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> ast_channel_lock(ch);<br> dlg = ast_sip_session_get_dialog_for_channel(ch);<br>     ast_channel_unlock(ch);<br><br>     if (!dlg) {<br>           ast_channel_unref(ch);<br>                ast_log(LOG_NOTICE, "No active dialog for channel %s\n", channel_name);<br>             return INVALID_CHANNEL;<br>       }<br><br>   /* ast_sip_dialog_get_session needs a lock on the dlg */<br>      pjsip_dlg_inc_lock(dlg);<br>      session = ast_sip_dialog_get_session(dlg);<br>    pjsip_dlg_dec_lock(dlg);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Looking at this deeper and looking at what we make publicly available you can use the same method as chan_pjsip uses to get the session from the channel, which removes the addition of ast_sip_dialog_get_session and the messing with the dialog.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Provided the channel is locked like you did:</p><p style="white-space: pre-wrap; word-wrap: break-word;">struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);</p><p style="white-space: pre-wrap; word-wrap: break-word;">And then channel->session will contain the session.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/8374">change 8374</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/8374"/><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: comment </div>
<div style="display:none"> Gerrit-Change-Id: If7f3151a6d633e414d5dc319d5efc1443c43dd29 </div>
<div style="display:none"> Gerrit-Change-Number: 8374 </div>
<div style="display:none"> Gerrit-PatchSet: 8 </div>
<div style="display:none"> Gerrit-Owner: Nathan Bruning <nathan@iperity.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: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: lvl <digium@lvlconsultancy.nl> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 21 Mar 2018 10:34:07 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>