Hoiw is livekit/generate different from ```service...
# ask-ai
m
Hoiw is livekit/generate different from
Copy code
services:
    redis:
        image: redis
        volumes:
            - redis_data:/data
        ports:
            - 6379:6379
        # The following line might be uncommented to run on MacOS
        # for testing and development purposes only.
        network_mode: host
    livekit:
        image: livekit/livekit-server
        command: --config /etc/livekit.yaml
        network_mode: host
        volumes:
            - ./livekit.yaml:/etc/livekit.yaml
        depends_on:
            redis:
                condition: service_started
    sip:
        image: livekit/sip
        network_mode: host
        environment:
            SIP_CONFIG_BODY: |
                api_key: 'devkey'
                api_secret: 'secret'
                ws_url: '<ws://localhost:7880>'
                redis:
                  address: 'localhost:6379'
                sip_port: 5060
                rtp_port: 10000-20000
                use_external_ip: true
                logging:
                  level: debug
volumes:
    redis_data:
t
Thanks for reaching out, Rahib. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're exploring the
livekit/generate
Docker image! It's thoughtfully designed to help you set up a complete, production-ready LiveKit environment. On the other hand, the
docker-compose.yaml
file you have is usually geared towards local testing or development. Let me walk you through the main differences to make things clearer: • Purpose: The
livekit/generate
image helps you create a deployment-ready package with domain-specific configurations tailored for production, while
docker-compose.yaml
offers a simpler setup intended for local use. • Components: With
livekit/generate
, you get Caddy included, which automatically manages HTTPS and secure connections. In contrast,
docker-compose.yaml
doesn’t include this and usually runs in a less secure development mode. • Deployment Automation: The
livekit/generate
setup comes with handy scripts that automate deployment on cloud platforms or Linux VMs, making your life easier. The
docker-compose.yaml
file, however, requires you to run things manually. • Additional Features: If you’re interested in LiveKit Ingress and Egress,
livekit/generate
supports optional setup for these, while the basic
docker-compose.yaml
doesn’t include them. To sum it up, if you’re aiming for a secure, production-ready deployment,
livekit/generate
is a great choice. But if you just want to experiment or test things locally,
docker-compose.yaml
will do the job nicely. I hope this helps clarify things! Feel free to ask if you want to dive deeper into any part. Sources: Deploy to a VM | LiveKit Docs | test/integration/livekit_test.go
m
since my main focus is on telephony setup so that agent can receive inbound calls do i need to setup TURN ? It does ask for that when i run this command . Also, where do i setup SIP server if i use this because i saw that it does not include the SIP server container?
t
I'd love to help you out! To get a clearer picture, could you please share a bit more about: • Are you thinking of using LiveKit for both WebRTC media and SIP telephony integration? • Do you already have a SIP server in place, or would you like some guidance on setting one up? • Is this setup intended for local testing, or are you planning to deploy it in a production environment? Knowing these details will really help me guide you on whether a TURN server is needed and how to best configure your SIP server. Looking forward to your reply!
m
1. No specifically for the telephony 2. I am just using this
Copy code
sip:
        image: livekit/sip
        network_mode: host
        environment:
            SIP_CONFIG_BODY: |
                api_key: 'devkey'
                api_secret: 'secret'
                ws_url: '<ws://localhost:7880>'
                redis:
                  address: 'localhost:6379'
                sip_port: 5060
                rtp_port: 10000-20000
                use_external_ip: true
                logging:
                  level: debug
3. I am building for production now.
t
For your telephony setup using the
livekit/sip
image in production: • TURN Server: While a TURN server isn’t absolutely required for SIP-based telephony, it’s mainly helpful for WebRTC clients behind strict firewalls—not for SIP signaling or RTP media traffic. If your LiveKit participants (like web or mobile clients) are behind firewalls, you might want to enable TURN in the LiveKit server configuration to help them connect smoothly. • SIP Server Configuration: The
livekit/sip
image works as a bridge between SIP telephony and LiveKit rooms. You can set it up using the
SIP_CONFIG_BODY
environment variable or a configuration file. Just be sure to include your API key, WebSocket URL, Redis address, and the public IP for SIP and RTP ports to keep everything running seamlessly. • Production Setup: For the best performance and to avoid port-mapping headaches, run the SIP service with
--network host
. Also, make sure your firewall allows UDP ports 5060 (for SIP) and 10000–20000 (for RTP) to keep calls flowing smoothly. • Additional Steps: Don’t forget to use the LiveKit CLI to create SIP trunks and dispatch rules, which help route calls properly to your LiveKit rooms. If you’d like me to walk you through any of these steps in more detail, just let me know—I’m here to help! Sources: pkg/sip/server.go | Deploying LiveKit | LiveKit Docs | Ports and firewall | LiveKit Docs
m
So should i still use livekit/generate or not ?
t
For your telephony-focused production setup, using
livekit/generate
isn’t absolutely necessary. It’s mainly designed to help create a complete, production-ready LiveKit deployment, including HTTPS and domain-specific configurations. Since you’re focusing on telephony and already using the
livekit/sip
image, you’re perfectly fine to proceed without it if you: • Manually configure the SIP server and LiveKit server as we discussed earlier. • Make sure your networking is set up properly, including opening the necessary ports (5060 for SIP and 10000–20000 for RTP). • Set up your SIP trunks and dispatch rules to handle call routing. If you’d rather have an automated deployment with extra features like HTTPS and domain setup,
livekit/generate
is still a great starting point. Just keep in mind you’ll need to add the SIP server configuration manually since it’s not included by default. Please feel free to reach out if you’d like me to clarify anything or help you further—I’m here to support you! Sources: Integrating with Telephony | LiveKit Docs | SIP Integration | livekit/livekit_composite | DeepWiki | LiveKit SDKs Overview | LiveKit Docs | OpenAI and LiveKit partner to turn Advanced Voice into an API | OpenAI and LiveKit partner to turn Advanced Voice into an API