clean-shampoo-49002
06/26/2025, 8:36 AMtall-airline-16756
06/26/2025, 8:36 AMtall-airline-16756
06/26/2025, 8:36 AMclean-shampoo-49002
06/26/2025, 8:36 AMtall-airline-16756
06/26/2025, 8:37 AMsip.callStatus
attribute of the participant. When someone answers the call, this attribute switches to active
.
I'll walk you through an example of how you can set this up:
start_time = perf_counter()
while perf_counter() - start_time < 30:
call_status = participant.attributes.get("sip.callStatus")
if call_status == "active":
<http://logger.info|logger.info>("user has picked up")
return
elif call_status == "automation":
# if DTMF is used in the `sip_call_to` number, typically used to dial
# an extension or enter a PIN.
# during DTMF dialing, the participant will be in the "automation" state
pass
elif call_status == "hangup":
# user hung up, we'll exit the job
<http://logger.info|logger.info>("user hung up, exiting job")
break
await asyncio.sleep(0.1)
<http://logger.info|logger.info>("session timed out, exiting job")
ctx.shutdown()
Here's a pro tip: When create_sip_participant
is called, LiveKit starts dialing the user right away. The method doesn't wait around for the user to answer - it moves on immediately. By checking the sip.callStatus
attribute, you'll know exactly when someone picks up the phone. Pretty neat, right?
Sources: Making calls using SIP | LiveKit Docs | Making outbound calls | LiveKit Docsclean-shampoo-49002
06/26/2025, 8:37 AMtall-airline-16756
06/26/2025, 8:37 AMsip.callStatus
attribute for the participant. When it switches to active
, that's your signal that the call has been answered!
I'm here to help if you need more support. If you'd like more in-depth guidance, I'd be happy to connect you with a specialist who can walk you through the details step by step. Just say the word!clean-shampoo-49002
06/26/2025, 2:52 PMtall-airline-16756
06/26/2025, 2:52 PM