Environmentally friendly synthesis of indoles. A study of the reaction pathway.