summaryrefslogtreecommitdiff
path: root/apps/app_setcdruserfield.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-06-06 02:29:18 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-06-06 02:29:18 +0000
commit1bac31d6bdcde7988dab684f053cc8fe5fafed41 (patch)
treebe967c9ab3099202d13219196b5f17284a939e78 /apps/app_setcdruserfield.c
parentbccc1171f049c459bd987d009a2f984e5aec4a8e (diff)
more efficient (and understandable) ast_channel_walk_locked, and vastly more efficient ast_channel_by_name_locked (bug #4265)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_setcdruserfield.c')
-rwxr-xr-xapps/app_setcdruserfield.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/apps/app_setcdruserfield.c b/apps/app_setcdruserfield.c
index 4684fdd8b..7e820db12 100755
--- a/apps/app_setcdruserfield.c
+++ b/apps/app_setcdruserfield.c
@@ -76,13 +76,7 @@ static int action_setcdruserfield(struct mansession *s, struct message *m)
astman_send_error(s, m, "No UserField specified");
return 0;
}
- c = ast_channel_walk_locked(NULL);
- while (c) {
- if (!strcasecmp(c->name, channel))
- break;
- ast_mutex_unlock(&c->lock);
- c = ast_channel_walk_locked(c);
- }
+ c = ast_get_channel_by_name_locked(channel);
if (!c) {
astman_send_error(s, m, "No such channel");
return 0;