why is my sip accepting calls on any number ? I ha...
# ask-ai
m
why is my sip accepting calls on any number ? I have setup inbound trunks to take only 1200 but if i make the call from SIP url and port i can call at any number? Is that intended? even though inbound trunk specify the number ?
t
Thanks for reaching out, Rahib. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you get this sorted out! Could you please share a bit more about how your SIP setup is configured? Specifically: • Are you using LiveKit's SIP integration or another SIP service? • What specific settings have you applied to your inbound trunks to restrict calls to the number 1200? • Do you have any additional routing rules or configurations in place? Understanding these details will really help us figure out why calls might be coming through on any number. Looking forward to your reply!
Hi there! To help you restrict your SIP service from accepting calls on any number, you can use the
allowed_numbers
field in your trunk configuration. This way, only calls coming from the numbers you specify will be accepted, keeping things nice and secure for you. Here’s a simple example of how you can update your trunk configuration:
Copy code
{
  "trunk": {
    "allowed_addresses": [
      "40.69.125.114/32"
    ],
    "auth_password": "dummmy_password",
    "auth_username": "dummy_username",
    "name": "Cloud metric trunk",
    "numbers": [
      "+13438845306",
      "+3438845306",
      "3438845306"
    ],
    "allowed_numbers": [
      "+13438845306"
    ]
  }
}
With this setup, only calls from
+13438845306
will get through. If you don’t set the
allowed_numbers
field, calls from any number will be accepted by default. Please feel free to reach out if you’d like a hand with applying this configuration or if you have any other questions—I’m here to help! Sources: SIP inbound trunk | LiveKit Docs | sip/sip.go | SIP APIs | LiveKit Docs
m
yes calls from any number should be accepted but not to any number on my sip. I have received calls to my sip reaching to number 123213123 even thought i have mentioned my number specifically why is taht ?
t
Thanks for sharing these details! Just to make sure I fully understand, could you please clarify if the calls to those unintended numbers (like 123213123) are reaching your agent room, or are they being rejected right after hitting the SIP service? Also, do you happen to have any custom routing rules or wildcard settings in your dispatch rules? Getting this info will really help us pinpoint the root cause and get things sorted out for you.
m
they do reach the agent. I dont have any routing rules in dispatch.
t
I understand how important it is to keep your SIP calls secure and directed to the right numbers. To help with this, you can set up dispatch rules that include clear restrictions. These rules guide how calls are routed, and without them, calls might end up going to your agent room by default. For instance, you can create a dispatch rule that only allows calls to certain numbers:
Copy code
{
  "rule": {
    "dispatchRuleDirect": {
      "roomName": "private-room"
    }
  },
  "inbound_numbers": [
    "+15105550100"
  ],
  "name": "Private Room Rule"
}
This way, only calls to
+15105550100
will be directed to that room, and any calls to other numbers won’t match the rule and will be declined. If you'd like, I’m here to help you set up these dispatch rules step-by-step. Just let me know! Sources: livekit/livekit_sip.pb.go | SIP dispatch rule | LiveKit Docs
m
but i have attached my inbound trunk to the dispatch rule shouldnt that automatically capture inbound numbers ?
t
I understand this can be a bit tricky, so let me help clarify. Attaching an inbound trunk to a dispatch rule doesn’t automatically limit calls to only the numbers set up on that trunk. The real restriction happens at the trunk level, based on the
numbers
field in your trunk's configuration. To make sure everything works smoothly, please double-check that your inbound trunk is set up with the exact numbers it should accept calls for. Here’s an example to guide you:
Copy code
{
  "trunk": {
    "numbers": [
      "+15105550100"
    ]
  }
}
If you’ve confirmed the trunk is configured correctly but calls to other numbers are still coming through, there might be something off in the trunk setup. Please feel free to reach out—I’m here to help you review or update your configuration whenever you need. Sources: livekit/livekit_sip.pb.go | SIP APIs | LiveKit Docs