aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_monitor.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-06 02:29:18 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-06 02:29:18 +0000
commit7b1b9f53ef47abd82c6faba12f4adcf721e622da (patch)
treebe967c9ab3099202d13219196b5f17284a939e78 /res/res_monitor.c
parentd39208dd35ce0ead92bf6a4b21361f3d13759589 (diff)
more efficient (and understandable) ast_channel_walk_locked, and vastly more efficient ast_channel_by_name_locked (bug #4265)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5853 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_monitor.c')
-rwxr-xr-xres/res_monitor.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c
index cff024dc9..62d35dd1d 100755
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -413,14 +413,7 @@ static int start_monitor_action(struct mansession *s, struct message *m)
astman_send_error(s, m, "No channel specified");
return 0;
}
- c = ast_channel_walk_locked(NULL);
- while (c) {
- if (!strcasecmp(c->name, name)) {
- break;
- }
- ast_mutex_unlock(&c->lock);
- c = ast_channel_walk_locked(c);
- }
+ c = ast_get_channel_by_name_locked(name);
if (!c) {
astman_send_error(s, m, "No such channel");
return 0;
@@ -471,14 +464,7 @@ static int stop_monitor_action(struct mansession *s, struct message *m)
astman_send_error(s, m, "No channel specified");
return 0;
}
- c = ast_channel_walk_locked(NULL);
- while(c) {
- if (!strcasecmp(c->name, name)) {
- break;
- }
- ast_mutex_unlock(&c->lock);
- c = ast_channel_walk_locked(c);
- }
+ c = ast_get_channel_by_name_locked(name);
if (!c) {
astman_send_error(s, m, "No such channel");
return 0;
@@ -514,14 +500,7 @@ static int change_monitor_action(struct mansession *s, struct message *m)
astman_send_error(s, m, "No filename specified");
return 0;
}
- c = ast_channel_walk_locked(NULL);
- while(c) {
- if (!strcasecmp(c->name, name)) {
- break;
- }
- ast_mutex_unlock(&c->lock);
- c = ast_channel_walk_locked(c);
- }
+ c = ast_get_channel_by_name_locked(name);
if (!c) {
astman_send_error(s, m, "No such channel");
return 0;