0

你好我在我的jsp应用程序中使用Plivo..我有两个来自索引的jsp页面。jsp页面我有一个文本框和一个提交按钮..当我在文本框中输入数字并按下提交当时plivo服务呼叫,我可以拨打任何号码..它给了我req_uuid。打电话后我得到了数据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());
            }

%>
4

2 回答 2

1

Plivo 提供 24/7 全天候技术支持。他们应该能够处理这个问题。

于 2013-12-06T15:10:43.653 回答
0

您应该在每次使用时创建一个 plivo 客户端,否则 plivo 会抛出异常,提示连接管理器已关闭

RestAPI plivoClient = new RestAPI(authKey, authToken, version);

应在使用时完成。

于 2017-07-19T21:47:22.363 回答