How to persist sip rules created on livekit locall...
# ask-ai
s
How to persist sip rules created on livekit locally hosted as they get deleted if the machine is restarted
✅ 1
t
Thanks for reaching out, Youssef. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about SIP rules getting deleted after a restart on a locally hosted LiveKit instance. SIP rules (trunks and dispatch rules) are kept in memory in the LiveKit server and are not persisted to disk. That means they will be lost on restart. To keep them across restarts you need to recreate them automatically at startup. Two common approaches: • Store your SIP configuration (trunk definitions, numbers, dispatch rules) in a durable place — e.g., a config file, environment variables, or a database. • On your application or server startup, call the LiveKit Server API / SDK to recreate the inbound trunks and dispatch rules programmatically. For example, run a startup script that uses the LiveKit Server SDK (Python, JS, etc.) to call create_sip_inbound_trunk and create_sip_dispatch_rule with your saved configuration. If you’d like, tell me: • which SDK or language you’re using (Python, Node, Go, etc.), and • where you prefer to store the config (file, DB, env vars), and I’ll provide a compact startup script example you can run after each reboot. Sources: Creating SIP Inbound Trunks and Dispatch Rules with Python SDK | Python SDKs | livekit/livekit_composite | DeepWiki, with interactive elements
s
In the EC2 machine where i can find the file to take a backup from it
t
Thanks — regarding where SIP rules are stored on your EC2 instance: LiveKit keeps SIP trunks and dispatch rules in memory only and does not write them to a file on disk by default. That means there is no built-in file on the EC2 machine you can back up to preserve SIP rules across restarts. What you can do: • Persist your SIP config (trunk definitions, numbers, dispatch rules) externally — for example, in a JSON/YAML config file, a database, or environment variables on the EC2 instance. • Add a startup script that reads that persisted config and recreates the SIP resources via the LiveKit Server API/SDK (e.g.,
create_sip_inbound_trunk
,
create_sip_dispatch_rule
). If you want, tell me: • which language/SDK you use (Python, Node, Go, etc.), and • whether you prefer storing the config in a file or a database — and I’ll provide a compact backup/restore starter script you can run on your EC2 instance. , with interactive elements