aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-23 17:48:08 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-23 17:48:08 +0000
commit2aeb322eef526c4461c37aed8c8c303dbb803dc8 (patch)
tree797925ea11dea31ac3835e778116d85be71f8c17 /apps/app_chanspy.c
parentbcbed075d0051f9fd82f6da97402764be36c4f17 (diff)
Merged revisions 99923 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r99923 | russell | 2008-01-23 11:46:55 -0600 (Wed, 23 Jan 2008) | 8 lines ChanSpy issues a beep when it starts at the beginning of a list of channels to potentially spy on. However, if there were no matching channels, it would beep at you over and over, which is pretty annoying. Now, it will only beep once in the case that there are no channels to spy on, but it will still beep again once it reaches the beginning of the channel list again. (closes issue #11738, patched by me) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99924 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index a29973ff4..a68461baa 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -409,6 +409,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
int res;
char *ptr;
int num;
+ int num_spyed_upon = 1;
if (ast_test_flag(flags, OPTION_EXIT)) {
const char *c;
@@ -428,7 +429,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
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 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
/* 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 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
waitms = 5000;
res = channel_spy(chan, peer, &volfactor, fd, flags, exitcontext);
-
+ num_spyed_upon++;
+
if (res == -1) {
goto exit;
} else if (res == -2) {