protected String getNextGreetingAudio(HttpServletRequest req)
    throws ServletException, IOException {
        
        int index = 0;
        BeanCollection promptBeanList = retrievePromptBeanList(req);
        if (promptBeanList.size() == 0)
            return null;
        
        String strIndex = (String) getServletContext().getAttribute(
                "currentGreetingIndex");
        if (strIndex == null) {
            for (int i = 0; i < promptBeanList.size(); i++) {
                if (((PromptBean) promptBeanList.getItem(i)).isActive()) {
                    index = i;
                    break;
                }
            }
        } else
            index = Integer.parseInt(strIndex);
        
        PromptBean promptBean = (PromptBean) promptBeanList.getItem(index);
        boolean done = false;
        for (int i = index + 1; i < promptBeanList.size(); i++) {
            if (((PromptBean) promptBeanList.getItem(i)).isActive()) {
                index = i;
                done = true;
                break;
            }
        }
        if (!done) {
            for (int i = 0; i < promptBeanList.size(); i++) {
                if (((PromptBean) promptBeanList.getItem(i)).isActive()) {
                    index = i;
                    done = true;
                    break;
                }
            }
        }
        getServletContext().setAttribute("currentGreetingIndex",
                String.valueOf(index));
        return promptBean.getAudio();
    }