private void deleteConnection(final Object message, final ActorRef sender) { final ActorRef self = self(); final DeleteConnection dlcx = (DeleteConnection) message; System.out.println(dlcx.toString()); final ReturnCode code = ReturnCode.Transaction_Executed_Normally; final DeleteConnectionResponse response = new DeleteConnectionResponse(self, code); final int transaction = dlcx.getTransactionHandle(); response.setTransactionHandle(transaction); System.out.println(response.toString()); sender.tell(response, self); }
public String encode(JainMgcpCommandEvent event) { // encode message header Utils utils = utilsFactory.allocate(); DeleteConnection evt = (DeleteConnection) event; StringBuffer s = new StringBuffer(); s.append("DLCX ").append(evt.getTransactionHandle()).append(SINGLE_CHAR_SPACE).append( evt.getEndpointIdentifier()).append(SINGLE_CHAR_SPACE).append(MGCP_VERSION).append(NEW_LINE); // encode optional parameters if (evt.getBearerInformation() != null) { s.append("B:e:").append(evt.getBearerInformation()).append(NEW_LINE); } if (evt.getCallIdentifier() != null) { s.append("C:").append(evt.getCallIdentifier()).append(NEW_LINE); } if (evt.getConnectionIdentifier() != null) { s.append("I:").append(evt.getConnectionIdentifier()).append(NEW_LINE); } if (evt.getConnectionParms() != null) { s.append("P:").append(utils.encodeConnectionParms(evt.getConnectionParms())).append(NEW_LINE); } if (evt.getNotificationRequestParms() != null) { s.append(utils.encodeNotificationRequestParms(evt.getNotificationRequestParms())); } if (evt.getReasonCode() != null) { s.append("E:").append(evt.getReasonCode()); } utilsFactory.deallocate(utils); return s.toString(); }
final ReturnCode code = ReturnCode.Transaction_Executed_Normally; final DeleteConnectionResponse response = new DeleteConnectionResponse(self, code); final int transaction = dlcx.getTransactionHandle(); response.setTransactionHandle(transaction); System.out.println(response.toString());