Index: app_chanspy.c =================================================================== --- app_chanspy.c (revision 127827) +++ app_chanspy.c (working copy) @@ -576,12 +576,14 @@ } if (mygroup) { + ast_channel_lock(peer); if ((group = pbx_builtin_getvar_helper(peer, "SPYGROUP"))) { dup_group = ast_strdupa(group); num_groups = ast_app_separate_args(dup_group, ':', groups, sizeof(groups) / sizeof(groups[0])); } - + ast_channel_unlock(peer); + for (x = 0; x < num_groups; x++) { if (!strcmp(mygroup, groups[x])) { igrp = 1;