Can you give me proper json format for creating in...
# ask-ai
a
Can you give me proper json format for creating inbound sip trunk, i tried below but get error that unknown fields. "inbound_addresses": ["172.16.5.1/32", "172.16.5.0/24"], "inbound_numbers_regex": [".*"],
t
Thanks for reaching out, Lokesh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! I wanted to let you know that the
inbound_numbers_regex
field is now deprecated. No worries though, I’m here to guide you through the updated JSON format for creating an inbound SIP trunk. Here’s the correct structure you can use:
Copy code
{
  "trunk": {
    "name": "string",
    "metadata": "string",
    "numbers": [
      "string"
    ],
    "allowed_addresses": [
      "string"
    ],
    "allowed_numbers": [
      "string"
    ],
    "auth_username": "string",
    "auth_password": "string",
    "headers": {
      "string": "string"
    },
    "headers_to_attributes": {
      "string": "string"
    },
    "attributes_to_headers": {
      "string": "string"
    },
    "include_headers": "SIPHeaderOptions",
    "ringing_timeout": "google.protobuf.Duration",
    "max_call_duration": "google.protobuf.Duration",
    "krisp_enabled": false,
    "media_encryption": "SIPMediaEncryption"
  }
}
Just a quick tip: instead of
inbound_addresses
, please use
allowed_addresses
to specify the CIDR or IPs from which you want to accept traffic. Also, use the
numbers
field rather than
inbound_numbers_regex
to define the phone numbers linked to your trunk. If you have any questions or need further help, I’m here for you! Sources: livekit/livekit_sip.pb.go