[Asterisk-code-review] app: Queue hangup if channel is hung up during sub or macro ... (asterisk[13])
Mark Michelson
asteriskteam at digium.com
Wed Jan 13 15:10:42 CST 2016
Mark Michelson has submitted this change and it was merged.
Change subject: app: Queue hangup if channel is hung up during sub or macro execution.
......................................................................
app: Queue hangup if channel is hung up during sub or macro execution.
This issue was exposed when executing a connected line subroutine.
When connected or redirected subroutines or macros are executed it is
expected that the underlying applications and logic invoked are fast
and do not consume frames. In practice this constraint is not enforced
and if not adhered to will cause channels to continue when they shouldn't.
This is because each caller of the connected or redirected logic does not
check whether the channel has been hung up on return. As a result the
the hung up channel continues.
This change makes it so when the API to execute a subroutine or
macro is invoked the channel is checked to determine if it has hung up.
If it has then a hangup is queued again so the caller will see it
and stop.
ASTERISK-25690 #close
Change-Id: I1f9a8ceb1487df0389f0d346ce0f6dcbcaf476ea
---
M main/app.c
1 file changed, 10 insertions(+), 0 deletions(-)
Approvals:
Mark Michelson: Looks good to me, approved
Richard Mudgett: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Ashley Sanders: Looks good to me, but someone else must approve
diff --git a/main/app.c b/main/app.c
index c4143d8..a89e5b0 100644
--- a/main/app.c
+++ b/main/app.c
@@ -357,6 +357,11 @@
if (autoservice_chan) {
ast_autoservice_stop(autoservice_chan);
}
+
+ if (ast_check_hangup_locked(macro_chan)) {
+ ast_queue_hangup(macro_chan);
+ }
+
return res;
}
@@ -433,6 +438,11 @@
if (autoservice_chan) {
ast_autoservice_stop(autoservice_chan);
}
+
+ if (!ignore_hangup && ast_check_hangup_locked(sub_chan)) {
+ ast_queue_hangup(sub_chan);
+ }
+
return res;
}
--
To view, visit https://gerrit.asterisk.org/1996
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f9a8ceb1487df0389f0d346ce0f6dcbcaf476ea
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list