reset channel volumes when exiting apps that use them
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6525 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
cd78f8ce84
commit
dad8943fab
|
@ -535,7 +535,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
|
||||||
oldwf = 0,
|
oldwf = 0,
|
||||||
fd = 0;
|
fd = 0;
|
||||||
struct ast_flags flags;
|
struct ast_flags flags;
|
||||||
|
signed char zero_volume = 0;
|
||||||
|
|
||||||
if (!(args = ast_strdupa((char *)data))) {
|
if (!(args = ast_strdupa((char *)data))) {
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
ast_log(LOG_ERROR, "Out of memory!\n");
|
||||||
|
@ -703,6 +703,9 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_clear_flag(chan, AST_FLAG_SPYING);
|
ast_clear_flag(chan, AST_FLAG_SPYING);
|
||||||
|
|
||||||
|
ast_channel_setoption(chan, AST_OPTION_TXGAIN, &zero_volume, sizeof(zero_volume), 0);
|
||||||
|
|
||||||
ALL_DONE(u, res);
|
ALL_DONE(u, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -365,6 +365,14 @@ static void tweak_listen_volume(struct ast_conf_user *user, enum volume_action a
|
||||||
user->listen.actual = user->listen.desired;
|
user->listen.actual = user->listen.desired;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void reset_volumes(struct ast_conf_user *user)
|
||||||
|
{
|
||||||
|
signed char zero_volume = 0;
|
||||||
|
|
||||||
|
ast_channel_setoption(user->chan, AST_OPTION_TXGAIN, &zero_volume, sizeof(zero_volume), 0);
|
||||||
|
ast_channel_setoption(user->chan, AST_OPTION_RXGAIN, &zero_volume, sizeof(zero_volume), 0);
|
||||||
|
}
|
||||||
|
|
||||||
static void adjust_volume(struct ast_frame *f, int vol)
|
static void adjust_volume(struct ast_frame *f, int vol)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
|
@ -1473,7 +1481,6 @@ zapretry:
|
||||||
close(fd);
|
close(fd);
|
||||||
else {
|
else {
|
||||||
/* Take out of conference */
|
/* Take out of conference */
|
||||||
/* Add us to the conference */
|
|
||||||
ztc.chan = 0;
|
ztc.chan = 0;
|
||||||
ztc.confno = 0;
|
ztc.confno = 0;
|
||||||
ztc.confmode = 0;
|
ztc.confmode = 0;
|
||||||
|
@ -1482,6 +1489,8 @@ zapretry:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset_volumes(user);
|
||||||
|
|
||||||
ast_mutex_lock(&conflock);
|
ast_mutex_lock(&conflock);
|
||||||
if (!(confflags & CONFFLAG_QUIET) && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN))
|
if (!(confflags & CONFFLAG_QUIET) && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN))
|
||||||
conf_play(chan, conf, LEAVE);
|
conf_play(chan, conf, LEAVE);
|
||||||
|
@ -1502,16 +1511,16 @@ zapretry:
|
||||||
|
|
||||||
outrun:
|
outrun:
|
||||||
ast_mutex_lock(&conflock);
|
ast_mutex_lock(&conflock);
|
||||||
if (confflags & CONFFLAG_MONITORTALKER && dsp)
|
if (confflags & CONFFLAG_MONITORTALKER && dsp)
|
||||||
ast_dsp_free(dsp);
|
ast_dsp_free(dsp);
|
||||||
|
|
||||||
if (user->user_no) { /* Only cleanup users who really joined! */
|
if (user->user_no) { /* Only cleanup users who really joined! */
|
||||||
manager_event(EVENT_FLAG_CALL, "MeetmeLeave",
|
manager_event(EVENT_FLAG_CALL, "MeetmeLeave",
|
||||||
"Channel: %s\r\n"
|
"Channel: %s\r\n"
|
||||||
"Uniqueid: %s\r\n"
|
"Uniqueid: %s\r\n"
|
||||||
"Meetme: %s\r\n"
|
"Meetme: %s\r\n"
|
||||||
"Usernum: %d\r\n",
|
"Usernum: %d\r\n",
|
||||||
chan->name, chan->uniqueid, conf->confno, user->user_no);
|
chan->name, chan->uniqueid, conf->confno, user->user_no);
|
||||||
conf->users--;
|
conf->users--;
|
||||||
if (confflags & CONFFLAG_MARKEDUSER)
|
if (confflags & CONFFLAG_MARKEDUSER)
|
||||||
conf->markedusers--;
|
conf->markedusers--;
|
||||||
|
|
Reference in New Issue