Search in sources :

Example 6 with VoiceResponse

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

the class VoiceApp method main.

public static void main(String[] args) {
    get("/hello", (req, res) -> "Hello Web");
    post("/", (request, response) -> {
        Say say = new Say.Builder("Hello from your pals at Twilio! Have fun.").build();
        VoiceResponse voiceResponse = new VoiceResponse.Builder().say(say).build();
        return voiceResponse.toXml();
    });
}
Also used : VoiceResponse(com.twilio.twiml.VoiceResponse) Say(com.twilio.twiml.voice.Say)

Aggregations

VoiceResponse (com.twilio.twiml.VoiceResponse)6 TwiMLException (com.twilio.twiml.TwiMLException)5 Say (com.twilio.twiml.voice.Say)4 Play (com.twilio.twiml.voice.Play)3 Enqueue (com.twilio.twiml.voice.Enqueue)1 Sms (com.twilio.twiml.voice.Sms)1