- Why is there no ring back tone / early media when using machine detection?
- Why is there no ring back tone / early media?
Product: Voice API
When using a Connect action in the NCCO for a Voice API call, ring back tone (early media) is played from the destination carrier. When using Machine Detection with a Connect action, currently the early media is not being relayed to the caller.
There are two possible workarounds to ensure you have early media played to the caller for Connect actions when using Voice API:
- Do not use Machine Detection for Connect actions.
- Play an audio file to the caller while waiting for the recipient to answer. To do this, you would need to:
- Change the Connect action to a Named Conversation to start the call as a conference.
- When you receive the "answered" event for the first Call ID, send a PUT request to the Call ID with a Stream action. The Stream URL should be a ringback tone.
- Invite the 2nd party into the same Conversation
- When you receive the "answered" event for the second Call ID, send a DELETE request to stop the Stream action for the first Call ID.
- The two parties will now be able to speak as usual.
You can now specify a ring back tone for the caller to hear on a call using the parameter
ringbackTone and setting the audio file you want the caller to hear.