Hi,
Is there an API available to programmatically download PCAP files, we would want to store them in our system and run some tools to detect potential errors that happened in calls. We are using LiveKit Cloud with 3rd party SIP connnections.
Thanks,
Akil
Hi, no, there is no API to automatically download PCAP files from the dashboard, and there are currently no plans to add one I’m afraid.
The recommended approach is to use webhooks or events to monitor calls and then download the pcap manually from the dashboard for further investigation as needed:
@Akil_Udayakumar, Agreeing with the no-PCAP-API answer above. For your actual goal, flagging calls that errored, you likely do not need the raw PCAP: LiveKit already exposes the SIP call outcome as a participant attribute. Every SIP leg carries sip.callStatus (tracks the lifecycle, including disconnected and error states) alongside sip.callID and sip.phoneNumber (protocol attrs.go), and the SIP service sets that status to the error/disconnected states on failure (sip outbound.go). So the webhook already linked above gives you enough to detect and store failures programmatically:
ev = receiver.receive((await req.body()).decode(), req.headers["Authorization"])
if ev.event == "participant_left":
a = ev.participant.attributes
if "sip.callID" in a: # this leg was a SIP call
store({
"call_id": a["sip.callID"],
"number": a.get("sip.phoneNumber"),
"status": a.get("sip.callStatus"), # terminal status, incl. error / disconnected
})
That covers “which calls failed” without the PCAP. Keep the manual PCAP pull for the deeper packet-level cases where you actually need the trace.