Phone Number with the SIP Trunk Association does n...
# support
v
created sip trunk successfully { "id": "xxxxxxxxxx-6f05-415b-bbd3-xxxxxxxxxx", "orgId": "xxxxxxxxxx-f610-4141-8aff-xxxxxxxxxx", "provider": "byo-sip-trunk", "createdAt": "2025-03-12T06:00:19.991Z", "updatedAt": "2025-03-12T06:00:19.991Z", "gateways": [ { "ip": "167.172.153.212", "port": 5060, "inboundEnabled": true, "outboundEnabled": true } ], "name": "Connexces", "outboundAuthenticationPlan": { "authPassword": "xxxxxxxxxx!#$", "authUsername": "xxxxxxxxxx", "sipRegisterPlan": { "realm": "xxxxxxxxxx", "domain": "xxxxxxxxxx", "username": "xxxxxxxxxx", "publicIpInContactEnabled": false } }, "sbcAccountConfiguration": { "trunkId": "xxxxxxxxxx-b54f-4e8f-92f8-xxxxxxxxxx", "accountId": "xxxxxxxxxx-e77c-4c29-97f1-xxxxxxxxxx", "gatewayIds": [ "xxxxxxxxxx-e69e-4fb3-9ca6-xxxxxxxxxx" ], "accountApiKey": "xxxxxxxxxx-f2d4-4378-b604-xxxxxxxxxx", "applicationId": "xxxxxxxxxx-4d2a-4a87-8cdf-xxxxxxxxxx" } } but when it comes to Associate a Phone Number with the SIP Trunk it gives an error request { "provider": "byo-phone-number", "name": "+xxxxxxxxxxx", "numberE164CheckEnabled": false, "credentialId": "xxxxxxxxxx-6f05-415b-bbd3-xxxxxxxxxx" } response { "message": "Couldn't Create Phone Number.", "error": "Bad Request", "statusCode": 400 }
v
Hi there! I see you're having trouble associating a phone number with your SIP trunk. Looking at your request payload, I noticed a key issue: Your request is missing the required
number
field. According to our documentation, when associating a phone number with a SIP trunk, you need to include the following fields:
Copy code
json
{
  "provider": "byo-phone-number",
  "name": "Your SIP Number Name", 
  "number": "your-sip-phone-number",  // This field is missing in your request
  "numberE164CheckEnabled": false,
  "credentialId": "your-trunk-credential-id"
}
Additionally, here are some other potential issues that could cause a Bad Request error: 1. The
name
field should typically be a descriptive name (like "Telnyx SIP Number") rather than the phone number itself 2. Make sure you're not including any unnecessary properties in your request payload 3. Verify that your SIP trunk configuration is correct and compatible with the phone number you're trying to associate Could you try adding the
number
field with your phone number value and see if that resolves the issue? 😊 Sources: - [Common causes of a 400 Bad Request error](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333747605628391434) - [Required fields for associating a phone number with a SIP trunk](https://docs.vapi.ai/advanced/sip/telnyx) - [Restrictions for associating phone numbers with SIP trunks](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334336219584135168)
Message marked as helpful by @Vladimir! 🎉
p
@Valdimir checking if this is resolved for you!!