aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_setcdruserfield.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-20 16:30:10 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-20 16:30:10 +0000
commitec76498f552e4ff10adcaa0ffc27d1c21cb5792e (patch)
treeefbb775d4f7e80cb61b314075217774d082e881a /apps/app_setcdruserfield.c
parent7e42c962d89de0673789eed30649fc7ae276aa50 (diff)
Make ast_channel_walk become ast_channel_walk_locked
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3029 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_setcdruserfield.c')
-rwxr-xr-xapps/app_setcdruserfield.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_setcdruserfield.c b/apps/app_setcdruserfield.c
index bb1bb339e..d0ebd2e13 100755
--- a/apps/app_setcdruserfield.c
+++ b/apps/app_setcdruserfield.c
@@ -76,11 +76,12 @@ static int action_setcdruserfield(struct mansession *s, struct message *m)
astman_send_error(s, m, "No UserField specified");
return 0;
}
- c = ast_channel_walk(NULL);
+ c = ast_channel_walk_locked(NULL);
while (c) {
if (!strcasecmp(c->name, channel))
break;
- c = ast_channel_walk(c);
+ ast_mutex_unlock(&c->lock);
+ c = ast_channel_walk_locked(c);
}
if (!c) {
astman_send_error(s, m, "No such channel");
@@ -90,6 +91,7 @@ static int action_setcdruserfield(struct mansession *s, struct message *m)
ast_cdr_appenduserfield(c, userfield);
else
ast_cdr_setuserfield(c, userfield);
+ ast_mutex_unlock(&c->lock);
astman_send_ack(s, m, "CDR Userfield Set");
return 0;
}