Skip to content

Commit 48d019f

Browse files
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>
1 parent e3cff1b commit 48d019f

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

fern/advanced/sip/troubleshoot-sip-trunk-credential-errors.mdx

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This error occurs during the gateway creation step of SIP trunk provisioning. Va
1313
**In this guide, you'll learn to:**
1414

1515
- Identify the three most common causes of SIP trunk credential validation failures
16+
- Understand when hostnames work (outbound) and when they don't (inbound)
1617
- Resolve hostname-vs-IP, inbound-flag, and IP-allowlist issues
1718
- Verify your gateway configuration against the full parameter reference
1819

@@ -30,21 +31,26 @@ Before you start troubleshooting, ensure you have:
3031
- Your SIP provider's server address, username, and password
3132
- Access to your SIP provider's admin panel (to check IP whitelisting)
3233

33-
## Using a hostname instead of an IP address
34+
## Using a hostname for an inbound gateway
3435

3536
This is the most common cause of this error.
3637

3738
### What happens
3839

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.
4044

4145
### How to check
4246

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.
4448

4549
### How to fix
4650

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:
4854

4955
<Steps>
5056
<Step title="Look up the IP address">
@@ -76,7 +82,7 @@ Replace the hostname with the numeric IPv4 address in your gateway configuration
7682
"ip": "203.0.113.10",
7783
"port": 5060,
7884
"outboundEnabled": true,
79-
"inboundEnabled": false
85+
"inboundEnabled": true
8086
}
8187
]
8288
}
@@ -86,10 +92,27 @@ Replace the hostname with the numeric IPv4 address in your gateway configuration
8692
</Steps>
8793

8894
<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.
9197
</Note>
9298

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+
93116
## Inbound enabled on an outbound-only trunk
94117

95118
### What happens
@@ -157,7 +180,7 @@ The table below lists all available options for each entry in the `gateways` arr
157180

158181
| Option | Type | Default | Description |
159182
| -------------------- | ------- | --------- | ------------------------------------------------------------------------------ |
160-
| `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.|
161184
| `port` | number | `5060` | SIP signaling port. |
162185
| `netmask` | number | `32` | Subnet mask for inbound IP matching. Valid range: 24 to 32. |
163186
| `inboundEnabled` | boolean | `true` | Whether this gateway accepts inbound calls. Set to `false` for outbound-only trunks. |

0 commit comments

Comments
 (0)