你好,我在我的jsp应用程序中使用Plivo。我有两个来自索引的jsp页面。jsp页面我有一个文本框和一个提交按钮。当我在文本框中输入号码并按submit键时,plivo服务呼叫,我可以调用任何号码。它给我req_uuid .After调用,我从json数组中获得数据。我从那个数组中检索call_uuid。当我把那个call_uuid传给录音的时候。record=restAPI.recordConference(record_params);
我会犯类似于"Manager is shutdown"的错误
来自Plivo的JSP页面调用..。
call_params = new LinkedHashMap();
LinkedHashMap record_params = new LinkedHashMap();
String to=request.getParameter("to");
String from=request.getParameter("from");
String toPlus="+91"+ to;
call_params.put("from","+111111111111");
call_params.put("to", toPlus);
call_params.put("answer_url", "http://dl.dropbox.com/u/54579287/Docs/speak.xml");
Call call;
try
{
call = restAPI.makeCall(call_params);
out.println("Request UUID---->>" + call.requestUUID);
}
catch (PlivoException e)
{
System.out.println(e.getMessage());
}
try
{
DefaultHttpClient client = new DefaultHttpClient();
HttpGet request1 = new HttpGet(url);
request1.addHeader("User-Agent", USER_AGENT);
request1.addHeader(BasicScheme.authenticate(new UsernamePasswordCredentials("username", "password"), "UTF-8",false));
HttpResponse response1 = client.execute(request1);
System.out.println("Response Code : " + response1.getStatusLine().getStatusCode());
data = EntityUtils.toString(response1.getEntity());
dataArray =data.split(",");
}
catch (Exception ex)
{
}
JSONObject mJSONObject = new JSONObject(data);
try
{
JSONArray mjSONArray = mJSONObject.getJSONArray("objects");
for (int i = 0;i>>>>" + call_uuid);
}
}
catch (JSONException ex)
{
System.out.println(ex);
}
Record record;
record_params.put("conference_name","Recording");
record_params.put("call_uuid",call_uuid);
try
{
record=restAPI.recordConference(record_params);
out.println("hello Man");
out.println(record.url);
out.println(record.error);
out.println(record.api_id);
out.println(record.message);
}
catch (PlivoException e)
{
System.out.println(e.getMessage());
}
%>发布于 2013-12-06 15:10:43
Plivo拥有24/7的技术支持。他们应该能处理这件事。
发布于 2017-07-19 21:47:22
您应该在每次使用plivo客户端时创建一个plivo客户端,否则plivo会抛出一个异常,说明连接管理器已关闭。
RestAPI plivoClient = new RestAPI(authKey, authToken, version);无论何时使用都应该这样做。
https://stackoverflow.com/questions/20422208
复制相似问题