sip icon indicating copy to clipboard operation
sip copied to clipboard

SIP INVITE Fails with 403 Forbidden on LiveKit

Open narendra-bluebash opened this issue 9 months ago • 3 comments

We're encountering an issue while setting up outbound SIP in LiveKit. The response to our INVITE request returns an unexpected status: SIP Status: 403 (FORBIDDEN).

Here are the connection details we're using:

SIP Address: a2east.sipregistration.com

Username: XXXXX

Password: XXXXXXX

Number: XXXXXX

We’ve verified these credentials using Zoiper, and both inbound and outbound calls work successfully there. Could you please help us debug this issue?

narendra-bluebash avatar Apr 10 '25 13:04 narendra-bluebash

same problem, with 2 sip providers:

  • Mango (RU)
  • Belline (RU)

heeelp, please. How can i debug this case? all logging: debug is set, but no details in docker consoles, in sip container too. Just 403 Forbidden error

nzhenev avatar Apr 11 '25 06:04 nzhenev

@davidzhao @dennwc

theomonnom avatar Apr 11 '25 09:04 theomonnom

Answered in Slack. We'll need PCAP to debug this.

dennwc avatar Apr 11 '25 12:04 dennwc

Got this issue too

GDemay avatar Aug 20 '25 09:08 GDemay

When using the LiveKit SIP server with some providers (e.g. Sipgate), outbound calls may fail with a 403 error.

The issue is that LiveKit sets the From header user part to the caller number instead of the SIP username.

Wrong header: From: "<number>" <sip:<number>@sipconnect.sipgate.de>

Expected Header: From: "<username>" <sip:<username>@sipconnect.sipgate.de>

To fix this:

  1. Use the SIP username as the number when creating the SIP outbound trunk.
  2. Add a P-Preferred-Identity header to set the caller ID (phone number).

Correct trunk configuration:

{
  "trunk": {
    "name": "Sipgate",
    "address": "sipconnect.sipgate.de",
    "transport": "SIP_TRANSPORT_UDP",
    "numbers": ["USERNAME"],
    "authUsername": "USERNAME",
    "authPassword": "PASSWORD",
    "headers": {
      "P-Preferred-Identity": "<sip:[email protected]>"
    }
  }
}

akhtarialireza avatar Oct 05 '25 12:10 akhtarialireza