Search in sources :

Example 1 with Enqueue

use of com.twilio.twiml.voice.Enqueue in project api-snippets by TwilioDevEd.

the class Example method service.

public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
    Enqueue enqueue = new Enqueue.Builder().name("Queue Demo").build();
    VoiceResponse twiml = new VoiceResponse.Builder().enqueue(enqueue).build();
    response.setContentType("application/xml");
    try {
        response.getWriter().print(twiml.toXml());
    } catch (TwiMLException e) {
        e.printStackTrace();
    }
}
Also used : VoiceResponse(com.twilio.twiml.VoiceResponse) Enqueue(com.twilio.twiml.voice.Enqueue) TwiMLException(com.twilio.twiml.TwiMLException)

Aggregations

TwiMLException (com.twilio.twiml.TwiMLException)1 VoiceResponse (com.twilio.twiml.VoiceResponse)1 Enqueue (com.twilio.twiml.voice.Enqueue)1