<p>Alexei Gradinari has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9033">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjsip_options: handle modification of qualify_frequency in realtime<br><br>Currentrly pjsip_options code does not handle the situation when the<br>qualify_frequency was changed in realtime database.<br>Only 'module reload res_pjsip' helps.<br><br>This patch add a check on contact update observer if the contact's<br>qualify_frequency is different that aor's qualify_frequency.<br>If the qualify_frequency was modified then synchronize<br>the pjsip_options AOR local state.<br><br>ASTERISK-27872<br><br>Change-Id: Id55210a18e62ed5d35a88e408d5fe84a3c513c62<br>---<br>M res/res_pjsip/pjsip_options.c<br>1 file changed, 23 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/33/9033/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c<br>index d05d7bd..0f9d46e 100644<br>--- a/res/res_pjsip/pjsip_options.c<br>+++ b/res/res_pjsip/pjsip_options.c<br>@@ -2206,6 +2206,7 @@<br> static void contact_observer_updated(const void *obj)<br> {<br>         struct sip_options_contact_observer_task_data *task_data;<br>+    int is_qualify_changed=0;<br> <br>  task_data = ast_malloc(sizeof(*task_data));<br>   if (!task_data) {<br>@@ -2216,6 +2217,28 @@<br>     task_data->aor_options = ao2_find(sip_options_aors, task_data->contact->aor,<br>                 OBJ_SEARCH_KEY);<br>      if (!task_data->aor_options) {<br>+            if (task_data->contact->qualify_frequency) {<br>+                   is_qualify_changed=1;<br>+                }<br>+    } else if (task_data->contact->qualify_frequency != task_data->aor_options->qualify_frequency) {<br>+     is_qualify_changed=1;<br>+    }<br>+<br>+ if (is_qualify_changed) {<br>+            struct ast_sip_aor *aor;<br>+<br>+          aor = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "aor",<br>+                     task_data->contact->aor);<br>+              if (aor) {<br>+                   ast_debug(3, "AOR's '%s' qualify frequency has been modified. Synchronize an AOR local state\n",<br>+                               task_data->contact->aor);<br>+                      ast_sip_push_task_wait_serializer(management_serializer,<br>+                             sip_options_aor_observer_modified_task, (void *) aor);<br>+                       ao2_ref(aor, -1);<br>+            }<br>+    }<br>+<br>+ if (!task_data->aor_options) {<br>             ast_free(task_data);<br>          return;<br>       }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9033">change 9033</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/9033"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Id55210a18e62ed5d35a88e408d5fe84a3c513c62 </div>
<div style="display:none"> Gerrit-Change-Number: 9033 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.com> </div>