[Home]

Summary:ASTERISK-22804: Redirecting two bridged lines via AMI causes race condition, preventing the second redirect from working properly.
Reporter:Jeff Hoppe (jhoppebugs)Labels:
Date Opened:2013-11-01 09:39:28Date Closed:2013-11-13 12:20:01.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/Bridging Core/ManagerInterface
Versions:11.5.1 11.6.0 Frequency of
Occurrence
Related
Issues:
Environment:CentOS AMIAttachments:( 0) ConferenceCallIssue.pdf
( 1) fullGBBGB
( 2) issuesample
( 3) nonissuesample
Description: The scenario is agent is connected to a customer in a queue.  Agent redirects customer to ConfBridge via AMI command in application.  Agent calls third party and connects., the two channels are bridged.   We execute two AMI redirects to put the agent and 3rd party into  the ConfBridge that the customer is sitting in.  This will happen successfully at times but other times we will have the following  issue.    The first redirect call will put the 3rd party in the ConfBridge, and the second redirect will hang up the Agent and proceed to dial the 3rd party phone number again.   When this happens we have to hang up on this extra DIAL attempt and put ourselves back in the ConfBridge to get things back to where we should be.
We are upgrading from Asterisk 10 to Asterisk 11.   This issue happens on 11.5.1 but does not happen in 10.11.  

I attached a PDF file that will explain what I have found.

All the information is gathered from testing on version 11.5.1, before I created this bug tracker entry, I did verify that it is an issue on 11.6.0 as well.


Attached files:

Issuesample  -->  This shows the DEBUG for a call that has this issue.
nonIssuesample  -->  This shows the DEBUG for a call that does not have this issue.
fullGBBGB --> This shows 5 calls in a row where the first and fourth scenarios are good and the rest are bad.
Comments:By: Matt Jordan (mjordan) 2013-11-01 10:17:13.201-0500

Can you provide some additional information on your debug scenarios? Specifically:
* What channels were involved in each scenario
* When the AMI redirects occurred

By: Jeff Hoppe (jhoppebugs) 2013-11-01 10:38:57.913-0500

In the 'issuesample' file the customer channel is SIP/hq-ast-005-trunk-00000019.   The channels of the Agent and 3rd party bridged together and ultimately redirected via AMI are:  SIP/hq-ast-005-trunk-0000001a and Agent/1127.
In the 'nonissuesample' file the customer channel is SIP/hq-ast-005-trunk-00000027.   The channels of the Agent and 3rd party bridged together and ultimately redirected via AMI are:  SIP/hq-ast-005-trunk-00000028 and Agent/1127.

In each case there are about 6 'SetVar'  AMI commands followed by a 'Redirect' command in the debug files.   You will notice in the issuesample (the file that shows the bad case) that the Agents channel (Agent/1127) has 6 'Setvar' AMI commands and the 'Redirect' command is well after them.

The first set of 'SetVars' is for putting the customer in the conference room.  The 2nd and 3rd set are putting the agent and 3rd party in the conference room.


Is this what you are looking for?


By: Jeff Hoppe (jhoppebugs) 2013-11-01 10:39:31.567-0500

Is this what you are looking for?

By: Rusty Newton (rnewton) 2013-11-13 09:46:45.783-0600

You've described that the issue happens in 11.5.1+ , but not in 10.11. When occurring in 11.X, how often does the issue occur? Every other call? One out of a hundred?   Trying to get an idea when someone would expect it to occur during a reproduction attempt.



By: Jeff Hoppe (jhoppebugs) 2013-11-13 10:37:40.652-0600

With our 4 CPU and 4 gig memory Linux box, it happens 1 out of 2 times.
With my development 1 CPU and 1 gig memory box, it happens 1 out 10 (but at one point it took about 30 attempts on my development box).

By: Richard Mudgett (rmudgett) 2013-11-13 11:11:03.679-0600

The debug traces don't show the AMI redirects.  Are the redirects working on *one* channel at a time?  If so then yes there is a race condition if the channels are in the same bridge.  This specific case is why the AMI redirect can atomically redirect two channels at the same time.

https://wiki.asterisk.org/wiki/display/AST/ManagerAction_Redirect


By: Jeff Hoppe (jhoppebugs) 2013-11-13 12:01:46.279-0600

I see that now.  I apologize for this bug tracker entry.  

By: Matt Jordan (mjordan) 2013-11-13 12:20:01.463-0600

No worries, happens to everyone :-)