| | |
| | | // 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 |
| | | } |
| | | |
| | | /* |
| | | * 前端需要发起语音通知呼叫时,调用此方法 该示例只仅体现必选参数,可选参数根据接口文档和实际情况配置. |