Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Exact Moment When User Answers Outbound Call #136

Closed
vlxdisluv opened this issue Aug 8, 2024 · 5 comments
Closed

Tracking Exact Moment When User Answers Outbound Call #136

vlxdisluv opened this issue Aug 8, 2024 · 5 comments
Labels

Comments

@vlxdisluv
Copy link

We are facing an issue with tracking the exact moment when a user answers a call (picks up the phone) during outbound calling. We wanted to use the participant joined webhook for this, but we noticed that it triggers when the ringing starts, not when the user actually picks up.

Is there a way to more accurately track the moment when the user picks up the phone during an outbound call? Perhaps there is another webhook or method that we can use for this purpose?

Thank you for your assistance!

@davidzhao
Copy link
Member

this makes sense.. we need to align the lifecycle better to match user expectations. we'll work on improving this behavior

@vlxdisluv
Copy link
Author

Hi @davidzhao , could you kindly clarify which status I should listen for to identify that the user has picked up the phone during an outbound call? If I'm not mistaken, I should listen to the tracks?

@dennwc
Copy link
Contributor

dennwc commented Oct 4, 2024

Hey @vlxdisluv! First, participant created by SIP will update it's sip.callStatus to active, which can be observed with participant attribute hook in the SDK. Second, outbound SIP participant will not subscribe to anyone's tracks until the call is dialed. So this could be another indicator.

@vlxdisluv
Copy link
Author

Hey @vlxdisluv! First, participant created by SIP will update it's sip.callStatus to active, which can be observed with participant attribute hook in the SDK. Second, outbound SIP participant will not subscribe to anyone's tracks until the call is dialed. So this could be another indicator.

Is there a way to reliably detect whether a SIP INVITE request was unsuccessful, particularly when the SIP trunk service is unavailable and a 500 error is returned? Can this be tracked through specific events or mechanisms? Additionally, is it possible to determine whether the call was answered by the intended recipient or an answering machine the call was forwarded to?

@dennwc
Copy link
Contributor

dennwc commented Oct 10, 2024

Yes, SIP service will set DisconnectReason for a LK participant to a specific value in this case, see #191. The actual change is livekit/protocol#845.

Regarding answering machine detection - we do not support it directly yet. Should be done externally with an Agent for now. The issue is #117. We now plan to emit specific events via the data channel when SIP service detects telephony tones. This may help the Agent detect it more reliably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants