Index: apps/app_chanspy.c =================================================================== --- apps/app_chanspy.c (revision 114594) +++ apps/app_chanspy.c (working copy) @@ -710,7 +710,14 @@ * So, when we need it again, we have to lock the datastore and get * the pointer from there to see if the channel is still valid. */ ast_channel_unlock(peer); + + /* Don't set peer to null here, or the next_channel function + * or the next_channel function will always start at the + * beginning of the channel list, and you'll only ever + * be able to spy on the first (non-spying, non-Zap/psuedo) + * channel in the list peer = NULL; + */ if (!ast_test_flag(flags, OPTION_QUIET)) { if (!ast_test_flag(flags, OPTION_NOTECH)) { @@ -731,7 +738,11 @@ ast_say_digits(chan, atoi(ptr), "", chan->language); } + /* I'm not sure what this is from, but it seems to not be + * needed. Maybe it was some primitive form of race-condition + * avoidance? waitms = 5000; + */ res = channel_spy(chan, peer_chanspy_ds, &volfactor, fd, flags, exitcontext); num_spyed_upon++;