[asterisk-commits] russell: branch 11 r383836 - in /branches/11: ./ apps/app_meetme.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Mar 25 20:36:31 CDT 2013
Author: russell
Date: Mon Mar 25 20:36:27 2013
New Revision: 383836
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383836
Log:
Fix multi-station answer race condition.
When an SLA trunk is ringing (inbound call on the trunk) Asterisk will
make outbound calls to the stations that have that trunk. If more than
one station answers the call at the same time, all channels other than
the first one to answer are left in a bad state. The channel gets
leaked, is not connected to anything, and there's no way to get rid of
it.
We now properly clean up these losing channels by hanging up on them.
Since they lost the race, as we process their answer, there is no
ringing trunk for them to answer.
........
Merged revisions 383835 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Modified:
branches/11/ (props changed)
branches/11/apps/app_meetme.c
Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/11/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/apps/app_meetme.c?view=diff&rev=383836&r1=383835&r2=383836
==============================================================================
--- branches/11/apps/app_meetme.c (original)
+++ branches/11/apps/app_meetme.c Mon Mar 25 20:36:27 2013
@@ -5916,7 +5916,16 @@
ringing_trunk = sla_choose_ringing_trunk(ringing_station->station, &s_trunk_ref, 1);
ast_mutex_unlock(&sla.lock);
if (!ringing_trunk) {
+ /* This case happens in a bit of a race condition. If two stations answer
+ * the outbound call at the same time, the first one will get connected to
+ * the trunk. When the second one gets here, it will not see any trunks
+ * ringing so we have no idea what to conect it to. So, we just hang up
+ * on it. */
ast_debug(1, "Found no ringing trunk for station '%s' to answer!\n", ringing_station->station->name);
+ ast_dial_join(ringing_station->station->dial);
+ ast_dial_destroy(ringing_station->station->dial);
+ ringing_station->station->dial = NULL;
+ ast_free(ringing_station);
break;
}
/* Track the channel that answered this trunk */
More information about the asterisk-commits
mailing list