-
Notifications
You must be signed in to change notification settings - Fork 166
Description
I am running livekit and livekit sip locally and docker both with latest images and am trying to place an outbound call to my PBX. It is working correctly for the most part, however I noticed that SIP BYEs initiated from my PBX where never being honored by livekit. I ran a network grab on the server and got the following PCAP. I noticed byes were being sent to what seemed to be a local docker IP, rather than the public IP as expected. From experience I immediately thought this was due to an invalid Contact header
I dug around a bit online and I also checked the source code and saw that the Contact header is being populated from the SignalingIp which is populated from the config based on nat_1_to_1_ip or use_external_ip
So I came up with the following config
sip:
image: livekit/sip
network_mode: host
environment:
SIP_CONFIG_BODY: |
api_key: '${LIVEKIT_API_KEY}'
api_secret: '${LIVEKIT_API_SECRET}'
ws_url: '${LIVEKIT_URL}'
sip_hostname: 'CorrectIP'
redis:
address: '127.0.0.1:6379'
sip_port: 5060
rtp_port: 10000-10100
nat_1_to_1_ip: CorrectIP
media_nat_1_to_1_ip: CorrectIP
logging:
level: debug
depends_on:
livekit:
condition: service_started
On start I can see the correct log in client.go
2026-02-23T11:38:53.712Z INFO sip sip/client.go:78 client starting {"nodeID": "NE_Mx5J2RjhGX3D", "local": "CorrectIP", "external": "CorrectIP"}
However the Contact Header is still incorrect after this.
I also noticed that the local IP is being shown in the From header as well, which should be using the same SignalingIp
Is there something I'm missing ? I'm honestly not sure what's wrong here