private void send(final Object message) { final JainMgcpResponseEvent response = (JainMgcpResponseEvent) message; provider.sendMgcpEvents(new JainMgcpEvent[] { response }); }
public void send(JainMgcpEvent evt) { this.mgcpProvider.sendMgcpEvents(new JainMgcpEvent[]{evt}); }
public void send(JainMgcpEvent evt) { this.mgcpProvider.sendMgcpEvents(new JainMgcpEvent[]{evt}); }
public void sendResponse(final JainMgcpResponseEvent response) throws MgcpServerException { assertState(RUNNING); try { LOGGER.debug("Sending mgcp response: \n"+response); mgcpProvider.sendMgcpEvents(new JainMgcpEvent[] { response }); } catch(final IllegalArgumentException exception) { LOGGER.error(exception); throw new MgcpServerException(exception); } }
private void send(final Object message, final ActorRef sender) { final JainMgcpCommandEvent command = (JainMgcpCommandEvent) message; final int transactionId = (int) transactionIdPool.get(); command.setTransactionHandle(transactionId); responseListeners.put(transactionId, sender); if (NotificationRequest.class.equals(command.getClass())) { final NotificationRequest request = (NotificationRequest) command; final String id = Long.toString(requestIdPool.get()); request.getRequestIdentifier().setRequestIdentifier(id); notificationListeners.put(id, sender); } provider.sendMgcpEvents(new JainMgcpEvent[] { command }); }
public void sendCommand(final JainMgcpCommandEvent command, final JainMgcpListener listener) throws MgcpServerException { assertState(RUNNING); // Register the listener to listen for a response to the command being sent. final int id = (int)transactionId.getAndIncrement(); command.setTransactionHandle(id); responseListeners.put(id, listener); // Try to send the command. try { LOGGER.debug("Sending mgcp command: \n"+command); mgcpProvider.sendMgcpEvents(new JainMgcpEvent[] { command }); } catch(final IllegalArgumentException exception) { // Make sure we don't start a memory leak. responseListeners.remove(id); // Log and re-throw the exception. LOGGER.error(exception); throw new MgcpServerException(exception); } }