private void send(final Object message, final ActorRef sender) { final JainMgcpCommandEvent command = (JainMgcpCommandEvent) message; final int transactionId = (int) transactionIdPool.get(); command.setTransactionHandle(transactionId); respond(message, sender); }
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); } }
public void receiveRequest(final EndpointIdentifier endpoint, final String msg, final Integer remoteTID) { this.remoteTID = remoteTID; this.endpoint = endpoint; try { commandEvent = decodeCommand(msg); // if (logger.isDebugEnabled()) { // logger.debug("Event decoded: \n" + event); // } } catch (ParseException e) { logger.error("Coud not parse message: ", e); return; } sent = false; // store original transaction handle parameter // and populate with local value stack.getRemoteTxToLocalTxMap().put(remoteTID, new Integer(localTID)); commandEvent.setTransactionHandle(localTID); resetLongtranTimer(); this.actionToPerform.add(new ScheduleRequestReceival(this)); // we shoudl be scheduled by message handler }
private void processTxTimeout() { try { // releases the tx release(); // the try ensures the static timer will not get a runtime // exception process tx timeout commandEvent.setTransactionHandle(this.remoteTID); if (sent) { stack.provider.processTxTimeout(commandEvent); } else { // TODO : Send back 406 TxTimedOut to NotifiedEntity stack.provider.processRxTimeout(commandEvent); } } catch (Exception e) { logger.error("Failed to release mgcp transaction localID=" + localTID, e); } }
private void processTxTimeout() { try { // releases the tx release(); // the try ensures the static timer will not get a runtime // exception process tx timeout commandEvent.setTransactionHandle(this.remoteTID); if (sent) { stack.provider.processTxTimeout(commandEvent); } else { // TODO : Send back 406 TxTimedOut to NotifiedEntity stack.provider.processRxTimeout(commandEvent); } } catch (Exception e) { logger.error("Failed to release mgcp transaction localID=" + localTID, e); } }
public void receiveRequest(EndpointIdentifier endpoint,byte[] data,SplitDetails[] msg, final Integer remoteTID) { this.remoteTID = remoteTID; this.endpoint = endpoint; try { commandEvent = decodeCommand(data,msg); } catch (ParseException e) { logger.error("Coud not parse message: ", e); return; } sent = false; stack.getRemoteTxToLocalTxMap().put(remoteTID, new Integer(localTID)); commandEvent.setTransactionHandle(localTID); resetLongtranTimer(); stack.provider.processMgcpCommandEvent(commandEvent); }
public void receiveRequest(EndpointIdentifier endpoint,byte[] data,SplitDetails[] msg, final Integer remoteTID) { this.remoteTID = remoteTID; this.endpoint = endpoint; try { commandEvent = decodeCommand(data,msg); } catch (ParseException e) { logger.error("Coud not parse message: ", e); return; } sent = false; stack.getRemoteTxToLocalTxMap().put(remoteTID, new Integer(localTID)); commandEvent.setTransactionHandle(localTID); resetLongtranTimer(); stack.provider.processMgcpCommandEvent(commandEvent); }
private void send (final Object message, final ActorRef sender) { final JainMgcpCommandEvent command = (JainMgcpCommandEvent) message; final int transactionId = (int) transactionIdPool.get(); command.setTransactionHandle(transactionId); respond(message, sender); EventName[] events = null; if (message instanceof NotificationRequest) { final NotificationRequest rqnt = (NotificationRequest) message; events = rqnt.getSignalRequests(); if (events != null && events[0].getEventIdentifier().getName().equalsIgnoreCase("pr")) { recordingRqnt = rqnt; recordingRqntSender = sender(); } } if (events != null && !events[0].getEventIdentifier().getName().equalsIgnoreCase("pr")) { if (NotificationRequest.class.equals(command.getClass())) { final NotificationRequest request = (NotificationRequest) command; final String id = Long.toString(requestIdPool.get()); request.getRequestIdentifier().setRequestIdentifier(id); notify(request, sender); } } }
event.setTransactionHandle(localTID);
commandEvent.setTransactionHandle(this.getUniqueTransactionHandler());
commandEvent.setTransactionHandle(this.getUniqueTransactionHandler());
event.setTransactionHandle(localTID);
event.setTransactionHandle(localTID);
commandEvent.setTransactionHandle(this.getUniqueTransactionHandler());