don't play any sounds when using the quiet option (bug #4348)
authorRussell Bryant <russell@russellbryant.com>
Thu, 26 May 2005 16:05:07 +0000 (16:05 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 26 May 2005 16:05:07 +0000 (16:05 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5774 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_chanspy.c

index e0374d7..292a151 100755 (executable)
@@ -712,13 +712,15 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
        }
 
        for(;;) {
-               res = ast_streamfile(chan, "beep", chan->language);
-               if (!res)
-                       res = ast_waitstream(chan, "");
-               if (res < 0) {
-                       ast_clear_flag(chan, AST_FLAG_SPYING);
-                       break;
-               }                       
+               if (!silent) {
+                       res = ast_streamfile(chan, "beep", chan->language);
+                       if (!res)
+                               res = ast_waitstream(chan, "");
+                       if (res < 0) {
+                               ast_clear_flag(chan, AST_FLAG_SPYING);
+                               break;
+                       }
+               }
 
                count = 0;
                res = ast_waitfordigit(chan, waitms);