You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify that SIP hostnames work for outbound but not inbound gateways (#994)
Update the troubleshooting doc to explain that hostnames are valid for
outbound-only gateways, while inbound gateways require a numeric IPv4
address. Previously the doc incorrectly stated hostnames never work.
- Rename section to 'Using a hostname for an inbound gateway'
- Explain outbound vs inbound hostname behavior
- Provide two fix paths: resolve to IP (for inbound) or disable inbound
- Update gateway config reference table to reflect the nuance
- Add bullet point in overview about hostname behavior
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Sahil Suman <sahilsuman933@users.noreply.github.com>
Copy file name to clipboardExpand all lines: fern/advanced/sip/troubleshoot-sip-trunk-credential-errors.mdx
+31-8Lines changed: 31 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ This error occurs during the gateway creation step of SIP trunk provisioning. Va
13
13
**In this guide, you'll learn to:**
14
14
15
15
- Identify the three most common causes of SIP trunk credential validation failures
16
+
- Understand when hostnames work (outbound) and when they don't (inbound)
16
17
- Resolve hostname-vs-IP, inbound-flag, and IP-allowlist issues
17
18
- Verify your gateway configuration against the full parameter reference
18
19
@@ -30,21 +31,26 @@ Before you start troubleshooting, ensure you have:
30
31
- Your SIP provider's server address, username, and password
31
32
- Access to your SIP provider's admin panel (to check IP whitelisting)
32
33
33
-
## Using a hostname instead of an IP address
34
+
## Using a hostname for an inbound gateway
34
35
35
36
This is the most common cause of this error.
36
37
37
38
### What happens
38
39
39
-
Vapi's API accepts both hostnames (for example, `sip.example.com`) and IPv4 addresses (for example, `203.0.113.10`) in the `gateways[].ip` field. However, the underlying SBC only accepts IPv4 addresses. When you provide a hostname, the SBC rejects the gateway configuration.
40
+
The `gateways[].ip` field accepts both hostnames (for example, `sip.example.com`) and IPv4 addresses (for example, `203.0.113.10`). However, the behavior differs depending on the call direction:
41
+
42
+
-**Outbound gateways** — Hostnames and IPv4 addresses both work. Vapi resolves the hostname when routing outbound calls to your SIP provider.
43
+
-**Inbound gateways** — Only IPv4 addresses work. The SBC needs a numeric IP address to match incoming SIP requests to your trunk. When you provide a hostname with `inboundEnabled: true`, the SBC rejects the gateway configuration.
40
44
41
45
### How to check
42
46
43
-
Look at the value you passed in `gateways[].ip`. If it contains letters (for example, `sip.example.com`), it is a hostname. The SBC needs a numeric IPv4 address instead.
47
+
Look at your gateway configuration. If `inboundEnabled` is `true` (or omitted, since it defaults to `true`) and the `ip` field contains a hostname (for example, `sip.example.com`), this is the cause of the error.
44
48
45
49
### How to fix
46
50
47
-
Resolve the hostname to its IPv4 address, then use that IP directly.
51
+
You have two options depending on whether you need inbound calling:
52
+
53
+
**If you need inbound calling**, resolve the hostname to its IPv4 address:
48
54
49
55
<Steps>
50
56
<Steptitle="Look up the IP address">
@@ -76,7 +82,7 @@ Replace the hostname with the numeric IPv4 address in your gateway configuration
76
82
"ip": "203.0.113.10",
77
83
"port": 5060,
78
84
"outboundEnabled": true,
79
-
"inboundEnabled": false
85
+
"inboundEnabled": true
80
86
}
81
87
]
82
88
}
@@ -86,10 +92,27 @@ Replace the hostname with the numeric IPv4 address in your gateway configuration
86
92
</Steps>
87
93
88
94
<Note>
89
-
Always use the IPv4 address, not the hostname. If your provider's IP changes,
90
-
you need to update the gateway configuration.
95
+
If your provider's IP address changes, you need to update the gateway
96
+
configuration with the new address.
91
97
</Note>
92
98
99
+
**If you only need outbound calling**, you can keep the hostname and disable inbound:
100
+
101
+
```json title="Gateway configuration"
102
+
{
103
+
"provider": "byo-sip-trunk",
104
+
"name": "my sip trunk",
105
+
"gateways": [
106
+
{
107
+
"ip": "sip.example.com",
108
+
"port": 5060,
109
+
"outboundEnabled": true,
110
+
"inboundEnabled": false
111
+
}
112
+
]
113
+
}
114
+
```
115
+
93
116
## Inbound enabled on an outbound-only trunk
94
117
95
118
### What happens
@@ -157,7 +180,7 @@ The table below lists all available options for each entry in the `gateways` arr
|`ip`| string | (required)| IPv4 address of your SIP gateway. Must be a numeric IP address, not a hostname.|
183
+
|`ip`| string | (required)| IPv4 address or hostname of your SIP gateway. Hostnames work for outbound-only gateways. Inbound gateways require a numeric IPv4 address.|
161
184
|`port`| number |`5060`| SIP signaling port. |
162
185
|`netmask`| number |`32`| Subnet mask for inbound IP matching. Valid range: 24 to 32. |
163
186
|`inboundEnabled`| boolean |`true`| Whether this gateway accepts inbound calls. Set to `false` for outbound-only trunks. |
0 commit comments