SIP 403 Forbidden on a SIP Trunk: Find the Blocking Rule
A SIP 403 Forbidden on a SIP trunk means the carrier identified you but refused the INVITE on policy grounds, such as IP allowlist, caller ID, destination permissions, account state or limits. The reason phrase in the trace shows which.
- A 403 is a policy refusal, so resending credentials or changing the password will never fix it.
- Registration only proves the credentials were accepted. Carriers authorize the INVITE separately, so a trunk can register and still get 403 on every call.
- Capture one failing call with pjsip set logger on and read the source IP, From, P-Asserted-Identity, Request-URI and the reason phrase before changing anything.
- The symptom pattern (all calls, international only, one caller ID, intermittent) narrows the cause to IP, destination, caller ID or limits.
- When escalating, send the carrier the Call-ID, a UTC timestamp, the public source IP and the dialed number in E.164.
What does SIP 403 Forbidden mean on a trunk, and how is it different from 401 and 407?
A SIP 403 Forbidden on a SIP trunk is a refusal, not a login prompt. 401 Unauthorized (from a registrar or UAS) and 407 Proxy Authentication Required (from a proxy) are challenges: the server sends a nonce and invites you to retry with credentials. A 403 comes with no challenge. The server understood the request, knows or has decided who you are, and refuses it anyway.
That makes a 403 a policy or authorization decision. Resending the same INVITE with a new password changes nothing, because the carrier is not asking for one.
Many carriers also use 403 where other systems would use 402 for payment problems or 404 for an unprovisioned route. Read the reason phrase and any Reason or Warning header, because the status code alone is too coarse.
| Code | Server's message | Retry with credentials helps? |
|---|---|---|
| 401 / 407 | Authenticate first (a challenge with a nonce) | Yes, answer the challenge |
| 403 | Identified, but not allowed | No, change the request or the account policy |
| 404 | No such destination or route provisioned | Maybe, if the dial format is wrong |
| 402 / 503 | Payment required, or capacity or limit exceeded | No, fix the balance or the limit |
Why can a trunk register fine and still get 403 on every call?
A successful REGISTER only proves that the credentials were accepted and a contact binding was stored. It says nothing about whether your INVITEs are permitted. Carriers authorize registration and calls separately, so every call can fail while the status shows Registered.
Several checks can run on the INVITE: source IP against an allowlist, From and P-Asserted-Identity against the DIDs on the account, destination against allowed countries, then balance and channel limits. Each one can produce a 403, and your job is to find which one fired.
With IP authentication there is no registration at all. A "working" trunk then only means OPTIONS pings are answered, which is also weak evidence, so test with a real call.
How do I capture the failing call and read the 403?
Make one test call and capture it, so there is a single clean dialog to read. Do not capture during live traffic, because the dialogs interleave and you will misread them.
- Enable logging: run pjsip set logger on (PJSIP) or sip set debug on (chan_sip) at the Asterisk CLI.
- Place one call from an extension to a known number through the trunk.
- Find the outgoing INVITE and the 403 coming back, then note the Call-ID, source IP, From, P-Asserted-Identity, Contact and Request-URI.
- Read the reason phrase and any Reason or Warning header.
- Turn logging off with pjsip set logger off so the log does not fill with noise.
# --- commands ---
asterisk -rvvv
pjsip set logger on
# place one test call, then:
pjsip show endpoints
pjsip show registrations
# live ladder view outside the CLI
sngrep -d any port 5060
# or a pcap for escalation
tcpdump -i any -s 0 -w /tmp/trunk403.pcap port 5060 or udp portrange 10000-20000
# --- what the trace looks like (trimmed, documentation addresses) ---
<--- Transmitting SIP request to UDP:203.0.113.10:5060 --->
INVITE sip:442079460000@sip.carrier.example SIP/2.0
# Request-URI: wrong host? missing + or country code?
Via: SIP/2.0/UDP 198.51.100.7:5060;branch=z9hG4bK1a2b
# must be your NAT public address
From: "Office" <sip:2025550123@sip.carrier.example>;tag=abc
# From user: must be a DID on the account, often E.164
P-Asserted-Identity: <sip:2025550123@sip.carrier.example>
Call-ID: 7f3c9e@pbx
<--- Received SIP response from UDP:203.0.113.10:5060 --->
SIP/2.0 403 Forbidden - International not enabled
# Reason phrase: the most useful line in the trace
Call-ID: 7f3c9e@pbx
# Quote this Call-ID to the carrierWhich rule did the carrier enforce? A decision table
Start with the reason phrase, then confirm with the symptom pattern. Phrases are carrier specific, so treat the wording as a hint and the pattern as the proof. A bare "403 Forbidden" with no text is common, and then the pattern does most of the work.
| Reason phrase or symptom | Likely cause | Fix |
|---|---|---|
| "IP not allowed", "Unauthorized source", all calls fail after a router or ISP change | Public IP not on the allowlist | Add the current WAN IP, and any failover IP, in the carrier portal |
| "Caller ID not allowed", "Invalid From", only some extensions fail | From or PAI is not a DID on the account, or not in E.164 | Set Outbound CID to an owned DID in E.164 and force it on the trunk |
| Anonymous or blocked calls fail | Carrier rejects withheld CID | Disable CID blocking, or send a valid PAI |
| "International not enabled", "Destination barred", local works, some prefixes fail | Destination block or country not enabled | Enable the country in the portal, check dial prefix and E.164 format |
| "Insufficient funds", "Account suspended", all calls fail suddenly | Zero balance, unpaid invoice, trial restriction or fraud hold | Check the portal and open a ticket |
| Intermittent, fails during busy periods or bursts | Concurrent-call or CPS limit | Lower the dial rate, raise the limit with the carrier |
| Everything fails right after unusual traffic | Fraud suspension or locked-out IP | Audit the PBX, then ask the carrier to unblock |
| All calls fail, odd host in the Request-URI | Wrong realm, proxy or domain | Correct server_uri, client_uri, from_domain and outbound_proxy |
How do I fix IP allowlist and caller ID rejections?
The carrier sees your NAT public address, never the PBX private address. It stops matching when a dynamic WAN IP changes, when multi-WAN failover egresses through a second IP, when a cloud PBX has a different elastic IP than the one listed, or when the carrier also requires the media IP to be listed.
Caller ID is the other frequent cause. Carriers must prevent spoofing, so many check that the From user or P-Asserted-Identity is a number owned by the account, in E.164. An extension with a 4-digit internal CID will fail, while one without a custom CID may succeed. That pattern points straight at caller ID.
In FreePBX, set the trunk's Outbound CallerID to an owned DID, then choose Force Trunk CID under CID Options. Also check the extension and outbound route CID, because the route value can override the trunk when Override Extension is on.
- On the PBX itself, run the lookup in the code below and note the address. A laptop on the same LAN may use a different route.
- Compare it with the carrier's allowed IPs and add any missing signalling and media addresses.
- Set the transport NAT values so Via and Contact show the public address, and set the endpoint's From and PAI options.
- Make one test call and confirm the INVITE's source IP in sngrep is the one you whitelisted.
; run on the PBX to learn the public IP:
; curl -s https://ifconfig.me ; echo
; curl -s https://api.ipify.org ; echo
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_signaling_address=198.51.100.7
external_media_address=198.51.100.7
local_net=192.168.1.0/24
[carrier-endpoint]
type=endpoint
transport=transport-udp
context=from-pstn
disallow=all
allow=ulaw,alaw
from_user=12025550123 ; match an owned DID
from_domain=sip.carrier.example
callerid="Office" <12025550123>
send_pai=yes ; adds P-Asserted-Identity
trust_id_outbound=yes
outbound_proxy=sip:sip.carrier.example\;lr
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yesWhy do only some calls return 403: destinations, limits, fraud or wrong host?
Carriers bar international, premium-rate, mobile and satellite destinations by default to cap fraud losses. If a local number works and +44 does not, the 403 is likely a destination block that needs enabling in the portal.
Test the dial format before blaming policy. FreePBX outbound routes strip and prepend digits, so a pattern like 011. with no prepend may send 011442079460000 to a carrier that wants +442079460000. The Request-URI in the INVITE is exactly what the carrier received.
Zero or negative balance, a trial account, an unpaid invoice or a fraud hold often come back as 403 rather than 402. Some carriers also return 403 or 503 when concurrent calls or calls per second are exceeded. FreePBX's Maximum Channels setting is local, so when it is reached Asterisk stops the call itself and no carrier response appears.
Toll fraud attempts or repeated failed authentication can trigger automatic suspension or a locked-out IP. Run pjsip show endpoints for unknown entries, look for floods of INVITEs from unknown IPs, and confirm 5060 is not open to the world.
Finally, a wrong realm, proxy or domain gets refused. Verify outbound_proxy, server_uri and client_uri against the carrier's provisioning sheet.
How do I confirm the fix and escalate to the carrier?
After each single change, make one test call and watch it in sngrep or the pjsip log. The 403 should be replaced by 100 Trying, 180 Ringing or 200 OK. Change one variable at a time, otherwise you will not know which fix worked.
Common mistakes are changing the password repeatedly, opening the firewall to everyone, skipping a test call after an IP change, and ignoring the reason phrase. Re-registering can also mislead, since it succeeds even while calls are blocked.
If the trace still shows 403, send the carrier a short message with exact identifiers so they can find the log line.
Subject: Outbound INVITE rejected with 403 Forbidden
Trunk/account: <account ID>
Timestamp (UTC): 2026-11-22 14:05:12
Source public IP: 198.51.100.7
Call-ID: 7f3c9e@pbx
Dialed number: +442079460000
From / PAI sent: 12025550123
Response received: SIP/2.0 403 Forbidden - International not enabled
Local numbers work. Please confirm which rule rejected this INVITE
(IP ACL, caller ID, destination, balance, or limit) and enable it.
Pcap attached. Common questions
Will changing the SIP password fix a 403 Forbidden?
No. A 403 is not an authentication challenge, so a new password changes nothing unless the carrier also resets an account lock. Spend that time reading the reason phrase and checking IP, caller ID and destination rules.
Why do calls work from one extension but give 403 from another?
The usual cause is a different caller ID. One extension may send an owned DID and the other an internal number or an unowned CID, which the carrier rejects. Compare the From and P-Asserted-Identity in both traces.
Does a 403 on a trunk mean my PBX was hacked?
Not necessarily, since most 403s come from simple policy such as a changed IP or a disabled country. But a sudden 403 on everything after unusual traffic can be a fraud suspension, so check for unknown endpoints, call floods and exposed SIP ports.
Can NAT problems cause a 403?
Yes, if the carrier sees a private or unexpected address in Via, Contact or From, it can reject the INVITE. Set external_signaling_address, external_media_address and local_net on the transport, and verify the source IP in the trace.
How do I tell a carrier 403 from one generated by Asterisk?
Look at the Received line in the pjsip log. A carrier 403 arrives from the carrier's IP with its own headers, while an Asterisk-generated rejection never leaves the box and shows no incoming response from the carrier.