You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Outbound Call Bot Starts Talking Before Call is Picked Up #114
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:
Configure an outbound call using Twilio SIP.
Initiate the call.
Observe the bot starts talking before the call is picked up by the recipient.
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.
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.
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:
SIP should not create participant before the call is established. It's unlikely that we will implement it, because we'd still want see some visual indication of the call being made.
SIP can publish call status updates. This will require Agents framework to also wait for certain status before starting the actual processing.
If ringtone is disabled, SIP could avoid track publishing until call is connected. This might be the cleanest way. Agents might also need to wait for the track.
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.
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.
Activity
dennwc commentedon Jun 20, 2024
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
davidzhao commentedon Jun 21, 2024
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.
davidzhao commentedon Jul 15, 2024
@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:
dennwc commentedon Jul 15, 2024
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_ringtoneflag is set.davidzhao commentedon Jul 16, 2024
I think sip should always publish asap.. but it should not subscribe to remote tracks until the user has picked up?
dennwc commentedon Jul 16, 2024
Sorry, I misread your comment. Sure, makes total sense 👍
TEL-1253: report jitter buffer duplicate packets
TEL-1253: report jitter buffer duplicate packets (#942)