]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Eliminate duplicates from container.
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 16 Dec 2010 08:54:23 +0000 (08:54 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 16 Dec 2010 08:54:23 +0000 (08:54 +0000)
(closes issue #18091)
 Reported by: bunny
 Patches:
       20101006__issue18091.diff.txt uploaded by tilghman (license 14)
 Tested by: bunny

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@298477 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_dialgroup.c

index 467bc87fa85ec943a37a7e20b37b60e81cdd226e..b1fa78017ae842911db09d1ffdbd7e377ec219b0 100644 (file)
@@ -236,6 +236,11 @@ static int dialgroup_write(struct ast_channel *chan, const char *cmd, char *data
 
        if (strcasecmp(args.op, "add") == 0) {
                for (j = 0; j < inter.argc; j++) {
+                       /* Eliminate duplicates */
+                       if ((entry = ao2_find(grhead->entries, inter.faces[j], 0))) {
+                               ao2_ref(entry, -1);
+                               continue;
+                       }
                        if ((entry = ao2_alloc(sizeof(*entry), NULL))) {
                                ast_copy_string(entry->name, inter.faces[j], sizeof(entry->name));
                                ao2_link(grhead->entries, entry);