aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-13 17:02:15 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-13 17:02:15 +0000
commit86018830978239c8149c0e3bed0474e531f35b61 (patch)
tree6e51dea91ee95c7f46cb05bc0be5046a6437439a /apps
parent74f1c4d017d152210c0e5fa819686f2a9b51ef5a (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@45065 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanspy.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 873813aa3..fcb931d32 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -259,8 +259,12 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
ast_mutex_init(&csth.spy.lock);
csth.volfactor = *volfactor;
set_volume(chan, &csth);
- csth.spy.read_vol_adjustment = csth.volfactor;
- csth.spy.write_vol_adjustment = csth.volfactor;
+ if (csth.volfactor) {
+ ast_set_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
+ csth.spy.read_vol_adjustment = csth.volfactor;
+ ast_set_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
+ csth.spy.write_vol_adjustment = csth.volfactor;
+ }
csth.fd = fd;
if (start_spying(spyee, chan, &csth.spy)) {
@@ -306,8 +310,15 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
csth.volfactor = *volfactor;
set_volume(chan, &csth);
- csth.spy.read_vol_adjustment = csth.volfactor;
- csth.spy.write_vol_adjustment = csth.volfactor;
+ if (csth.volfactor) {
+ ast_set_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
+ csth.spy.read_vol_adjustment = csth.volfactor;
+ ast_set_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
+ csth.spy.write_vol_adjustment = csth.volfactor;
+ } else {
+ ast_clear_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
+ ast_clear_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
+ }
}
} else if (res == '*') {
break;