Class BankingIvrService

java.lang.Object
com.bytedesk.call.mrcp4j.service.BankingIvrService

public class BankingIvrService extends Object
银行IVR业务示例 完整的银行客服 IVR 流程实现
Author:
bytedesk.com
  • Field Details

    • asrProvider

      private MrcpProvider asrProvider
    • ttsProvider

      private MrcpProvider ttsProvider
    • asrChannel

      private MrcpChannel asrChannel
    • ttsChannel

      private MrcpChannel ttsChannel
    • recognizedIntent

      private String recognizedIntent
    • recognitionComplete

      private boolean recognitionComplete
    • synthesisComplete

      private boolean synthesisComplete
  • Constructor Details

    • BankingIvrService

      public BankingIvrService()
  • Method Details

    • init

      public void init(String host, int port) throws Exception
      初始化
      Throws:
      Exception
    • executeIvrFlow

      public void executeIvrFlow() throws Exception
      执行IVR流程
      Throws:
      Exception
    • playWelcome

      private void playWelcome() throws Exception
      播放欢迎语
      Throws:
      Exception
    • recognizeIntent

      private void recognizeIntent() throws Exception
      识别用户意图
      Throws:
      Exception
    • processUserRequest

      private void processUserRequest() throws Exception
      处理用户请求
      Throws:
      Exception
    • buildBankingGrammar

      private String buildBankingGrammar()
      构建银行业务语法
    • buildSsml

      private String buildSsml(String text)
      构建SSML
    • handleAsrEvent

      private void handleAsrEvent(MrcpEvent event)
      处理ASR事件
    • handleTtsEvent

      private void handleTtsEvent(MrcpEvent event)
      处理TTS事件
    • waitForRecognitionComplete

      private void waitForRecognitionComplete() throws InterruptedException
      等待识别完成
      Throws:
      InterruptedException
    • waitForSynthesisComplete

      private void waitForSynthesisComplete() throws InterruptedException
      等待合成完成
      Throws:
      InterruptedException
    • main

      public static void main(String[] args)
      主函数示例