[svn-commits] russell: trunk r89835 - /trunk/channels/chan_misdn.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 27 16:42:58 CST 2007


Author: russell
Date: Tue Nov 27 16:42:57 2007
New Revision: 89835

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89835
Log:
Bring in a small change from team/russell/chan_refcount

This replaces tab completion code with the use of a public function that
does the same thing

Modified:
    trunk/channels/chan_misdn.c

Modified: trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_misdn.c?view=diff&rev=89835&r1=89834&r2=89835
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Tue Nov 27 16:42:57 2007
@@ -1665,31 +1665,9 @@
 	return CLI_SUCCESS;
 }
 
-static char *complete_ch_helper(struct ast_cli_args *a, int rpos)
-{
-	struct ast_channel *c;
-	int which = 0;
-	char *ret;
-	if (a->pos != rpos)
-		return NULL;
-	for (c = ast_channel_walk_locked(NULL); c; c = ast_channel_walk_locked(c)) {
-		if (!strncasecmp(a->word, c->name, strlen(a->word))) {
-			if (++which > a->n)
-				break;
-		}
-		ast_channel_unlock(c);
-	}
-	if (c) {
-		ret = ast_strdup(c->name);
-		ast_channel_unlock(c);
-	} else
-		ret = NULL;
-	return ret;
-}
-
 static char *complete_ch(struct ast_cli_args *a)
 {
-	return complete_ch_helper(a, 3);
+	return ast_complete_channels(a->line, a->word, a->pos, a->n, 3);
 }
 
 static char *complete_debug_port (struct ast_cli_args *a)




More information about the svn-commits mailing list