@Override public void doProcess(ExecutorRequest req, ExecutorResponse resp, ExecutorContext execContext) throws Exception { executorType = req.getExecutorType(); if (DSR_SIGNAL_TYPE.equals(executorType)) { String signal = (String) req.getAttributes().get(SIGNAL); if (END_AUDIO_SIGNAL.equals(signal)) { procObj.getProfile().netIOEnd(); // tell the recognizer that it has all the audio proxy.endAudio(); // Stop reading chunk data callback.doEnd(); } else if (CANCEL_SIGNAL.equals(signal)) { // The user canceled, so tell the recognizer to stop processing proxy.release(); } else if (INIT_RECOGNIZER_SIGNAL.equals(signal)) { // HARD CODE TNCONTEXT - REMOVE ONCE DONGHENG FIXES DSM RULES hardCodeTnContext(execContext, req.getUserProfile()); procObj.profile.netIOBegin(); procObj.profile.totalProcessBegin(); RecContext rc = (RecContext) req.getAttributes().get(ProtocolConstants.REC_CONTEXT); rc.user = req.getUserProfile(); rc.ttsFormat = rc.user.getAudioFormat(); rc.tnContext = execContext.getTnContext(); List<GpsData> gpsData = req.getGpsData(); if (gpsData != null && gpsData.size() > 0) { // just use the first fix GpsData data = gpsData.get(0); rc.location = new Stop(); rc.location.lat = data.lat; rc.location.lon = data.lon; } else { logger.log(Level.WARNING, "Unablet o get GPS data from request."); rc.location = new Stop(); rc.location.lat = 0; rc.location.lon = 0; } // process the meta information processMetaInfo(rc); // Initialize the recognizer proxy.init(procObj); } else logger.log(Level.WARNING, "Unrecognized dsr signal: " + signal); } else if (DSR_AUDIO_TYPE.equals(executorType)) { // write audio packet to the recognizer byte[] audioData = (byte[]) req.getAttributes().get(ProtocolConstants.AUDIO); proxy.addAudioSeg(audioData); } else logger.log(Level.WARNING, "Did not recognize dsr packet type: " + executorType); }