]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_meetme: Fix channels lingering when hung up under certain conditions
authorJonathan Rose <jrose@digium.com>
Thu, 15 Nov 2012 22:55:04 +0000 (22:55 +0000)
committerJonathan Rose <jrose@digium.com>
Thu, 15 Nov 2012 22:55:04 +0000 (22:55 +0000)
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@376308 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c

index 9a0869475e41102e507412a2c50bd2fd0e7d940d..bd63299324aef4bf8cbdb3a07e5173dde8ad4fc3 100644 (file)
@@ -3286,6 +3286,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                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);
 
                        if (c) {
@@ -3370,12 +3375,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                        }
 
                                        if (musiconhold) {
-                                               ast_moh_stop(chan);
+                                               ast_moh_stop(chan);
                                        }
                                        if (menu8_active) {
                                                /* *8 Submenu */
                                                dtmf = f->subclass.integer;
-                                               if (dtmf) {
+                                               if (dtmf > 0) {
                                                        int keepplaying;
                                                        int playednamerec;
                                                        struct ao2_iterator user_iter;
@@ -3534,7 +3539,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                } else {
                                                        dtmf = f->subclass.integer;
                                                }
-                                               if (dtmf) {
+                                               if (dtmf > 0) {
                                                        switch(dtmf) {
                                                        case '1': /* Un/Mute */
                                                                menu_active = 0;
@@ -3641,7 +3646,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                } else {
                                                        dtmf = f->subclass.integer;
                                                }
-                                               if (dtmf) {
+                                               if (dtmf > 0) {
                                                        switch (dtmf) {
                                                        case '1': /* Un/Mute */
                                                                menu_active = 0;