Skip to content

Inbound SIP call rejected as “flood” and No SIP trunk matched #520

@naimdotcom

Description

@naimdotcom

heyy, i got problem with sip call from twilio. livekit sip service reject call with "reason": "flood" and log say "No SIP trunk matched". but i check config like 10 times — ip and number is matching! why this happening? 😩

my setup

  • livekit server: latest docker (nov 2025)
  • livekit sip: latest docker too (nov 2025)
  • run on: docker compose, ubuntu 22.04 vps
  • network: public ip, twilio sip calling me

my configs (simple version)

dispatch rule

{  
  "rule": { "dispatchRuleIndividual": { "roomPrefix": "call-" } },  
  "trunkIds": ["ST_xxxxxxxx"],  
  "name": "lk-gemini",  
  "inboundNumbers": ["+XX01X80000000", "+XX150000000"]  
}  

inbound trunk (twilio trunk)

{  
  "trunk": {  
    "name": "lk-gemini",  
    "numbers": ["+XX150000000", "+xx01580000000"],  // i put both format  
    "allowedAddresses": [  
      "54.172.60.0/30",  
      "54.244.51.0/30"  
    ],  
    "authUsername": "xxxxx",  
    "authPassword": "xxxxx"  
  }  
}  

livekit-server config

port: 7880  
rtc:  
  use_external_ip: true  # important!  
redis: redis:6379  
room: auto_create: true  
logging: level: debug  

livekit-sip config

port: 5060  
ws_url: ws://livekit-server:7880  
redis: redis:6379  
use_external_ip: true  # same here  
logging: level: debug  

log error (copy paste)

livekit-sip | INFO sip/inbound.go:335 processing invite {"fromIP": "54.172.60.0", "fromHost": "sip.twilio.com", "fromUser": "+8801580000000", "toUser": "call-CA6cc33669cab039d699179c40663798be"}  
livekit-server | DEBUG service/ioservice_sip.go:148 No SIP trunk matched for auth {"toUser": "call-CA6cc33669cab039d699179c40663798be", "fromUser": "+8801580000000", "src": "54.172.60.0"}  
livekit-sip | DEBUG sip/inbound.go:707 Rejecting inbound flood {"reason": "flood"}  

what i do to test

  1. setup twilio trunk point to my livekit sip server (port 5060)
  2. made trunk config with twilio ip ranges (copied from twilio docs)
  3. made dispatch rule for numbers like "+XX150000000"
  4. call from twilio to my number

what should happen

call go to room like call-<twilio_call_id>

what actually happen

call reject immediately with "flood" reason. log say no trunk match even though:

  • ip 54.172.60.0 is in my allowedAddresses (twilio range)
  • number +8801580000000 is in my trunk numbers

maybe problem?

  • does livekit not like cidr ranges?
  • is ip format wrong? twilio send 54.172.60.0 but maybe livekit want full ip?
  • case sensitivity on numbers?

please help! i stuck 2 days on this. Thanks! 😅

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions