]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix channel redirect out of MeetMe() and other issues with channel softhangup.
authorRussell Bryant <russell@russellbryant.com>
Mon, 24 Jan 2011 20:32:21 +0000 (20:32 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 24 Jan 2011 20:32:21 +0000 (20:32 +0000)
commit58a666ac5a708bcb8e1101ba8a2922f52cd1c6af
tree11dace5690816ea40b01fd8987abcb62af855568
parent518b09e78629c268aaa33ea57538c3dd62030e4e
Fix channel redirect out of MeetMe() and other issues with channel softhangup.

Mantis issue #18585 reports that a channel redirect out of MeetMe() stopped
working properly.  This issue includes a patch that resolves the issue by
removing a call to ast_check_hangup() from app_meetme.c.  I left that in my
patch, as it doesn't need to be there.  However, the rest of the patch fixes
this problem with or without the change to app_meetme.

The key difference between what happens before and after this patch is the
effect of the END_OF_Q control frame.  After END_OF_Q is hit in ast_read(),
ast_read() will return NULL.  With the ast_check_hangup() removed, app_meetme
sees this which causes it to exit as intended.  Checking ast_check_hangup()
caused app_meetme to exit earlier in the process, and the target of the
redirect saw the condition where ast_read() returned NULL.

Removing ast_check_hangup() works around the issue in app_meetme, but doesn't
solve the issue if another application did the same thing.  There are also
other edge cases where if an application finishes at the same time that a
redirect happens, the target of the redirect will think that the channel hung
up.  So, I made some changes in pbx.c to resolve it at a deeper level.  There
are already places that unset the SOFTHANGUP_ASYNCGOTO flag in an attempt to
abort the hangup process.  My patch extends this to remove the END_OF_Q frame
from the channel's read queue, making the "abort hangup" more complete.  This
same technique was used in every place where a softhangup flag was cleared.

(closes issue #18585)
Reported by: oej
Tested by: oej, wedhorn, russell

Review: https://reviewboard.asterisk.org/r/1082/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@303546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_meetme.c
include/asterisk/channel.h
main/channel.c
main/pbx.c
res/res_features.c