Open akshatvg opened 2 months ago
Indeed, SIP creates room participant before the call is established and may play a ringtone to the room during this time. Once the call is picked up, it will switch audio to it.
Thus, this problem can be solved in a few ways:
cc @keepingitneil
I think we need a bit of explicit signaling (perhaps via the new attributes system) to signal that a participant is ready to receive agent speech.
For example, participant.attributes['readyForAgent'] = true
For a regular participant, we could set this when the user has subscribed to the agent's audio For SIP participant, it could be set once the call is established.
@dennwc now that we have an event to notify publisher if their track has been subscribed to. I think on the SIP side we should do the following:
Nice! I will make the necessary changes then. SIP will still have to support both early and late track publishing, though. We still need to publish earlier if play_ringtone
flag is set.
I think sip should always publish asap.. but it should not subscribe to remote tracks until the user has picked up?
Sorry, I misread your comment. Sure, makes total sense :+1:
Description: I'm experiencing an issue with the outbound call feature where the bot starts talking before the person picks up the call. I am using Twilio SIP for making these calls. Ideally, I want the bot to start its interaction only after the call has been answered. Below are the details of my setup:
Steps to Reproduce:
Expected Behavior: The bot should begin speaking only after the recipient has picked up the call.
Actual Behavior: The bot starts talking immediately after the call is initiated, even if the recipient hasn't picked up the call yet.
Environment:
Possible Workaround: Is there any configuration in LiveKit or Twilio SIP that I might have missed which could delay the bot's speech until the call is picked up?
Thank you for your assistance in resolving this issue.