<p>Joshua Colp <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/7710">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjsip: Rewrite OPTIONS support with new eyes.<br><br>The OPTIONS support in PJSIP has organically grown, like<br>many things in Asterisk. It has been tweaked, changed, and<br>adapted based on situations run into. Unfortunately this has<br>taken its toll. Configuration file based objects have poor<br>performance and even dynamic ones aren't that great.<br><br>This change scraps the existing code and starts fresh<br>with new eyes. It leverages all of the APIs made available<br>such as sorcery observers and serializers to provide a<br>better implementation.<br><br>1. The state of contacts, AORs, and endpoints relevant to<br>the qualify process is maintained. This state can be updated<br>by external forces (such as a device registering/unregistering)<br>and also the reload process. This state also includes the<br>association between endpoints and AORs.<br><br>2. AORs are scheduled and not contacts. This reduces the amount<br>of work spent juggling scheduled items.<br><br>3. Manipulation of which AORs are being qualified and the<br>endpoint states all occur within a serializer to reduce the<br>conflict that can occur with multiple threads attempting to<br>modify things.<br><br>4. Operations regarding an AOR use a serializer specific to that<br>AOR.<br><br>5. AORs and endpoint state act as state compositors. They take<br>input from lower level objects (contacts feed AORs, AORs feed<br>endpoint state) and determine if a sufficient enough change has<br>occurred to be fed further up the chain.<br><br>6. Realtime is supported by using observers to know when a contact<br>has been registered. If state does not exist for the associated<br>AOR then it is retrieved and becomes active as appropriate.<br><br>The end result of all of this is best shown with a configuration file<br>of 3000 endpoints each with an AOR that has a static contact. In<br>the old code it would take over a minute to load and use all 8 of<br>my cores. This new code takes 2-3 seconds and barely touches the<br>CPU even while dealing with all of the OPTIONS requests.<br><br>ASTERISK-26806<br><br>Change-Id: I6a5ebbfca9001dfe933eaeac4d3babd8d2e6f082<br>---<br>M funcs/func_pjsip_contact.c<br>M include/asterisk/res_pjsip.h<br>M res/res_pjsip/location.c<br>M res/res_pjsip/pjsip_configuration.c<br>M res/res_pjsip/pjsip_options.c<br>5 files changed, 1,999 insertions(+), 1,417 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/10/7710/2</pre><p>To view, visit <a href="https://gerrit.asterisk.org/7710">change 7710</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/7710"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I6a5ebbfca9001dfe933eaeac4d3babd8d2e6f082 </div>
<div style="display:none"> Gerrit-Change-Number: 7710 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.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>