app_meetme: Fix channels lingering when hung up under certain conditions

Channels would get stuck and MeetMe would repeatedly display an Unable
to write frame to channel error in the conf_run function if hung up
during certain sound prompts such as during user count announcements.
This patch fixes that by reintroducing a hangup check in the meetme's
main loop (also in conf_run).

(closes issue ASTERISK-20486)
Reported by: Michael Cargile
Review: https://reviewboard.asterisk.org/r/2187/
Patches:
    meetme_hangup_patch_ASTERISK-20486_v3.diff uploaded by Jonathan Rose (license 6182)
........

Merged revisions 376307 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 376308 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 376310 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2012-11-15 23:10:13 +00:00
parent 6b07dd60cc
commit 7ec134a8d7

View File

@@ -3401,6 +3401,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
break; break;
} }
/* Perform a hangup check here since ast_waitfor_nandfds will not always be able to get a channel after a hangup has occurred */
if (ast_check_hangup(chan)) {
break;
}
c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms); c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms);
if (c) { if (c) {
@@ -3490,7 +3495,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
if (menu8_active) { if (menu8_active) {
/* *8 Submenu */ /* *8 Submenu */
dtmf = f->subclass.integer; dtmf = f->subclass.integer;
if (dtmf) { if (dtmf > 0) {
int keepplaying; int keepplaying;
int playednamerec; int playednamerec;
struct ao2_iterator user_iter; struct ao2_iterator user_iter;
@@ -3649,7 +3654,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
} else { } else {
dtmf = f->subclass.integer; dtmf = f->subclass.integer;
} }
if (dtmf) { if (dtmf > 0) {
switch(dtmf) { switch(dtmf) {
case '1': /* Un/Mute */ case '1': /* Un/Mute */
menu_active = 0; menu_active = 0;
@@ -3756,7 +3761,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
} else { } else {
dtmf = f->subclass.integer; dtmf = f->subclass.integer;
} }
if (dtmf) { if (dtmf > 0) {
switch (dtmf) { switch (dtmf) {
case '1': /* Un/Mute */ case '1': /* Un/Mute */
menu_active = 0; menu_active = 0;