<p> Attention is currently required from: Michael Bradeen, Stanislav Abramenkov. </p>
<p>Michael Bradeen <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/20028">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_pubsub: subscription cleanup changes<br><br>There are two main parts of the change associated with this<br>commit. These are driven by the change in call order of<br>pubsub_on_rx_refresh and pubsub_on_evsub_state by pjproject<br>when an in-dialog SUBSCRIBE is received.<br><br>First, the previous behavior was for pjproject to call<br>pubsub_on_rx_refresh before calling pubsub_on_evsub_state<br>when an in-dialog SUBSCRIBE was received that changes the<br>subscription state.<br><br>If that change was a termination due to a re-SUBSCRIBE with<br>an expires of 0, we used to use the call to pubsub_on_rx_refresh<br>to set the substate of the evsub to TERMINATE_PENDING before<br>pjproject could call pubsub_on_evsub_state.<br><br>This substate let pubsub_on_evsub_state know that the<br>subscription TERMINATED event could be ignored as there was<br>still a subsequent NOTIFY that needed to be generated and<br>another call to pubsub_on_evsub_state to come with it.<br><br>That NOTIFY was sent via serialized_pubsub_on_refresh_timeout<br>which would see the TERMINATE_PENDING state and transition it<br>to TERMINATE_IN_PROGRESS before triggering another call to<br>pubsub_on_evsub_state (which now would clean up the evsub.)<br><br>The new pjproject behavior is to call pubsub_on_evsub_state<br>before pubsub_on_rx_refresh. This means we no longer can set<br>the state to TERMINATE_PENDING to tell pubsub_on_evsub_state<br>that it can ignore the first TERMINATED event.<br><br>To handle this, we now look directly at the event type,<br>method type and the expires value to determine whether we<br>want to ignore the event or use it to trigger the evsub<br>cleanup.<br><br>Second, pjproject now expects the NOTIFY to actually be sent<br>during pubsub_on_rx_refresh and avoids the protocol violation<br>inherent in sending a NOTIFY before the SUBSCRIBE is<br>acknowledged by caching the sent NOTIFY then sending it<br>after responding to the SUBSCRIBE.<br><br>This requires we send the NOTIFY using the non-serialized<br>pubsub_on_refresh_timeout directly and let pjproject handle<br>the protocol violation.<br><br>ASTERISK-30469<br><br>Change-Id: I05c1d91a44fe28244ae93faa4a2268a3332b5fd7<br>---<br>M res/res_pjsip_pubsub.c<br>1 file changed, 108 insertions(+), 49 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/20028/3</pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/20028">change 20028</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/+/20028"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I05c1d91a44fe28244ae93faa4a2268a3332b5fd7 </div>
<div style="display:none"> Gerrit-Change-Number: 20028 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-CC: Stanislav Abramenkov <stas.abramenkov@gmail.com> </div>
<div style="display:none"> Gerrit-Attention: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Stanislav Abramenkov <stas.abramenkov@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>