Voicemail handling on transferCall
# support
l
How can I handle voicemail detection when using transfer call to an phone number? The tool can fail when the call is refused or transfer fail, but it connect with the voicemail when it is available. I want to return to the assistant when the system detects the voicemail. How can I do that?
v
message has been deleted
@Leobaldo Alcantara To handle voicemail detection when transferring a call to a phone number, you can utilize the
voicemailDetection
feature. Here's how you can set it up: 1. Enable
voicemailDetection
by setting
voicemailDetection.enabled
to
true
. 2. Configure the
machineDetectionTimeout
,
machineDetectionSpeechThreshold
,
machineDetectionSpeechEndThreshold
, and
machineDetectionSilenceTimeout
parameters to fine-tune when the system should consider the call as being answered by a voicemail system. 3. Set the
voicemailMessage
to the message you want the assistant to say if the call is forwarded to voicemail. 4. Implement logic in your voice application to return to the assistant when voicemail is detected. This could involve setting up a callback or event listener that triggers when voicemail is detected, and then executing the necessary steps to return control to the assistant. Would you like to proceed with setting up these configurations, or do you need assistance with a specific part of the process?
You can continue this conversation by mentioning me in the message.
l
This setup only work for the main call, but does not work while transfering theh call. Right?
s
@Leobaldo Alcantara Right now, we’re in the process of fully setting up the Transfer back navigation, and we’re excited to share that we’re making great progress! In the meantime, you can easily implement Transfer navigation programmatically or using Twilio Flex. Essentially, you can transfer the call from us to a conference call that you own. When you do the transfer, just check if it’s a voicemail; if it is, you can take the appropriate action. The same goes for when someone says, "I want to return to the assistant" and the system detects a voicemail or other scenarios. Let me know how can I help you further
l
Thanks @Shubham Bajaj . I'm trying an another solution: - I will keep transfer on hold - Make an new call, check if the representative is available and can respond, do the warm-up using the transcript from the first call. - If representative available, end the second call and continue with the transferCall directly without warm-up. - If representative not available, return an error to the transferCall function
m
@Leobaldo Alcantara : thanks for your tips above. I am relatively new to VAPI but i am already running into similar problem. See my [post about voicemail](https://discord.com/channels/1211482211119796234/1338967884025823364). So with your solution the representative, if available, will receive 2 calls - one just to play the warm up and the other the actual transferred call, is this right? Would you be able to give me any clues and snippets of code about how to keep the transferred call on hold while you are checking the representative availability? Thanks
l
Hi! That's it, you are right. To keep the call on hold, all your need is to create an transfer_call tool with async: false and an higher timeout. Additionally you can add some messages to tool_delay to keep some static messages while representative is not available. When your server receive the transfer call destination request, you should keep that http connection open while checking the representative. Reference: https://docs.vapi.ai/api-reference/tools/create
s
@Leobaldo Alcantara I would like to inquire about your progress. Did you successfully complete this task?
l
Yes, I did
m
Thanks for the tips, @Leobaldo Alcantara . Like I said, I am relatively new to VAPI. I created the
transferCall
tool alright. VAPI platform does follow configuration of tool
destination
and
messages
properties. But I also set
server.url
property on the tool but VAPI does not call this URL when doing the call transfer... The only notification I can reliably get from VAPI on the server is
end-of-call-report
. How do I make VAPI actually call the server URL for a call transfer? What server event are you using to block on? Any ideas? Thanks
l
If you keep the destination undefined, VAPI will call the server.url with an POST request Server Message Transfer Destination Request object (https://docs.vapi.ai/api-reference/webhooks/server-message)
a
Hey Mrincognito, you can also read about it from here
m
Thanks. So you are blocking on
transfer-destination-request
, correct? I was eventually able to get VAPI post to my server with
transfer-destination-request
but the payload coming with this does not even carry the phone number the call is being transferred to (unless you are willing to look into
payload.message.artifact.messages[]
and parse the phone number out of there) Overall, the whole game plan as it looks to me right now seems to be: 1. get
transfer-destination-request
coming to the server and block on it. 2. Parse the phone number the call is forwarded to from the payload and place a second call to that phone number enabling the voice detection on it. 3. Get the voicemail detected or get a live agent to answer the second call. 4. Hangup the second call. If the agent was available then release the first call from the block and let it be blind forwarded. If the second call hit a VM then error out of
transfer-destination-request
Did i get this right? Thanks
l
Correct! That's it. You are welcome