Skip to content

Commit

Permalink
Fix another race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Jirka Hlavacek committed May 21, 2015
1 parent 6c2aafa commit 1cdae5b
Showing 1 changed file with 11 additions and 8 deletions.
Expand Up @@ -721,15 +721,18 @@ public void redirectBothLegs(String context, String exten, int priority) throws
{
ManagerResponse response;

if (linkedChannels.isEmpty())
{
response = server.sendAction(new RedirectAction(name, context, exten, priority));
}
else
synchronized (linkedChannels)
{
response = server
.sendAction(new RedirectAction(name, linkedChannels.get(0).getName(), context, exten, priority,
context, exten, priority));
if (linkedChannels.isEmpty())
{
response = server.sendAction(new RedirectAction(name, context, exten, priority));
}
else
{
response = server
.sendAction(new RedirectAction(name, linkedChannels.get(0).getName(), context, exten, priority,
context, exten, priority));
}
}

if (response instanceof ManagerError)
Expand Down

0 comments on commit 1cdae5b

Please sign in to comment.