use of org.asteriskjava.manager.action.SipPeersAction in project camel by apache.
the class AsteriskProducer method process.
public void process(Exchange exchange) throws Exception {
ManagerAction action;
switch(endpoint.getAction()) {
case QUEUE_STATUS:
action = new QueueStatusAction();
break;
case SIP_PEERS:
action = new SipPeersAction();
break;
case EXTENSION_STATE:
action = new ExtensionStateAction((String) exchange.getIn().getHeader(AsteriskConstants.EXTENSION), (String) exchange.getIn().getHeader(AsteriskConstants.CONTEXT));
break;
default:
throw new IllegalStateException("Unknown action");
}
LOG.debug("Asterisk, send action {} ", endpoint.getAction());
ManagerResponse response = endpoint.sendAction(action);
exchange.getIn().setBody(response);
}
Aggregations