From 095d1f1e35accbcb7bb9572ac4d2661230bec282 Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期五, 05 九月 2025 16:01:08 +0800 Subject: [PATCH] update --- ruoyi-common/src/main/java/com/ruoyi/common/utils/VoiceNotifyMain.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/VoiceNotifyMain.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/VoiceNotifyMain.java index 37035ba..8e44a20 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/VoiceNotifyMain.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/VoiceNotifyMain.java @@ -44,6 +44,56 @@ // TODO 需要接收状态和话单时,请参考"呼叫状态和话单通知API"接口实现状态通知和话单的接收和解析 // HostingVoiceEventDemoImpl } + public static void call1(String phone) throws Exception { + + // TODO 程序前端要求发起语音通知呼叫,首先使用getplayInfo构造构造playInfoList参数,然后调用doCallNotify方法. + // 以下代码仅供调试使用,实际开发时请删除 + // 构造playInfoList参数 + List<Map<String, Object>> playInfoList = new ArrayList<Map<String, Object>>(); + // 使用音频文件作为第一段放音内容 + playInfoList.add(callNotifyAPI.getplayInfo("BB@.wav")); + // 使用v2.0版本接口的语音通知模板作为第二段放音内容 +// String templateId = "test"; +// List<String> templateParas = new ArrayList<String>(); +// templateParas.add("3"); +// templateParas.add("1栋保安亭"); +// playInfoList.add(callNotifyAPI.getplayInfo(templateId, templateParas)); + // 调用doCallNotify方法 + VoiceNotifyMain.doCallNotify("+862022519218", "+86"+phone, playInfoList); + if (status.indexOf(success) != -1) { + System.out.println(status); + System.out.println(resultcode + " " + resultdesc); + System.out.println("The session id is: " + sessionId); + } + + // TODO 需要接收状态和话单时,请参考"呼叫状态和话单通知API"接口实现状态通知和话单的接收和解析 + // HostingVoiceEventDemoImpl + } + public static void call2(String phone) throws Exception { + + // TODO 程序前端要求发起语音通知呼叫,首先使用getplayInfo构造构造playInfoList参数,然后调用doCallNotify方法. + // 以下代码仅供调试使用,实际开发时请删除 + // 构造playInfoList参数 + List<Map<String, Object>> playInfoList = new ArrayList<Map<String, Object>>(); + // 使用音频文件作为第一段放音内容 + playInfoList.add(callNotifyAPI.getplayInfo("CC@.wav")); + // 使用v2.0版本接口的语音通知模板作为第二段放音内容 +// String templateId = "test"; +// List<String> templateParas = new ArrayList<String>(); +// templateParas.add("3"); +// templateParas.add("1栋保安亭"); +// playInfoList.add(callNotifyAPI.getplayInfo(templateId, templateParas)); + // 调用doCallNotify方法 + VoiceNotifyMain.doCallNotify("+862022519218", "+86"+phone, playInfoList); + if (status.indexOf(success) != -1) { + System.out.println(status); + System.out.println(resultcode + " " + resultdesc); + System.out.println("The session id is: " + sessionId); + } + + // TODO 需要接收状态和话单时,请参考"呼叫状态和话单通知API"接口实现状态通知和话单的接收和解析 + // HostingVoiceEventDemoImpl + } /* * 前端需要发起语音通知呼叫时,调用此方法 该示例只仅体现必选参数,可选参数根据接口文档和实际情况配置. -- Gitblit v1.7.1