<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15400">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_refer: Always serialize calls to refer_progress_notify<br><br>refer_progress_notify wasn't always being called from the progress<br>serializer. This could allow clearing notification->progress->sub<br>in one thread while another was trying to use it.<br><br>* Instances where refer_progress_notify was being called in-line,<br> have been changed to use ast_sip_push_task().<br><br>Change-Id: Idcf1934c4e873f2c82e2d106f8d9f040caf9fa1e<br>---<br>M res/res_pjsip_refer.c<br>1 file changed, 18 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c</span><br><span>index 5d98f9e..b60a842 100644</span><br><span>--- a/res/res_pjsip_refer.c</span><br><span>+++ b/res/res_pjsip_refer.c</span><br><span>@@ -560,7 +560,9 @@</span><br><span> notification = refer_progress_notification_alloc(attended->progress, response,</span><br><span> PJSIP_EVSUB_STATE_TERMINATED);</span><br><span> if (notification) {</span><br><span style="color: hsl(0, 100%, 40%);">- refer_progress_notify(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_sip_push_task(attended->progress->serializer, refer_progress_notify, notification)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> }</span><br><span> </span><br><span>@@ -616,7 +618,9 @@</span><br><span> PJSIP_EVSUB_STATE_TERMINATED);</span><br><span> </span><br><span> if (notification) {</span><br><span style="color: hsl(0, 100%, 40%);">- refer_progress_notify(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_sip_push_task(refer->progress->serializer, refer_progress_notify, notification)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> } else if (refer->progress) {</span><br><span> /* If attended transfer and progress monitoring is being done attach a frame hook so we can monitor it */</span><br><span>@@ -637,7 +641,9 @@</span><br><span> ast_channel_name(chan));</span><br><span> </span><br><span> if (notification) {</span><br><span style="color: hsl(0, 100%, 40%);">- refer_progress_notify(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_sip_push_task(refer->progress->serializer, refer_progress_notify, notification)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> }</span><br><span> </span><br><span>@@ -660,7 +666,9 @@</span><br><span> ast_channel_name(chan));</span><br><span> </span><br><span> if (notification) {</span><br><span style="color: hsl(0, 100%, 40%);">- refer_progress_notify(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_sip_push_task(refer->progress->serializer, refer_progress_notify, notification)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> </span><br><span> ao2_cleanup(refer->progress);</span><br><span>@@ -680,7 +688,9 @@</span><br><span> ast_channel_name(chan));</span><br><span> </span><br><span> if (notification) {</span><br><span style="color: hsl(0, 100%, 40%);">- refer_progress_notify(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_sip_push_task(refer->progress->serializer, refer_progress_notify, notification)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> </span><br><span> ast_channel_lock(chan);</span><br><span>@@ -1155,7 +1165,9 @@</span><br><span> </span><br><span> if (notification) {</span><br><span> /* The refer_progress_notify function will call ao2_cleanup on this for us */</span><br><span style="color: hsl(0, 100%, 40%);">- refer_progress_notify(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_sip_push_task(progress->serializer, refer_progress_notify, notification)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(notification);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15400">change 15400</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/+/15400"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Idcf1934c4e873f2c82e2d106f8d9f040caf9fa1e </div>
<div style="display:none"> Gerrit-Change-Number: 15400 </div>
<div style="display:none"> Gerrit-PatchSet: 7 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.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>
<div style="display:none"> Gerrit-MessageType: merged </div>