你好我在我的jsp应用程序中使用Plivo ..我有两个来自索引的jsp页面。 jsp页面我有一个文本框和一个提交按钮..当我在文本框中输入数字并在那时按提交plivo服务电话我可以拨打任何号码..它给了我req_uuid。调用后我从中获取数据json array ..从那个数组我检索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());
}
%>
答案 0 :(得分:1)
Plivo提供全天候技术支持。他们应该能够解决这个问题。
答案 1 :(得分:0)
您应该创建一个plivo客户端eveytime,否则plivo会抛出一个异常,说连接管理器已经关闭
RestAPI plivoClient = new RestAPI(authKey, authToken, version);
应该在使用时完成。