<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8542">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">main/cdr: Use ast_cli_completion_add for CDR channel completion.<br><br>Change-Id: Ie81830647a23aad61c1162583b6d50adbe6e7822<br>---<br>M main/cdr.c<br>1 file changed, 4 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/42/8542/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/cdr.c b/main/cdr.c<br>index 4acadf9..b0a48e1 100644<br>--- a/main/cdr.c<br>+++ b/main/cdr.c<br>@@ -3950,18 +3950,14 @@<br> /*! \brief Complete user input for 'cdr show' */<br> static char *cli_complete_show(struct ast_cli_args *a)<br> {<br>-      char *result = NULL;<br>  int wordlen = strlen(a->word);<br>-    int which = 0;<br>        struct ao2_iterator it_cdrs;<br>  struct cdr_object *cdr;<br> <br>    it_cdrs = ao2_iterator_init(active_cdrs_master, 0);<br>   while ((cdr = ao2_iterator_next(&it_cdrs))) {<br>-            if (!strncasecmp(a->word, cdr->party_a.snapshot->name, wordlen) &&<br>-                  (++which > a->n)) {<br>-                    result = ast_strdup(cdr->party_a.snapshot->name);<br>-                      if (result) {<br>+                if (!strncasecmp(a->word, cdr->party_a.snapshot->name, wordlen)) {<br>+                  if (ast_cli_completion_add(ast_strdup(cdr->party_a.snapshot->name))) {<br>                          ao2_ref(cdr, -1);<br>                             break;<br>                        }<br>@@ -3969,7 +3965,8 @@<br>              ao2_ref(cdr, -1);<br>     }<br>     ao2_iterator_destroy(&it_cdrs);<br>-  return result;<br>+<br>+    return NULL;<br> }<br> <br> static void cli_show_channels(struct ast_cli_args *a)<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8542">change 8542</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/8542"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ie81830647a23aad61c1162583b6d50adbe6e7822 </div>
<div style="display:none"> Gerrit-Change-Number: 8542 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>