You can use the loop
attribute with a value of 0.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say loop="0">Hello World</Say>
</Response>
The 'loop' attribute specifies how many times you'd like the text
repeated. The default is 1. Specifying '0' will cause the
verb to loop until the call is hung up.
https://www.twilio.com/docs/api/twiml/say#attributes-voice
.
or if you are playing an audio file
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play loop="0">https://api.twilio.com/cowbell.mp3</Play>
</Response>
The 'loop' attribute specifies how many times the audio file is
played. The default behavior is to play the audio once. Specifying '0'
will cause the verb to loop until the call is hung up.
https://www.twilio.com/docs/api/twiml/play#attributes