DuckieD
VAPIโ€ข10mo ago
Duckie

SIP Trunk Authentication Issue โ€“ 403 Forbidden Error

Hi Sergio! ๐Ÿ‘‹

I can see you're having authentication issues with your SIP trunk. Based on the information you've provided, here are some potential causes for the SIP 403 Forbidden error:

Common Authentication Issues

  • Credential Format: Make sure your username and password match exactly what's configured in your VAPI account support
  • Authentication Method Mismatch: Verify whether VAPI is expecting IP-based or credential-based authentication support
### Configuration Suggestions
I notice you're using the older SIP configuration format in Asterisk. Our documentation suggests using PJSIP configuration for better compatibility. Here's an example of how it might look:

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[byo-sip-trunk]
type=endpoint
transport=transport-udp
context=from-internal
disallow=all
allow=ulaw
outbound_auth=byo-sip-trunk-auth
aors=byo-sip-trunk

[byo-sip-trunk-auth]
type=auth
auth_type=userpass
username=your_outbound_username
password=your_outbound_password

[byo-sip-trunk]
type=aor
qualify_frequency=60
contact=sip:sip.vapi.ai:5060


API Configuration

You might also want to verify your trunk configuration in VAPI matches this format:

{
  "provider": "byo-sip-trunk",
  "name": "BYOC Trunk",
  "credentials": {
    "username": "YourUsername",
    "password": "YourPassword"
  },
  "gateways": [
    {
      "ip": "YourStaticIP",
      "port": "YourStaticPort",
      "netmask": 32,
      "inboundEnabled": true,
      "outboundEnabled": true,
      "outboundProtocol": "udp"
    }
  ]
}


Additional Troubleshooting

Was this page helpful?