Can i get the call duration?
# ask-ai
q
Can i get the call duration?
t
Thanks for reaching out, Niket. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes, you can set and retrieve call duration information in LiveKit's SIP service. Specifically: • For SIP Inbound Trunks: You can configure the
max_call_duration
(maximum call duration) and
ringing_timeout
(maximum time for the call to ring). • For SIP Participants: You can also set
max_call_duration
and
ringing_timeout
when creating a SIP participant. These settings allow you to control the duration of calls and ringing time. Let me know if you need further assistance! Sources: SIP APIs | LiveKit Docs
q
CAn I get the call duration of the call after it is done
t
Currently, I couldn't locate specific information on retrieving the call duration after a call is completed. This might depend on the specific implementation or API usage in your setup. I recommend checking your call logs or API documentation for details on post-call metrics. If you need further assistance, feel free to let me know!
h
@quaint-laptop-92257 You could just track start time when user starts the call and when the user leaves the call you have your end call time substract that from start_time and you have your call duration
t
Thank you for sharing that approach! Yes, tracking the
start_time
when the call begins and the
end_time
when the user leaves the call is a practical way to calculate the call duration. Subtracting the start time from the end time will give you the total duration of the call. Let me know if you need help implementing this or have further questions!