@Override public JainMgcpResponseEvent getProvisionalResponse() { AuditConnectionResponse provisionalResponse = null; if (!sent) { provisionalResponse = new AuditConnectionResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); provisionalResponse.setTransactionHandle(remoteTID); } return provisionalResponse; }
ReturnCode returnCode = response.getReturnCode(); s.append(returnCode.getValue()).append(SINGLE_CHAR_SPACE).append(response.getTransactionHandle()).append( SINGLE_CHAR_SPACE).append(returnCode.getComment()).append(NEW_LINE); if (response.getCallIdentifier() != null) { s.append("C:").append(response.getCallIdentifier()).append(NEW_LINE); if (response.getNotifiedEntity() != null) { s.append("N:").append(utils.encodeNotifiedEntity(response.getNotifiedEntity())).append(NEW_LINE); if (response.getLocalConnectionOptions() != null) { s.append("L:").append(utils.encodeLocalOptionValueList(response.getLocalConnectionOptions())).append( NEW_LINE); if (response.getMode() != null) { s.append("M:").append(response.getMode()).append(NEW_LINE); if (response.getConnectionParms() != null) { s.append("P:").append(utils.encodeConnectionParms(response.getConnectionParms())).append(NEW_LINE); if (RCfirst && response.getRemoteConnectionDescriptor() != null) { s.append(NEW_LINE).append(response.getRemoteConnectionDescriptor()).append(NEW_LINE); if (response.getLocalConnectionDescriptor() != null) { s.append(NEW_LINE).append(response.getLocalConnectionDescriptor()).append(NEW_LINE); if (!RCfirst && response.getRemoteConnectionDescriptor() != null) { s.append(NEW_LINE).append(response.getRemoteConnectionDescriptor()).append(NEW_LINE);
response = new AuditConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_AUDIT_ENDPOINT:
ReturnCode returnCode = response.getReturnCode(); totalLength+=StringFunctions.encodeInt(array,totalLength,response.getTransactionHandle()); array[totalLength++]=StringFunctions.SPACE_BYTE; byte[] commentBytes=returnCode.getComment().getBytes(); if (response.getCallIdentifier() != null) byte[] callBytes=response.getCallIdentifier().toString().getBytes(); System.arraycopy(callBytes, 0, array,totalLength, callBytes.length); totalLength+=callBytes.length; if (response.getNotifiedEntity() != null) totalLength+=NotifiedEntityHandler.encode(array,totalLength,response.getNotifiedEntity()); array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getLocalConnectionOptions() != null) totalLength+=LocalOptionValueHandler.encodeList(array,totalLength,response.getLocalConnectionOptions()); array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getMode() != null) totalLength+=ConnectionModeHandler.encode(array,totalLength,response.getMode()); array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getConnectionParms() != null)
response = new AuditConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_AUDIT_ENDPOINT:
ReturnCode returnCode = response.getReturnCode(); totalLength+=StringFunctions.encodeInt(array,totalLength,response.getTransactionHandle()); array[totalLength++]=StringFunctions.SPACE_BYTE; byte[] commentBytes=returnCode.getComment().getBytes(); if (response.getCallIdentifier() != null) byte[] callBytes=response.getCallIdentifier().toString().getBytes(); System.arraycopy(callBytes, 0, array,totalLength, callBytes.length); totalLength+=callBytes.length; if (response.getNotifiedEntity() != null) totalLength+=NotifiedEntityHandler.encode(array,totalLength,response.getNotifiedEntity()); array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getLocalConnectionOptions() != null) totalLength+=LocalOptionValueHandler.encodeList(array,totalLength,response.getLocalConnectionOptions()); array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getMode() != null) totalLength+=ConnectionModeHandler.encode(array,totalLength,response.getMode()); array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getConnectionParms() != null)
@Override public JainMgcpResponseEvent getProvisionalResponse() { AuditConnectionResponse provisionalResponse = null; if (!sent) { provisionalResponse = new AuditConnectionResponse(source != null ? source : stack,ReturnCode.Transaction_Being_Executed); provisionalResponse.setTransactionHandle(remoteTID); } return provisionalResponse; }
response = new AuditConnectionResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_AUDIT_ENDPOINT:
@Override public JainMgcpResponseEvent getProvisionalResponse() { AuditConnectionResponse provisionalResponse = null; if (!sent) { provisionalResponse = new AuditConnectionResponse(source != null ? source : stack,ReturnCode.Transaction_Being_Executed); provisionalResponse.setTransactionHandle(remoteTID); } return provisionalResponse; }
@Override public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new AuditConnectionResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (IOException e) { logger.error("Parsing of AUCX 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 AuditConnectionResponse(source != null ? source : stack, utils.decodeReturnCode(Integer .parseInt(tokens[0]))); response.setTransactionHandle(tid); }
@Override public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new AuditConnectionResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (IOException e) { logger.error("Parsing of AUCX Response failed ", e); } return response; }