Migrate Analog PBX to SIP: Plan, Gateways, Cutover, Rollback
The safe way to migrate analog PBX to SIP is to inventory every line and device, pick a SIP trunk, FXO gateway or FXS ATA for each, run in parallel on temporary DIDs, port on a firm date, and keep old lines 30 days for rollback.
- Size the new system by concurrent calls, not by the number of POTS lines, because a SIP trunk carries however many calls you license.
- Use a SIP trunk for voice, an FXO gateway only for lines you deliberately keep, and an FXS gateway or ATA for analog handsets, fax and alarms.
- Budget about 87 kbps per G.711 call and about 31 kbps per G.729 call in each direction, including IP overhead.
- Never cancel old lines until the port is confirmed complete, because cancelling can cancel the port and numbers that have moved are hard to move back.
- Test 911, fax, alarm and elevator lines before cutover, and set rollback triggers and a decision deadline in writing.
What should I inventory before I migrate an analog PBX to SIP?
Migrating an analog PBX to SIP fails most often on things nobody wrote down: the fax line that is really a hunt group member, the alarm dialer on line 4, the elevator phone that dials out through the PBX. Build a per-line and per-device inventory before you choose any hardware.
Collect four groups of facts. Lines: every POTS line, its number, carrier, monthly cost, and what it is plugged into. Numbers: DIDs, main numbers, hunt groups and which lines they roll over to. Devices: handsets, fax machines, alarm and fire panels, elevator phones, card readers, door phones, credit card terminals, postage meters. Features: voicemail boxes, paging, speed dials, night mode, call forwarding, call pickup, music on hold.
Also get the latest bill for each carrier, the account numbers, the billing telephone number (BTN), the service address, and a support contact. You need all of these for porting later, and the bill is how you find lines nobody remembers.
line_id, number, carrier, type, plugged_into, used_for, keep_analog?, new_target
L1, 555-0101, ILEC, POTS, PBX port 1, main inbound/outbound, no, SIP trunk
L2, 555-0102, ILEC, POTS, PBX port 2, hunt member, no, SIP trunk
L4, 555-0104, ILEC, POTS, alarm panel, alarm dialer, yes, keep POTS or ATA
L5, 555-0105, ILEC, POTS, fax machine, fax, yes, ATA + T.38
L6, 555-0106, ILEC, POTS, elevator phone, emergency, yes, keep POTS
L7, 555-0107, ILEC, POTS, card terminal, payments, maybe, IP terminal or ATASIP trunk, FXO gateway or ATA: which fits each line?
Each option does a different job. A SIP trunk replaces the phone company line with a carrier connection over the internet. An FXO gateway plugs into a real POTS line and presents it to your IP PBX as a SIP endpoint. An FXS gateway or ATA does the reverse: it plugs into an analog phone, fax or alarm and presents it to the IP PBX as an extension.
That also answers whether you can keep analog phones when moving to VoIP: yes, through FXS ports. Mind the ringing power limit, because an ATA drives only a few ringer equivalents per port.
| Option | Best for | Needs | Typical cost | Main drawback |
|---|---|---|---|---|
| SIP trunk | All normal voice, DIDs, many concurrent calls | Number port or new carrier DIDs, decent internet | Per-channel or per-minute monthly fee, usually well below POTS per line | Depends on internet and the carrier; no power-fail dial tone |
| FXO gateway (4, 8, 24 ports) | Kept POTS lines as fallback, alarm lines, temporary bridge during migration | A live POTS line per port, the gateway, and PBX config | Hardware per port plus the monthly POTS bill you keep paying | You keep paying for POTS; echo, caller ID and supervision quirks |
| FXS gateway or ATA | Analog handsets, fax, alarm panels, door phones, paging amplifiers | An extension on the IP PBX, one FXS port per device | Low per port; 1 to 2 port ATAs, 8 to 48 port gateways | Fax and modem tones are fragile over VoIP; limited ring power |
Which of the three migration paths should I choose?
Path 1, replace the PBX entirely. Install an IP PBX such as Asterisk or FreePBX, buy a SIP trunk, port the numbers, and retire the old system. It gives the cleanest result and the lowest running cost, and it is the right answer when the old PBX is failing or unsupported.
Path 2, keep the old PBX and put a SIP trunk or gateway behind it. A SIP gateway with FXS ports presents the carrier to the old PBX as line cards. It buys time when the PBX still works and handsets are expensive, but you keep the old feature limits and a platform that nobody can repair.
Path 3, hybrid. Build the new IP PBX, move voice to SIP trunks, and keep two to four POTS lines on an FXO gateway for fallback and for devices that must stay on a real line, such as fire panels and elevator phones. For most offices this is the sensible default, because it limits risk without keeping the full POTS bill.
How many concurrent calls and how much bandwidth do I need?
Count concurrent calls, not lines. POTS forced one line per call, so an office with 12 lines often never has more than 5 or 6 calls at once. Check the old PBX's call logs or ask the carrier for peak usage, and add headroom of 20 to 30 percent.
Bandwidth per call with IP, UDP and RTP overhead at 20 ms packetization is about 87 kbps for G.711 and about 31 kbps for G.729, in each direction. Size upload, which is usually the smaller side, against the busiest hour.
Worked example: 8 peak concurrent calls plus 25 percent headroom is 10 calls. At G.711 that is 10 x 87 = 870 kbps up and down. At G.729 it is 310 kbps. A symmetric business connection handles this easily, but a cable line with 5 Mbps upload shared with backups and video may not.
- Put phones and the PBX on a voice VLAN, commonly VLAN 100 or similar, separate from data.
- Mark SIP signaling CS3 (DSCP 24) and RTP EF (DSCP 46), and make the router prioritize EF on the WAN uplink.
- Add up PoE budget: a typical desk phone draws 3 to 7 W, so 40 phones need roughly 280 W plus margin on the switch's PoE budget, not just port count.
- Run a network assessment for jitter, loss and latency over several days, targeting under 30 ms jitter, under 1 percent loss and under 150 ms one-way latency.
- Put the router, switches and PBX on a UPS, because phones that lose PoE lose service even when the internet is up.
How do I connect analog lines to Asterisk or FreePBX, and what goes wrong?
The usual method is an external FXO gateway registered or peered with Asterisk over PJSIP. The alternative is an FXO card in the server, which ties you to hardware and DAHDI. Gateways keep the server virtualizable.
A minimal PJSIP endpoint for a gateway, with identification by IP, looks like this. In FreePBX, create it as a custom PJSIP trunk or use the gateway's own registration.
| Gotcha | Symptom | Fix |
|---|---|---|
| Caller ID | Number missing or garbled | FSK caller ID arrives between ring 1 and 2 in the US; set the FXO to answer after the second ring and match the country caller ID standard |
| No polarity reversal or disconnect supervision | Calls hang after the far end hangs up, lines stay busy | Enable polarity reversal if the carrier provides it, otherwise use battery drop or busy tone detection, and enable a call timeout |
| Echo on FXO | Callers hear themselves, worse on long delay | Set the correct country and impedance (600 ohm in the US), enable the gateway's echo canceller, and tune FXO input and output gain |
| Wrong country settings | No dial tone detect, failed ring detect | Set ring cadence, tone set and impedance for the country; US ring is 2 s on and 4 s off |
| Fax | Failed or slow transmissions | Use T.38 if both ends support it, otherwise G.711 passthrough with echo cancellation and VAD disabled on the ATA |
| Port count | Too few ports for fallback | Gateways come in 1, 2, 4, 8, 16 and 24 FXO ports; count kept lines, not users |
; pjsip.conf
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
local_net=192.168.10.0/24
external_signaling_address=203.0.113.10
external_media_address=203.0.113.10
[fxo-gw]
type=endpoint
transport=transport-udp
context=from-fxo
disallow=all
allow=ulaw
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
dtmf_mode=rfc4733
aors=fxo-gw
[fxo-gw]
type=aor
contact=sip:192.168.10.50:5060
[fxo-gw]
type=identify
endpoint=fxo-gw
match=192.168.10.50
; CLI checks
; pjsip show endpoints
; pjsip set logger on
; rtp set debug on
; sngrep (shell: watch INVITE, 100, 180, 200, ACK, BYE)
; Firewall: UDP 5060 (SIP), UDP 10000-20000 (Asterisk default RTP)How do I design extensions and call flows, then port numbers and run in parallel?
Draw the call flow before building anything. For each inbound number write: who answers, in what order, what happens after hours, and where it ends (voicemail, IVR, fax). Then map every old feature to its new equivalent: hunt group to a ring group or queue, night switch to a time condition, speed dials to BLF keys or contacts, paging to a paging group or SIP multicast, call forwarding to follow-me or feature codes.
Pick an extension plan that survives growth, for example 1xx for sales, 2xx for support, 3xx for admin, 8xx for devices such as fax and door phones. Keep existing extension numbers where staff remember them. Dial 911 directly with no outside prefix, which Kari's Law requires in the US for multi-line systems.
Emergency calling needs its own step. Register a dispatchable address for each location, and for large sites by floor or zone, with your carrier (E911, RAY BAUM'S Act in the US), and configure on-site notification when 911 is dialed. Test every location, and test alarm and elevator lines before cutover.
- Order temporary DIDs from the new carrier and build the full call flow on them while the analog lines stay live.
- Submit the port request: signed LOA, copy of a recent bill, BTN, account number, and the service address exactly as the old carrier has it. Typical lead time is 1 to 4 weeks, so ask for a firm due date and time in writing.
- Run a pilot group on the new system, then move departments in waves, forwarding a few numbers from the old carrier to the temporary DIDs.
- Run the test call checklist: inbound, outbound, 911 with the right address, fax send and receive, voicemail, transfer, paging, after-hours routing.
- Keep every old line active and billed until the port is confirmed complete.
What is the cutover runbook and rollback plan?
Schedule the port for a low-traffic window agreed with both carriers, with a change freeze for the days before. Have staff on site, the old PBX and lines powered, and a printed checklist with named owners.
Rollback needs forethought because ported numbers are hard to reverse: moving them back is a second port. So before porting, set up call forwarding from the old numbers to the temporary DIDs, and arrange failover routing on the new carrier, for instance to mobiles or to the FXO gateway's kept lines. Decide triggers in advance, such as inbound failing for more than 30 minutes, 911 test failing, or fax and alarm failing, plus a decision deadline, for example 2 hours after the port time.
| Time | Action |
|---|---|
| T-7 days | Confirm due date with both carriers, freeze changes, complete user training, verify UPS |
| T-1 day | Full backup of the PBX config, final test calls on temporary DIDs, enable carrier forwarding plan |
| T-0 (port time) | Port executes; watch for registration and inbound traffic in the Asterisk CLI |
| T+15 min | Test inbound on every DID, outbound, 911 test as arranged, voicemail, fax, alarm line |
| T+2 h | Go or rollback decision by the named owner |
| T+30 days | Only now cancel the old POTS lines and retire the old PBX |
Common questions
How long does it take to move from an analog phone system to VoIP?
Plan 4 to 8 weeks for a small office. The number port alone takes 1 to 4 weeks, and the design, network assessment and pilot run alongside it. Hardware and staff training fit inside that window.
Will my alarm panel or fire panel work over SIP?
Often not reliably. Alarm dialers send DTMF or modem tones that compression and jitter can corrupt, so keep a real POTS line or use a cellular communicator. If you must use an ATA, use G.711 and disable echo cancellation and VAD for that port, then test with the alarm company.
Can I use my old analog phones with a new IP PBX?
Yes, through an FXS gateway or ATA that registers each phone as an extension. Check that the ring power is enough for the phones on each port and that you do not need features such as message waiting lights that older handsets may not support.
Do I need to keep any POTS lines after migrating to SIP?
Keep one to a few if you have fire, alarm or elevator devices that require a traditional line, or if you want a fallback path during an internet outage. An FXO gateway connects them to the IP PBX, but each one keeps its monthly line charge.
What happens to my phone numbers when I switch carriers?
You can usually keep them through a port request, where the new carrier takes over the numbers on a set date. Until then, the old carrier routes calls as before, which is why you keep the old service active until the port is complete.