[Asterisk-code-review] channel: Queue hangup if channel is hung up during connected... (asterisk[13])

Joshua Colp asteriskteam at digium.com
Wed Jan 13 05:59:56 CST 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/1996

Change subject: channel: Queue hangup if channel is hung up during connected line sub.
......................................................................

channel: Queue hangup if channel is hung up during connected line sub.

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 a connected or redirected subroutine or
macro is finished the channel is checked. If the channel has been hung
up a hangup is queued again so the caller will see this and stop.

ASTERISK-25690 #close

Change-Id: I1f9a8ceb1487df0389f0d346ce0f6dcbcaf476ea
---
M main/channel.c
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/96/1996/1

diff --git a/main/channel.c b/main/channel.c
index 6507ef9..7fd4804 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -10093,6 +10093,10 @@
 		ast_party_connected_line_free(&saved_connected);
 	}
 
+	if (ast_check_hangup_locked(macro_chan)) {
+		ast_queue_hangup(macro_chan);
+	}
+
 	return retval;
 }
 
@@ -10143,6 +10147,10 @@
 		ast_party_redirecting_free(&saved_redirecting);
 	}
 
+	if (ast_check_hangup_locked(macro_chan)) {
+		ast_queue_hangup(macro_chan);
+	}
+
 	return retval;
 }
 
@@ -10186,6 +10194,10 @@
 		ast_party_connected_line_free(&saved_connected);
 	}
 
+	if (ast_check_hangup_locked(sub_chan)) {
+		ast_queue_hangup(sub_chan);
+	}
+
 	return retval;
 }
 
@@ -10229,6 +10241,10 @@
 		ast_party_redirecting_free(&saved_redirecting);
 	}
 
+	if (ast_check_hangup_locked(sub_chan)) {
+		ast_queue_hangup(sub_chan);
+	}
+
 	return retval;
 }
 

-- 
To view, visit https://gerrit.asterisk.org/1996
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f9a8ceb1487df0389f0d346ce0f6dcbcaf476ea
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list