How to Route a DID Number to a SIP Trunk, PBX or Softphone
A practical walkthrough of inbound DID routing: E.164 vs national format, FreePBX inbound routes, channel sizing, the 404/480/503 failure codes and one-way audio fixes.
A practical walkthrough of inbound DID routing: E.164 vs national format, FreePBX inbound routes, channel sizing, the 404/480/503 failure codes and one-way audio fixes.

You have bought a number. Now the calls have to land somewhere you control. This is the part most guides skip: what actually travels between the caller''s handset and your PBX, which format your dialplan has to match, and the four reasons inbound DIDs silently fail.
When someone dials your DID, the call does not "know" where you are. It walks a chain:
+442079460000, +15125550123.The number decides where the call goes. The trunk decides how it gets there. Channels decide how many at once. Keeping those three separate makes troubleshooting much shorter when something breaks.
Because the destination is just a SIP address, the same number can point at an on-premise Asterisk box, a cloud PBX, a softphone registered to your switch, or a voice application. Nothing about the number is tied to a device.
This single decision causes most "my DID doesn''t ring" tickets. Our gateway delivers the dialed number in E.164 (+442079460000). Many older dialplans, however, were written to match national format (02079460000) or the number without the leading zero (2079460000).
Pick one of three approaches and apply it consistently:
+44… string.In Asterisk/FreePBX that preprocessing is usually a from-did-intro or a strip-prefix setting on the trunk; in FreeSWITCH it is a regex on the destination_number variable. The principle is identical: normalise the number once, at the edge, then let every downstream route use one format.
In the portal, each DID is assigned to a destination when you order it and can be reassigned later:
Two options matter here and are worth setting deliberately:
A minimal FreePBX-style inbound route is three fields:
| Field | Value |
|---|---|
| DID number | +442079460000 (or your normalised form) |
| Caller ID | blank (any caller) |
| Destination | extension, ring group, IVR or queue |
If you run several DIDs on one trunk, the destination can branch on the To header instead of creating one route per number — a single dialplan block that maps numbers to queues scales better than a hundred manual entries.
Then confirm the switch will actually accept the traffic:
Channels are concurrent calls, not a monthly allowance. A 5-channel number that receives a sixth simultaneous call gives that caller a fast busy tone, which is indistinguishable from a broken line. Size from your busiest hour in the CDRs and leave headroom for campaigns.
Verification takes under a minute and should be done before you publish the number anywhere:
404 Not Found. The gateway delivered the call, but your PBX has no route matching the To header. Almost always the number-format mismatch from step 1. Log the raw To header and compare it character by character with what the route expects — the leading + is the usual suspect.
480 Temporarily Unavailable / 486 Busy Here. Your system reached a destination that is not accepting calls: an unregistered endpoint, an exhausted ring group, or genuinely all channels in use. If you see this under load rather than at night, you need more channels.
503 / 504 Service Unavailable. Your PBX is unreachable from our network — a firewall that dropped the new source IP, a NAT binding that expired, or a SIP ALG on the router rewriting contact headers. Disable ALG and re-test before you touch the dialplan.
One-way audio or calls that drop after about a minute. A media path problem, not a signalling one. RTP is being negotiated to a private address, or the session has no keepalive so the NAT mapping times out. Fix it by pointing your PBX at the correct external address and enabling RTP timeouts/keepalives, not by changing the inbound route.
If the failure is on our side — a number that stops delivering after being live — the failover destination takes the traffic while the route is repaired, and per-DID CDRs show exactly when the traffic stopped arriving.
Inbound trunks are exposed to the whole internet, so treat them like any other public endpoint:
0.0.0.0/0.The routing options above are configured per number in the portal, and the docs cover trunk setup in more depth:
SIP trunk documentation · Buy a DID number · FreePBX setup walkthrough · Talk to the NOC
Create an account to browse the full A-Z deck in your portal — Premium CLI and Standard clearly labelled, searchable by prefix or destination.