i am using kuberneties to deploy my own livekit, b...
# ask-ai
a
i am using kuberneties to deploy my own livekit, but i am unable to see SIP server that comes with it. How can i enable that?
t
Thanks for reaching out, Aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To help you enable the SIP server in LiveKit when deploying on Kubernetes, here’s a friendly step-by-step guide you can follow: 1. Prepare the SIP Server Configuration: Start by creating a YAML configuration file (for example,
sip-config.yaml
) with important details like
api_key
,
api_secret
,
ws_url
, and Redis connection info. Don’t forget to set
use_external_ip
to
true
to make sure everything connects smoothly. 2. Create a Kubernetes ConfigMap: You can run the command
kubectl create configmap sip-config --from-file=config.yaml=sip-config.yaml
to mount your configuration into the pod easily. 3. Deploy the SIP Service: When deploying, use a manifest that includes
hostNetwork: true
so UDP ports are properly exposed. If you’d like, I’m happy to share example manifests to guide you through this. 4. Ensure Network Accessibility: Make sure to open UDP ports
5060
(for SIP) and
10000–20000
(for RTP) on your firewall or cloud provider. Also, check that your pod is running on a node with a public IP address for smooth connectivity. 5. Create SIP Trunk and Dispatch Rules: Use the
livekit-cli
or server SDKs to set up SIP trunks and dispatch rules so your calls are handled just right. If you’d like, I’m here to provide detailed examples of the configuration or deployment manifests—just let me know! Sources: gclb-sample.yaml | Deploy to Kubernetes | LiveKit docs | test/integration/sip_test.go | Self-hosted SIP server | LiveKit docs
a
can you make a prompt for it so that i can give it to cursor or codex which will useusing AWS CLI
t
To help you get started with deploying the SIP server on Kubernetes using AWS CLI, here’s a friendly example you can follow:
Copy code
# Step 1: Create a ConfigMap for SIP configuration
aws eks --region <region> update-kubeconfig --name <cluster-name>
kubectl create configmap sip-config --from-file=config.yaml=sip-config.yaml

# Step 2: Deploy the SIP Service
cat > sip-deployment.yaml <<EOF
apiVersion: v1
kind: Service
metadata:
  name: livekit-sip
spec:
  type: ClusterIP
  selector:
    app: livekit-sip
  ports:
    - name: sip-udp
      protocol: UDP
      port: 5060
      targetPort: 5060
    - name: rtp-udp
      protocol: UDP
      port: 10000
      targetPort: 10000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: livekit-sip
spec:
  replicas: 1
  selector:
    matchLabels:
      app: livekit-sip
  template:
    metadata:
      labels:
        app: livekit-sip
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      containers:
      - name: sip
        image: livekit/sip
        env:
        - name: SIP_CONFIG_BODY
          valueFrom:
            configMapKeyRef:
              name: sip-config
              key: config.yaml
        ports:
        - containerPort: 5060
          protocol: UDP
        - containerPort: 10000
          protocol: UDP
EOF

kubectl apply -f sip-deployment.yaml

# Step 3: Open Firewall Ports
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol udp --port 5060 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol udp --port 10000-20000 --cidr 0.0.0.0/0
Just make sure to replace placeholders like
<region>
,
<cluster-name>
, and
<security-group-id>
with your actual AWS details. If you run into any questions or need a hand with any step, I’m here to help you through it!
a
Is there any other ways to connect livekit with telephony instead of SIP.
t
I'm happy to share that LiveKit primarily connects with telephony systems using the Session Initiation Protocol (SIP). This allows for features like SIP trunking, DTMF, and even bridging SIP calls directly into LiveKit rooms as participants. At the moment, SIP is the main way to integrate telephony with LiveKit. If you have a particular use case or need a hand setting up SIP, please feel free to reach out—I’m here to help and guide you through the process! Sources: Agents telephony integration | LiveKit Docs | SIP Integration & Telephony | livekit/livekit_composite | DeepWiki | .github/CODEOWNERS | Create and configure a Plivo SIP trunk | LiveKit docs | OpenAI and LiveKit partner to turn Advanced Voice into an API
a
I want to use websocket API to stream data to teliphony istead of using SIP for quality audio output
t
I’m happy to share that LiveKit can use a WebSocket API to stream audio data to telephony systems as an alternative to SIP. This is done through the TrackEgress functionality, which exports raw PCM audio data from a participant’s audio track to a WebSocket server. From there, the WebSocket server can process or forward the audio to telephony systems that accept WebSocket-based audio input. Here are some key things to keep in mind with this approach: • Audio is streamed as raw PCM (
pcm_s16le
) at the original sample rate (usually 48kHz). • Binary frames carry the audio data, while text frames carry metadata like muting events. • If you need signaling (such as call setup, teardown, or DTMF), that will need to be handled separately. • This method works really well for custom integrations with modern telephony APIs that support WebSocket audio streams. If you’re working with a specific telephony provider or building a custom gateway, please feel free to reach out—I’d be glad to guide you through the implementation details and help make it as smooth as possible. Sources: Track egress | LiveKit docs | Baseten STT plugin guide | LiveKit Docs | OpenAI and LiveKit partner to turn Advanced Voice into an API | Agents telephony integration | LiveKit Docs | LiveKit SDKs Overview | LiveKit Docs
a
@gorgeous-hydrogen-44699
✅ 1
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
g
how we can use TrackEgress functionality over the telephony
a
I am tryng to connect to plivo websocket using their XML aplication. how can i do that without using SIP
t
LiveKit's TrackEgress functionality lets you stream audio tracks as raw PCM data to a WebSocket endpoint, and I’m here to help you get it set up smoothly. Here’s a simple way to do it: 1. Initiate TrackEgress: You can use LiveKit's SDK or CLI to start streaming audio to a WebSocket endpoint. For example, in Node.js:
Copy code
const info = await egressClient.startTrackEgress(
  'my-room',
  'wss://your-websocket-endpoint',
  trackID
);
1. WebSocket Data: LiveKit streams audio as raw PCM (
pcm_s16le
) in binary frames. Text frames carry metadata like muting events. 2. Connection Lifecycle: The WebSocket connection will close when the track is unpublished or the participant leaves the room. That said, whether LiveKit's TrackEgress works seamlessly with Plivo's WebSocket endpoint and XML application really depends on Plivo’s support for raw PCM audio. It might be helpful to check Plivo's documentation or consider a custom gateway to handle any needed format conversion or signaling. Please feel free to reach out if you want to explore this further or need any more guidance—I’m here to help! Sources: Track egress | LiveKit docs | cmd/lk/examples/track-egress.json