首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Plivo经理关闭

Plivo经理关闭
EN

Stack Overflow用户
提问于 2013-12-06 10:59:57
回答 2查看 258关注 0票数 0

你好,我在我的jsp应用程序中使用Plivo。我有两个来自索引的jsp页面。jsp页面我有一个文本框和一个提交按钮。当我在文本框中输入号码并按submit键时,plivo服务呼叫,我可以调用任何号码。它给我req_uuid .After调用,我从json数组中获得数据。我从那个数组中检索call_uuid。当我把那个call_uuid传给录音的时候。record=restAPI.recordConference(record_params);

我会犯类似于"Manager is shutdown"的错误

来自Plivo的JSP页面调用..。

代码语言:javascript
复制
    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());
            }

%>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-12-06 15:10:43

Plivo拥有24/7的技术支持。他们应该能处理这件事。

票数 1
EN

Stack Overflow用户

发布于 2017-07-19 21:47:22

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

代码语言:javascript
复制
RestAPI plivoClient = new RestAPI(authKey, authToken, version);

无论何时使用都应该这样做。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20422208

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档