Hello, is this a good approach to get the duration...
# agents
c
Hello, is this a good approach to get the duration of the call or there is better approach thank you
@session.on("close")
_def_ on_close(_ev_: CloseEvent):
logger.info(_f_" Userdata : {session.userdata.summary()}")
logger.warning(_f_"Type of disconnection: {_ev_.reason}")
logger.info(_f_"Room creation: {_ctx_.room.creation_time}")
logger.info(_f_"Room closed at: {datetime.fromtimestamp(_ev_.created_at)}")
l
Depending on your use case, for cloud-hosted agents you can use the Analytics API: https://docs.livekit.io/home/cloud/analytics-api/
🙌 1
c
Thank yo