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

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </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: 8758 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.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>