Exemplo n.º 1
0
 /**
  * Handle the cases of failure, "0" for operator, and "*" for canceled
  *
  * @param choice
  * @return choice, or null if handled already
  */
 private IvrChoice checkChoice(IvrChoice choice) {
   switch (choice.getIvrChoiceReason()) {
     case FAILURE:
     case TIMEOUT:
       m_controller.failure();
       return null;
     case CANCELED:
       if (m_speakCanceled) {
         // "Canceled."
         m_loc.play("canceled", "");
       }
       break;
     case SUCCESS:
       if (m_operatorOn0) {
         // "0" means transfer to operator
         if (choice.getDigits().equals("0")) {
           m_controller.transferToOperator();
           return null;
         }
       }
   }
   return choice;
 }