当我在文本框中输入任何数字时。我接到来自 plivo 号码的电话,并收到 request_uuid
和 call_uuid.Now
。我想对通话进行录音。
当我调用另一个人并且他/她接到我的电话时,应该进行录音。
谁能告诉我如何完成这个任务?
package plivo.helper;
import java.util.LinkedHashMap;
import com.plivo.helper.api.client.RestAPI;
import com.plivo.helper.exception.PlivoException;
import com.plivo.helper.api.response.response.Record;
public class RecordConference
{
public static void main(String[] args) {
RestAPI restAPI = new RestAPI("XXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXX", "v1");
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
params.put("conference_name", "1234");
Record response = new Record();
try {
response = restAPI.recordConference(params);
System.out.println(response.url);
} catch (PlivoException plivoException) {
plivoException.printStackTrace();
}
}
这里我得到了 null
响应作为结果。
最佳答案
嗨,尝试一下这个录音,效果很好
public Class RecordConference {
public static void main(String...args){
PlivoClient newCall = new PlivoClient("v0.1", auth_id, auth_token , plivo_url, true);
CallFeature call = newCall.call();
Map<String, String> callParams = new HashMap<String, String> ();
callParams.put("CallUUID", "eau76-rty-67ueg-876960-ghy");
callParams.put("FileFormat", "wav");
callParams.put("FilePath","/home/teleswitch/development/prompts/");
callParams.put("FileName","record1");
RecordStartResponse callResponse = call.recordStart(callParams);
System.out.println(callResponse);
}
}
关于java - 我如何开始使用 plivo 录制我的通话?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20717042/