@Override public JainMgcpResponseEvent getProvisionalResponse() { DeleteConnectionResponse provisionalResponse = null; if (!sent) { provisionalResponse = new DeleteConnectionResponse(source != null ? source : stack,ReturnCode.Transaction_Being_Executed); provisionalResponse.setTransactionHandle(commandEvent.getTransactionHandle()); } return provisionalResponse; }
public String encode(JainMgcpResponseEvent event) { DeleteConnectionResponse response = (DeleteConnectionResponse) event; ReturnCode returnCode = response.getReturnCode(); StringBuffer s = new StringBuffer(); s.append(returnCode.getValue()).append(SINGLE_CHAR_SPACE).append(response.getTransactionHandle()).append( SINGLE_CHAR_SPACE).append(returnCode.getComment()).append(NEW_LINE); if (response.getConnectionParms() != null) { s.append(response.getConnectionParms()).append(NEW_LINE); } return s.toString(); }
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); }
break; case Constants.CMD_DELETE_CONNECTION: response = new DeleteConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_ENDPOINT_CONFIGURATION: response = new DeleteConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_MODIFY_CONNECTION:
int responseCode = dcResponse.getReturnCode().getValue(); MgcpResponseType type = MgcpResponseType.getResponseTypeFromCode(responseCode);
/** * Receive notification of the parameter of a message. Parser will call this method to report about parameter * reading. * * @param name * the name of the paremeter * @param value * the value of the parameter. */ public void param(byte[] data,SplitDetails name, SplitDetails value) throws ParseException { if(name.getLength()==1) { switch(data[name.getOffset()]) { case StringFunctions.LOW_I_BYTE: case StringFunctions.HIGH_I_BYTE: //do nothing, should not be here , but sent by mms break; case StringFunctions.LOW_P_BYTE: case StringFunctions.HIGH_P_BYTE: response.setConnectionParms(ConnectionParmHandler.decodeList(data,value.getOffset(),value.getLength())); break; default: logger.warn("Unidentified DLCX Response parameter " + new String(data,name.getOffset(),name.getLength()) + " with value = " + new String(data,value.getOffset(),value.getLength())); } } else logger.warn("Unidentified DLCX Response parameter " + new String(data,name.getOffset(),name.getLength()) + " with value = " + new String(data,value.getOffset(),value.getLength())); }
break; case Constants.CMD_DELETE_CONNECTION: response = new DeleteConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_ENDPOINT_CONFIGURATION: response = new DeleteConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_MODIFY_CONNECTION:
/** * Receive notification of the parameter of a message. Parser will call this method to report about parameter * reading. * * @param name * the name of the paremeter * @param value * the value of the parameter. */ public void param(byte[] data,SplitDetails name, SplitDetails value) throws ParseException { if(name.getLength()==1) { switch(data[name.getOffset()]) { case StringFunctions.LOW_I_BYTE: case StringFunctions.HIGH_I_BYTE: //do nothing, should not be here , but sent by mms break; case StringFunctions.LOW_P_BYTE: case StringFunctions.HIGH_P_BYTE: response.setConnectionParms(ConnectionParmHandler.decodeList(data,value.getOffset(),value.getLength())); break; default: logger.warn("Unidentified DLCX Response parameter " + new String(data,name.getOffset(),name.getLength()) + " with value = " + new String(data,value.getOffset(),value.getLength())); } } else logger.warn("Unidentified DLCX Response parameter " + new String(data,name.getOffset(),name.getLength()) + " with value = " + new String(data,value.getOffset(),value.getLength())); }
@Override public JainMgcpResponseEvent getProvisionalResponse() { DeleteConnectionResponse provisionalResponse = null; if (!sent) { provisionalResponse = new DeleteConnectionResponse(source != null ? source : stack,ReturnCode.Transaction_Being_Executed); provisionalResponse.setTransactionHandle(commandEvent.getTransactionHandle()); } return provisionalResponse; }
public int encode(JainMgcpResponseEvent event,byte[] array) { DeleteConnectionResponse response = (DeleteConnectionResponse) event; ReturnCode returnCode = response.getReturnCode(); int totalLength=ReturnCodeHandler.encode(array,0,returnCode); array[totalLength++]=StringFunctions.SPACE_BYTE; totalLength+=StringFunctions.encodeInt(array,totalLength,response.getTransactionHandle()); array[totalLength++]=StringFunctions.SPACE_BYTE; byte[] commentBytes=returnCode.getComment().getBytes(); System.arraycopy(commentBytes, 0, array,totalLength, commentBytes.length); totalLength+=commentBytes.length; array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getConnectionParms() != null) { array[totalLength++]=StringFunctions.HIGH_P_BYTE; array[totalLength++]=StringFunctions.COLON_BYTE; totalLength+=ConnectionParmHandler.encodeList(array,totalLength,response.getConnectionParms()); array[totalLength++]=StringFunctions.NEWLINE_BYTE; } return totalLength; }
final DeleteConnectionResponse response = new DeleteConnectionResponse(self, code); final int transaction = dlcx.getTransactionHandle(); response.setTransactionHandle(transaction); System.out.println(response.toString()); sender.tell(response, self);
break; case Constants.CMD_DELETE_CONNECTION: response = new DeleteConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_ENDPOINT_CONFIGURATION: response = new DeleteConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_MODIFY_CONNECTION:
@Override public JainMgcpResponseEvent getProvisionalResponse() { DeleteConnectionResponse provisionalResponse = null; if (!sent) { provisionalResponse = new DeleteConnectionResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); provisionalResponse.setTransactionHandle(commandEvent.getTransactionHandle()); } return provisionalResponse; }
public int encode(JainMgcpResponseEvent event,byte[] array) { DeleteConnectionResponse response = (DeleteConnectionResponse) event; ReturnCode returnCode = response.getReturnCode(); int totalLength=ReturnCodeHandler.encode(array,0,returnCode); array[totalLength++]=StringFunctions.SPACE_BYTE; totalLength+=StringFunctions.encodeInt(array,totalLength,response.getTransactionHandle()); array[totalLength++]=StringFunctions.SPACE_BYTE; byte[] commentBytes=returnCode.getComment().getBytes(); System.arraycopy(commentBytes, 0, array,totalLength, commentBytes.length); totalLength+=commentBytes.length; array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getConnectionParms() != null) { array[totalLength++]=StringFunctions.HIGH_P_BYTE; array[totalLength++]=StringFunctions.COLON_BYTE; totalLength+=ConnectionParmHandler.encodeList(array,totalLength,response.getConnectionParms()); array[totalLength++]=StringFunctions.NEWLINE_BYTE; } return totalLength; }
public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new DeleteConnectionResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (Exception e) { logger.error("Decode of DLCX Response failed", e); } return response; }
/** * Receive notification of the header of a message. Parser will call * this method to report about header reading. * * @param header * the header from the message. */ public void header(String header) throws ParseException { String[] tokens = utils.splitStringBySpace(header); int tid = Integer.parseInt(tokens[1]); response = new DeleteConnectionResponse(source != null ? source : stack, utils.decodeReturnCode(Integer .parseInt(tokens[0]))); response.setTransactionHandle(tid); }
public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new DeleteConnectionResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (Exception e) { logger.error("Decode of DLCX Response failed", e); } return response; }