Skip to content

LiveKit Inbound

Route inbound PSTN calls from SignalWire to LiveKit via SWML connect.

How It Works

  1. A caller dials a SignalWire phone number
  2. SignalWire executes the assigned SWML script
  3. The connect verb bridges the call to LiveKit's SIP domain
  4. LiveKit handles the call with its AI pipeline

SWML Script

yaml
version: 1.0.0
sections:
  main:
    - connect:
        to: sip:%{call.to}@your-unique-SIP-domain-from-Livekit.com;transport=tcp

Replace your-unique-SIP-domain-from-Livekit.com with the SIP domain provided by LiveKit.

Setup Steps

1. Create the SWML Script

In your SignalWire Dashboard, create a new SWML script using the configuration above.

2. Assign Phone Number

In the SignalWire Dashboard, assign the SWML script to the phone number that will receive inbound calls.

3. Configure LiveKit SIP Trunk

In LiveKit:

  1. Create an inbound SIP trunk
  2. Add your SignalWire phone number(s) in E.164 format (e.g., +14155551234)
  3. Save the trunk configuration

Optional: Add Call Recording

Prepend a record_call section to capture recordings:

yaml
version: 1.0.0
sections:
  main:
    - record_call:
        stereo: true
        format: mp3
    - connect:
        to: sip:%{call.to}@your-unique-SIP-domain-from-Livekit.com;transport=tcp

Recordings appear in the Logs tab of your SignalWire Dashboard.

Troubleshooting

  • Verify the SIP domain is correct in your LiveKit account settings
  • Ensure the phone number is in E.164 format in LiveKit's trunk configuration
  • Check the SignalWire Dashboard Logs tab for SWML execution details

SignalWire Developer Documentation