@Override public JainMgcpResponseEvent getProvisionalResponse() { EndpointConfigurationResponse provisionalresponse = null; if (!sent) { provisionalresponse = new EndpointConfigurationResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); } return provisionalresponse; }
public String encode(JainMgcpResponseEvent event) { EndpointConfigurationResponse response = (EndpointConfigurationResponse) 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); return s.toString(); }
public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new EndpointConfigurationResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (Exception e) { logger.error("Parsing of EndpointConfiguration Response failed", e); } return response; }
public int encode(JainMgcpResponseEvent event,byte[] array) { EndpointConfigurationResponse response = (EndpointConfigurationResponse) 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; return totalLength; }
/** * 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 EndpointConfigurationResponse(source != null ? source : stack, utils .decodeReturnCode(Integer.parseInt(tokens[0]))); response.setTransactionHandle(tid); }
public int encode(JainMgcpResponseEvent event,byte[] array) { EndpointConfigurationResponse response = (EndpointConfigurationResponse) 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; return totalLength; }
public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new EndpointConfigurationResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (Exception e) { logger.error("Parsing of EndpointConfiguration Response failed", e); } return response; }
@Override public JainMgcpResponseEvent getProvisionalResponse() { EndpointConfigurationResponse provisionalresponse = null; if (!sent) provisionalresponse = new EndpointConfigurationResponse(source != null ? source : stack,ReturnCode.Transaction_Being_Executed); return provisionalresponse; } }
@Override public JainMgcpResponseEvent getProvisionalResponse() { EndpointConfigurationResponse provisionalresponse = null; if (!sent) provisionalresponse = new EndpointConfigurationResponse(source != null ? source : stack,ReturnCode.Transaction_Being_Executed); return provisionalresponse; } }