[asterisk-commits] russell: branch russell/chan_refcount r82564 - /team/russell/chan_refcount/ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 17 01:45:32 CDT 2007


Author: russell
Date: Mon Sep 17 01:45:31 2007
New Revision: 82564

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82564
Log:
remove chan_misdn's use of channel_walk_locked by just using the provided
ast_complete_channels() function

Modified:
    team/russell/chan_refcount/channels/chan_misdn.c

Modified: team/russell/chan_refcount/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_misdn.c?view=diff&rev=82564&r1=82563&r2=82564
==============================================================================
--- team/russell/chan_refcount/channels/chan_misdn.c (original)
+++ team/russell/chan_refcount/channels/chan_misdn.c Mon Sep 17 01:45:31 2007
@@ -1399,31 +1399,9 @@
 	return RESULT_SUCCESS ;
 }
 
-static char *complete_ch_helper(const char *line, const char *word, int pos, int state, int rpos)
-{
-	struct ast_channel *c;
-	int which = 0;
-	char *ret;
-	if (pos != rpos)
-		return NULL;
-	for (c = ast_channel_walk_locked(NULL); c; c = ast_channel_walk_locked(c)) {
-		if (!strncasecmp(word, c->name, strlen(word))) {
-			if (++which > state)
-				break;
-		}
-		ast_mutex_unlock(&c->lock);
-	}
-	if (c) {
-		ret = ast_strdup(c->name);
-		ast_mutex_unlock(&c->lock);
-	} else
-		ret = NULL;
-	return ret;
-}
-
 static char *complete_ch(const char *line, const char *word, int pos, int state)
 {
-	return complete_ch_helper(line, word, pos, state, 3);
+	return ast_complete_channels(line, word, pos, state, 3);
 }
 
 static char *complete_debug_port (const char *line, const char *word, int pos, int state)




More information about the asterisk-commits mailing list