<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11662">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: Fix multiple of the same contact in "pjsip show contacts".<br><br>The code for gathering contacts could result in the same contact<br>being retrieved and added to the list multiple times. The container<br>which stores the contacts to display will now only allow a contact<br>to be added to it once instead of multiple times.<br><br>ASTERISK-28228<br><br>Change-Id: I805185cfcec03340f57d2b9e6cc43c49401812df<br>---<br>M res/res_pjsip/location.c<br>1 file changed, 5 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/62/11662/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c</span><br><span>index 1ddf630..a41128e 100644</span><br><span>--- a/res/res_pjsip/location.c</span><br><span>+++ b/res/res_pjsip/location.c</span><br><span>@@ -1035,7 +1035,11 @@</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- contacts_container = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, 0,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Retrieving all the contacts may result in finding the same contact multiple</span><br><span style="color: hsl(120, 100%, 40%);">+ * times. So that they don't get displayed multiple times we only allow a</span><br><span style="color: hsl(120, 100%, 40%);">+ * single one to be placed into the container.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ contacts_container = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT,</span><br><span> cli_contact_sort, cli_contact_compare);</span><br><span> if (!contacts_container) {</span><br><span> return NULL;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11662">change 11662</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/+/11662"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I805185cfcec03340f57d2b9e6cc43c49401812df </div>
<div style="display:none"> Gerrit-Change-Number: 11662 </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-MessageType: newchange </div>