<p>Richard Mudgett <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/7710">View Change</a></p><p>Patch set 1:</p><p>(1 comment)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/7710/1/res/res_pjsip/pjsip_options.c">File res/res_pjsip/pjsip_options.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7710/1/res/res_pjsip/pjsip_options.c@102">Patch Set #1, Line 102:</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;">   /*! \brief The names of the AORs feeding this compositor */<br>   struct ao2_container *aors;<br>   /*! \brief The number of AORs that are available */<br>   unsigned int available;<br>       /*! \brief The name of the endpoint */<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Clarify how you envision this working.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">endpoint compositor layer</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">struct sip_options_endpoint_aor_status {<br>   /*! \brief The last contributed available status of the named AOR (1 if available, 0 if not available) */<br>   char available;<br>   /*! \brief The name of the aor */<br>   char name[0];<br>}</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">struct sip_options_endpoint_state_compositor {<br>   /*! \brief The last contributed available status of the AORs feeding this compositor */<br>   struct ao2_container *aor_statuses;<br>   /*!<br>    * \brief Non-zero if the compositor is in normal operation. i.e. Not being setup/reconfigured.<br>    * \details The aor layer can only update its aor_statuses record when not active.<br>    * When active the aor layer can update its aor_statuses record, calculate the new<br>    * number of available aors, determine if the endpoint compositor changed state,<br>    * and report it.<br>    */<br>   char active;<br>   /*! \brief The name of the endpoint */<br>   char name[0];<br>};</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">endpoint_observer create/update<br>  Since the endpoint knows which aors are associated with the endpoint the endpoint layer must maintain the links between the endpoint and aor layers.<br>  * Gets/creates the associated endpoint compositor from the global container.<br>  * Sets the compositor to inactive.  The aor layer can only update its aor_statuses record.<br>  * Unlinks the compositor from the linked aors in the aor_statuses container using async requests to each aor.<br>  * Empties the aor_statuses container<br>  * For each aor listed in the endpoint aors option comma separated list:<br>  ** get/create the sip_options_aor record of an existing aor<br>  ** Failing to obtain a sip_options_aor record complain and skip to the next aor in the list<br>  ** Send a synchronous request to the sip_options layer.  (Synchronous to pace requests and because we need to get the current status.)  The request does:<br>  *** Create a new aor_status record<br>  *** Add the record to the aor_statuses container with the current aor status<br>  *** Add the endpoint compositor link to the compositor vector<br>  * With the compositor locked<br>  ** Traverse the current statuses in the aor_statuses container until find the first available aor status<br>  ** Report to the persistent endpoint the current ONLINE/OFFLINE status.<br>  ** Set the compositor active</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">endpoint_observer delete<br>  * Gets the associated endpoint compositor from the global container and unlinks it<br>  * Sets the compositor to inactive.  The aor layer can only update its aor_statuses record.<br>  * Unlinks the compositor from the linked aors in the aor_statuses container using synchronous requests to each aor.  Synchronous requests to avoid flooding the serializer during shutdown</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><br>aor compositor layer<br>  The aor observer callbacks need to maintain their flock of contacts, the scheduled qualify OPTIONS pings, and switching between qualifying/non-qualifying mode.<br>  The only member of the sip_options_aor struct not manipulated by the aor serializer is the sched id.  The management_serializer must start the scheduled pings to avoid starting it twice and stop the scheduled pings to avoid deadlock.</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><br>contact layer<br>  The contact layer is also managed by the aor compositor layer serializer basically as it is currently coded.</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><br>When an aor compositor reports a status change to the endpoint compositor layer:<br>  * With the compositor locked<br>  ** Set the new aor status into the aor_statuses container<br>  ** If the endpoint compositor is not active then<br>  *** Done<br>  ** If the new aor status is available then<br>  *** Report to the persistent endpoint the endpoint's ONLINE status.<br>  *** Done<br>  ** Traverse the current statuses in the aor_statuses container until find the first available aor status<br>  ** Report to the persistent endpoint the current ONLINE/OFFLINE status.</pre></li></ul></li></ul><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: comment </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: 1 </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>
<div style="display:none"> Gerrit-Comment-Date: Mon, 15 Jan 2018 05:09:16 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>