I have this simple code to place a call and upon connection forward to Dialogflow CX so the person who is being called can interact with the bot.
Somehow, if voicemail is reached it not only forwards to Dialogflow CX but also plays the "agent says" response in an intent named Voicemail.
If, for example, someone answers the phone (no voicemail reached) then it plays the Welcome intent with the welcome event.
Anyway I am just baffled at how it knows to play the Voicemail intent on it's own. Has anyone heard about this?
if (phone) {
const call = await client.calls.create({
twiml: `<Response>
<Dial>+1919XXXXXXX</Dial>
</Response>` ,
to: phone, // Your Twilio phone number
from: '1XXXXXXXXXX'
});
}