【问题标题】:Plivo Manager Shut downPlivo Manager 关闭
【发布时间】:2017-07-20 05:47:22
【问题描述】:

你好,我在我的 jsp 应用程序中使用 Plivo .. 我有两个来自 index.js 的 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());
            }

%>

【问题讨论】:

    标签: jsp rest httpclient plivo


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

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

      应该在任何时候使用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-03-14
        • 1970-01-01
        • 2011-12-17
        • 2015-02-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多