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(); }
private void deleteConnection (final Object message, final ActorRef sender) { final ActorRef self = self(); final DeleteConnection dlcx = (DeleteConnection) message; if (dlcx.getConnectionIdentifier() == null) { connEndpointMap.values().removeAll(Collections.singleton(dlcx.getEndpointIdentifier().getLocalEndpointName())); monitoringService.tell(new MgcpConnectionDeleted(null, dlcx.getEndpointIdentifier().getLocalEndpointName()), self()); connEndpointMap.remove(dlcx.getConnectionIdentifier().toString()); monitoringService.tell(new MgcpConnectionDeleted(dlcx.getConnectionIdentifier().toString(), null), self());
if (evt.getConnectionIdentifier() != null) byte[] connectionIdentifierBytes=evt.getConnectionIdentifier().toString().getBytes(); System.arraycopy(connectionIdentifierBytes, 0, array,totalLength, connectionIdentifierBytes.length); totalLength+=connectionIdentifierBytes.length;
if (evt.getConnectionIdentifier() != null) byte[] connectionIdentifierBytes=evt.getConnectionIdentifier().toString().getBytes(); System.arraycopy(connectionIdentifierBytes, 0, array,totalLength, connectionIdentifierBytes.length); totalLength+=connectionIdentifierBytes.length;
if (dcRequest.getConnectionIdentifier() != null) { this.connectionIds.remove(dcRequest.getConnectionIdentifier()); if (logger.isDebugEnabled()) { logger.debug("Removing connection:" + dcRequest.getConnectionIdentifier() + " From:" + Arrays.toString(this.connectionIds.toArray()) + " ------ " + this);