【发布时间】:2017-11-04 08:50:53
【问题描述】:
我是 freeswitch 的新手,我尝试了从 fs_cli 控制台在 freeswitch 中发起的命令,它工作正常。现在我的要求是从 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 linux freeswitch