当前位置: 首页>>代码示例>>Java>>正文


Java TwiMLResponse.toXML方法代码示例

本文整理汇总了Java中com.twilio.sdk.verbs.TwiMLResponse.toXML方法的典型用法代码示例。如果您正苦于以下问题:Java TwiMLResponse.toXML方法的具体用法?Java TwiMLResponse.toXML怎么用?Java TwiMLResponse.toXML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.twilio.sdk.verbs.TwiMLResponse的用法示例。


在下文中一共展示了TwiMLResponse.toXML方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: service

import com.twilio.sdk.verbs.TwiMLResponse; //导入方法依赖的package包/类
@Override
public void service(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
  TwiMLResponse twiml = new TwiMLResponse();
  Say say = new Say("You will now be connected to the first caller in the queue.");
  Dial dial = new Dial();
  Queue queueInDial = new Queue("Queue Demo");
  Redirect redirect = new Redirect();

  try {
    twiml.append(say);
    twiml.append(dial);
    dial.append(queueInDial);
    twiml.append(redirect);
  } catch (final TwiMLException e) {
      e.printStackTrace();
  }

  return twiml.toXML();
}
 
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:20,代码来源:queue-redirect.6.x.java

示例2: service

import com.twilio.sdk.verbs.TwiMLResponse; //导入方法依赖的package包/类
@Override
public void service(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
  final TwiMLResponse twiml = new TwiMLResponse();
  final Enqueue enqueue = new Enqueue();
  enqueue.setWorkflowSid("WW0123456789abcdef0123456789abcdef");

  final com.twilio.sdk.verbs.Task task = new com.twilio.sdk.verbs.Task("{\"account_number\":\"12345abcdef\"}");
  task.setPriority(5);
  task.setTimeout(200);

  try {
      enqueue.append(task);
      twiml.append(enqueue);
  } catch (final TwiMLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }

  return twiml.toXML();
}
 
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:21,代码来源:example.6.x.java

示例3: service

import com.twilio.sdk.verbs.TwiMLResponse; //导入方法依赖的package包/类
@Override
public void service(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
  final TwiMLResponse twiml = new TwiMLResponse();
  final Enqueue enqueue = new Enqueue();
  enqueue.setWorkflowSid("WW0123456789abcdef0123456789abcdef");
  enqueue.setWaitUrl("/hold_music.php");
  enqueue.setAction("/post_bridge_survey.php");

  final com.twilio.sdk.verbs.Task task = new com.twilio.sdk.verbs.Task("{\"account_number\":\"12345abcdef\"}");

  try {
      enqueue.append(task);
      twiml.append(enqueue);
  } catch (final TwiMLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }

  return twiml.toXML();
}
 
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:21,代码来源:example.6.x.java

示例4: service

import com.twilio.sdk.verbs.TwiMLResponse; //导入方法依赖的package包/类
@Override
public void service(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
  final TwiMLResponse twiml = new TwiMLResponse();
  final Enqueue enqueue = new Enqueue();
  enqueue.setWorkflowSid("WW0123456789abcdef0123456789abcdef");

  final com.twilio.sdk.verbs.Task task = new com.twilio.sdk.verbs.Task("{\"account_number\":\"12345abcdef\"}");

  try {
      enqueue.append(task);
      twiml.append(enqueue);
  } catch (final TwiMLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }

  return twiml.toXML();
}
 
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:19,代码来源:example.6.x.java

示例5: service

import com.twilio.sdk.verbs.TwiMLResponse; //导入方法依赖的package包/类
@Override
public void service(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
  TwiMLResponse twiml = new TwiMLResponse();
  Dial dial = new Dial();
  Queue queueInDial = new Queue("Queue Demo");

  try {
    twiml.append(dial);
    dial.append(queueInDial);
  } catch (final TwiMLException e) {
      e.printStackTrace();
  }

  return twiml.toXML();
}
 
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:16,代码来源:queue-agent.6.x.java

示例6: service

import com.twilio.sdk.verbs.TwiMLResponse; //导入方法依赖的package包/类
@Override
public void service(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
  final TwiMLResponse twiml = new TwiMLResponse();
  final Enqueue enqueue = new Enqueue();
  enqueue.setWorkflowSid("WW0123456789abcdef0123456789abcdef");

  try {
    twiml.append(enqueue);
  } catch (final TwiMLException e) {
      e.printStackTrace();
  }

  return twiml.toXML();
}
 
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:15,代码来源:example.6.x.java


注:本文中的com.twilio.sdk.verbs.TwiMLResponse.toXML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。