Index: apps/app_chanspy.c =================================================================== --- apps/app_chanspy.c (revision 98388) +++ apps/app_chanspy.c (working copy) @@ -437,6 +437,7 @@ int res; char *ptr; int num; + int num_spyed_upon = 1; if (chan->_state != AST_STATE_UP) ast_answer(chan); @@ -446,7 +447,7 @@ waitms = 100; for (;;) { - if (!ast_test_flag(flags, OPTION_QUIET)) { + if (!ast_test_flag(flags, OPTION_QUIET) && num_spyed_upon) { res = ast_streamfile(chan, "beep", chan->language); if (!res) res = ast_waitstream(chan, ""); @@ -465,6 +466,7 @@ /* reset for the next loop around, unless overridden later */ waitms = 100; peer = prev = next = NULL; + num_spyed_upon = 0; for (peer = next_channel(peer, spec, exten, context); peer; @@ -530,7 +532,8 @@ waitms = 5000; res = channel_spy(chan, peer, &volfactor, fd, flags); - + num_spyed_upon++; + if (res == -1) { break; } else if (res > 1 && spec) {