*/
static ManagerCommunicationException mapSendActionException(String actionName, Exception exception)
{
if (exception instanceof IllegalStateException)
{
return new ManagerCommunicationException("Not connected to Asterisk Server", exception);
}
else if (exception instanceof EventTimeoutException)
{
return new ManagerCommunicationException("Timeout waiting for events from " + actionName + "Action", exception);
}
else
{
return new ManagerCommunicationException("Unable to send " + actionName + "Action", exception);
}
}