本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}