我是 freeswitch 的新手,我已经尝试从 fs_cli 控制台在 freeswitch 中使用 originate 命令并且它工作正常。现在我的要求是从 Java 应用程序执行相同的操作。我尝试了以下代码。
package org.freeswitch.esl.client.outbound.example;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Call {
Call() throws IOException {
Process pr = Runtime.getRuntime().exec("fs_cli -x reloadxml");
BufferedReader br = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String str = null;
while ((str = br.readLine()) != null) {
System.out.println(str);
}
System.out.print("success");
}
public static void main(String[] args) throws IOException {
Call call;
call = new Call();
}
}
最佳答案
关于java - 如何使用java代码执行FreeSwitch命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47109039/