aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-15 14:31:37 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-15 14:31:37 +0000
commit3ae685c55ad947a8abaa7ec0cc3fc8b4294867d4 (patch)
treea2aa3af23e9535b659e23471dfaab1cce0af3091 /res
parent99242855ed2cf8b8056cd34a82801f6f1a579c83 (diff)
Handle a case where a call can be bridged to a channel that is still ringing.
The issue that was reported was about a case where a RINGING channel got redirected to an extension to pick up a call from parking. Once the parked call got taken out of parking, it heard silence until the other side answered. Ideally, the caller that was parked would get a ringing indication. This patch fixes this case so that the caller receives ringback once it comes out of parking until the other side answers. The fixes are: - Make sure we remember that a channel was an outgoing channel when doing a masquerade. This prevents an erroneous ast_answer() call on the channel, which causes a bogus 200 OK to be sent in the case of SIP. - Add some additional comments to explain related parts of code. - Update the handling of the ast_channel visible_indication field. Storing values that are not stateful is pointless. Control frames that are events or commands should be ignored. - When a bridge first starts, check to see if the peer channel needs to be given ringing indication because the calling side is still ringing. - Rework ast_indicate_data() a bit for the sake of readability. (closes issue #13747) Reported by: davidw Tested by: russell Review: http://reviewboard.digium.com/r/90/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164201 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_features.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/res/res_features.c b/res/res_features.c
index be9fab630..8e6799298 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -1474,8 +1474,16 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
if (chan && peer) {
pbx_builtin_setvar_helper(chan, "BRIDGEPEER", peer->name);
pbx_builtin_setvar_helper(peer, "BRIDGEPEER", chan->name);
- } else if (chan)
+ } else if (chan) {
pbx_builtin_setvar_helper(chan, "BLINDTRANSFER", NULL);
+ }
+
+ /* This is an interesting case. One example is if a ringing channel gets redirected to
+ * an extension that picks up a parked call. This will make sure that the call taken
+ * out of parking gets told that the channel it just got bridged to is still ringing. */
+ if (chan->_state == AST_STATE_RINGING && peer->visible_indication != AST_CONTROL_RINGING) {
+ ast_indicate(peer, AST_CONTROL_RINGING);
+ }
if (monitor_ok) {
const char *monitor_exec;