@Override public void execute(final Object message) throws Exception { if (logger.isInfoEnabled()) { logger.info("In Ready state"); } // ussdCall.tell(new Answer(), source); // Execute the received RCML here final UntypedActorContext context = getContext(); final State state = fsm.state(); if (downloadingRcml.equals(state) || downloadingFallbackRcml.equals(state) || processingInfoRequest.equals(state)) { response = ((DownloaderResponse) message).get(); if (parser != null) { context.stop(parser); parser = null; } final String type = response.getContentType(); if (type.contains("text/xml") || type.contains("application/xml") || type.contains("text/html")) { parser = parser(response.getContentAsString()); } else if (type.contains("text/plain")) { parser = parser("<UssdMessage>" + response.getContentAsString() + "</UssdMessage>"); } else { final StopInterpreter stop = new StopInterpreter(); source.tell(stop, source); return; } } final GetNextVerb next = GetNextVerb.instance(); parser.tell(next, source); }