Chapter 5: The VoIP Gateway — CUBE, CUCM, and SIP Trunk Migration from Legacy NIMs

Learning Objectives

5.1 The Voice Gateway Concept

A voice gateway is a network device (typically a Cisco ISR router) that bridges the circuit-switched PSTN and the packet-switched IP world. It sits at the boundary between two fundamentally different communication technologies, translating signaling, media, and features so that traditional phones and IP-based endpoints can communicate seamlessly.

Three Essential Functions

NIM Cards: Physical PSTN Interfaces

On a Cisco ISR 4000-series router, NIM (Network Interface Module) cards provide the physical connection to the PSTN. These are the hardware that plug into the telephone company's copper or fiber infrastructure:

NIM CardPSTN InterfaceTypical Use Case
NIM-2FXS2 analog phone ports (FXS)Connecting analog phones or fax machines directly
NIM-4FXO4 analog trunk ports (FXO)Connecting to analog PSTN lines from the carrier
NIM-2BRI-NT/TE2 ISDN BRI portsConnecting to ISDN Basic Rate lines (2B+D)
NIM-1MFT-T1/E11 T1/E1 PRI portConnecting to ISDN PRI trunks (23B+D or 30B+D)

Voice DSP Resources

Digital Signal Processors (DSPs) are specialized chips built directly onto ISR 4000-series NIM cards (no separate PVDM required). They handle:

Gateway vs. Gatekeeper vs. SBC

RoleFunctionAnalogy
Voice GatewayConverts between PSTN and IP signaling/mediaA translator at a border crossing
GatekeeperCentralized call admission control and address resolution for H.323An air traffic controller
SBCControls SIP signaling/media at network boundaries between domainsA customs officer who inspects and authorizes crossings

A single Cisco ISR can serve as both a voice gateway and an SBC (via CUBE). Gatekeepers are largely legacy, as SIP has replaced most H.323 deployments.

PSTN / Carrier Cisco ISR 4000 Router IP Network PRI Trunk (T1/E1) BRI Line (2B+D) Analog POTS (FXO/FXS) NIM Cards NIM-1MFT-T1/E1 NIM-2BRI-NT/TE NIM-4FXO NIM-2FXS DSPs Transcoding Echo Cancel IOS-XE Signaling Conv. Call Routing Ethernet IP-Facing LAN / WAN IP Network IP Phones Softphones PKT Voice gateway converts PSTN signaling/media to IP packets as they traverse from left to right

Key Points — Section 5.1

Pre-Study Quiz — Partition A (Sections 5.1 & 5.2)

1. What is the primary function of a voice gateway in a Cisco voice architecture?

To provide centralized call admission control for H.323 networks
To bridge circuit-switched PSTN and packet-switched IP networks by converting signaling and media
To manage IP phone registration and feature services
To distribute SIP sessions across multiple servers for load balancing

2. On the ISR 4000 series, where are voice DSP resources located?

On separate PVDM modules installed in dedicated motherboard slots
In the ISR's main CPU, shared with routing functions
Built directly onto the NIM voice cards themselves
On an external DSP farm server connected via Ethernet

3. What does it mean that CUBE operates as a SIP back-to-back user agent (B2BUA)?

CUBE passes SIP messages transparently between endpoints without modification
CUBE terminates the incoming SIP session and originates a completely new session on the other side
CUBE only handles the signaling plane; media always flows directly between endpoints
CUBE requires two separate physical routers — one for each SIP leg

4. Which IOS-XE command activates CUBE functionality on a router?

voice service voip / mode cube-enterprise
sip-ua / enable-cube
voice service voip / mode border-element
interface sip0/0 / cube enable

5. What security benefit does CUBE provide by operating as an SBC?

It encrypts all voice traffic using IPsec by default
It hides internal network topology so external parties only see CUBE's IP address
It eliminates the need for firewalls in the voice path
It automatically blocks all international calls

5.2 CUBE — Cisco Unified Border Element

CUBE (Cisco Unified Border Element) acts as a Session Border Controller on the ISR, sitting at the edge of the enterprise voice network. It controls every SIP session crossing the boundary to an external network — whether a SIP trunk to a service provider, a cloud UC platform, or a partner's phone system.

CUBE as SIP B2BUA

CUBE does not simply proxy SIP messages. As a B2BUA, it terminates the incoming SIP session on one side and originates a completely new session on the other. This gives CUBE full control over signaling and media:

SIP Trunk Configuration

A SIP trunk is the IP equivalent of a PRI trunk. Where PRI carries 23 (T1) or 30 (E1) channels over a physical circuit, SIP carries sessions over IP — limited by bandwidth and licensing, not physical channel counts.

Key configuration steps:

  1. Enable CUBE mode: voice service voip / mode border-element / allow-connections sip to sip
  2. Configure inbound dial-peer (from CUCM toward CUBE) with session protocol sipv2 and incoming called-number .
  3. Configure outbound dial-peer (from CUBE toward provider) with destination-pattern and provider's session target IP.

Protocol Interworking

Interworking PairUse Case
SIP to SIPMost common: enterprise SIP to provider SIP with header normalization
SIP to H.323Connecting SIP trunk to legacy H.323 video/voice system
ISDN to SIPConverting PRI/BRI signaling (via NIM card) to SIP for IP network
Analog to SIPConverting FXO/FXS signaling (via NIM card) to SIP

High Availability and Capacity

CUBE supports an active/standby HA model using a virtual IP address on two ISR routers. Capacity planning considers: concurrent calls at peak hour, bandwidth per call (G.711 ~87 kbps, G.729 ~31 kbps), DSP resources for transcoding, and CPU headroom. Large deployments scale to 64,000 sessions using CUSP for load distribution.

CUCM Internal Phone CUBE (B2BUA) Inbound Leg Terminates SIP Outbound Leg Originates SIP SIP Provider External Network 1 SIP INVITE 2 Routing Decision 3 NEW SIP INVITE 4 200 OK 5 200 OK (mapped) 6 Media Established RTP (internal IP) RTP (CUBE IP) Topology hidden - provider sees only CUBE IP

Key Points — Section 5.2

5.3 CUCM — Cisco Unified Communications Manager

CUCM (Cisco Unified Communications Manager) is the centralized call control platform — the brain that decides where every call goes, which phones ring, and what features are available. It runs on dedicated servers or VMs and provides call routing, phone registration, feature services, and user management.

Gateway Registration Protocols

NIM-equipped ISR gateways must register with CUCM so that CUCM can route calls through them. The registration protocol determines how much control CUCM has:

ProtocolCUCM Control LevelTypical Use
MGCPHighest — CUCM controls dial-peer behavior entirelyPrimary/recommended for CUCM-managed gateways
SIPModerate — shared control between gateway and CUCMModern deployments, CUBE integration
SCCPHigh — CUCM controls analog portsLegacy analog phone/fax integration
H.323Lower — gateway has local routing logicLegacy, being phased out

Version requirements: CUCM 10.5+ for ISR 44xx; CUCM 10.5.2+ for ISR 43xx. The ISR must run IOS-XE 3.16+ with the UC license package.

Route Patterns, Route Lists, and Route Groups

CUCM uses a layered call routing hierarchy:

  1. Route Pattern matches dialed digits (e.g., 9.1[2-9]XX[2-9]XXXXXX strips the leading 9 access code).
  2. Route List contains one or more route groups, providing failover capability.
  3. Route Group contains the actual gateways or SIP trunks as members.

This layered structure enables redundancy: if the PRI gateway is unavailable, CUCM automatically fails over to the SIP trunk — a critical capability during migration.

Integration with Webex Calling

In hybrid architectures, CUCM manages on-premises phones and gateways while CUBE provides the SIP trunk to Webex cloud. NIM-equipped gateways provide local PSTN survivability — if the WAN link to the cloud fails, the local gateway still routes calls through its PRI or analog lines. This hybrid model is often a stepping stone for phased cloud migration.

graph TD DIGITS["Dialed Digits
(9-1-555-0199)"] --> RP["Route Pattern
9.1[2-9]XX[2-9]XXXXXX"] RP --> RL["Route List
RL-PSTN-Primary"] RL --> RG1["Route Group 1
RG-PRI-Gateway
(Primary Path)"] RL --> RG2["Route Group 2
RG-SIP-Trunk
(Failover Path)"] RG1 --> GW["ISR Voice Gateway
(NIM-1MFT-T1/E1)"] RG2 --> CUBE["CUBE SBC
(SIP Trunk to Provider)"] GW --> PSTN["PSTN
(PRI Circuit)"] CUBE --> SIP_PROV["SIP Trunk Provider
(IP Network)"] style RG1 fill:#1a5c1a,stroke:#2ea02e,color:#fff style RG2 fill:#1a3a5c,stroke:#58a6ff,color:#fff style RL fill:#3a2a1a,stroke:#d29922,color:#fff

Key Points — Section 5.3

Post-Study Quiz — Partition A (Sections 5.1 & 5.2)

1. What is the primary function of a voice gateway in a Cisco voice architecture?

To provide centralized call admission control for H.323 networks
To bridge circuit-switched PSTN and packet-switched IP networks by converting signaling and media
To manage IP phone registration and feature services
To distribute SIP sessions across multiple servers for load balancing

2. On the ISR 4000 series, where are voice DSP resources located?

On separate PVDM modules installed in dedicated motherboard slots
In the ISR's main CPU, shared with routing functions
Built directly onto the NIM voice cards themselves
On an external DSP farm server connected via Ethernet

3. What does it mean that CUBE operates as a SIP back-to-back user agent (B2BUA)?

CUBE passes SIP messages transparently between endpoints without modification
CUBE terminates the incoming SIP session and originates a completely new session on the other side
CUBE only handles the signaling plane; media always flows directly between endpoints
CUBE requires two separate physical routers — one for each SIP leg

4. Which IOS-XE command activates CUBE functionality on a router?

voice service voip / mode cube-enterprise
sip-ua / enable-cube
voice service voip / mode border-element
interface sip0/0 / cube enable

5. What security benefit does CUBE provide by operating as an SBC?

It encrypts all voice traffic using IPsec by default
It hides internal network topology so external parties only see CUBE's IP address
It eliminates the need for firewalls in the voice path
It automatically blocks all international calls

5.4 Migration: From Legacy NIMs to SIP Trunks

Legacy PRI, BRI, and analog PSTN interfaces are deep into their sunset phase. Three forces drive migration to SIP trunks:

The Five-Phase Migration Approach

PhaseNameKey ActivitiesDuration
1Assess & InventoryCatalog NIM cards, PRI/BRI/analog lines, channel utilization, special circuits (fax, alarm, elevator)2-4 weeks
2Prepare GatewayConvert gateway protocol to SIP; update IOS-XE and CUCM; deploy CUBE2-4 weeks
3Set Up SIP TrunksConfigure CUBE; establish SIP trunk with provider; configure dial-peers, codecs, security1-2 weeks
4Parallel RunRun legacy PRI/BRI and SIP trunks simultaneously; validate quality and reliability4-8 weeks
5Cutover & DecommissionPort remaining numbers; cut over all traffic to SIP; decommission legacy NIM cards2-4 weeks

Total timeline: approximately 3-5 months for a typical mid-sized deployment.

PRI vs. SIP Trunk Comparison

FeaturePRI (via NIM Card)SIP Trunk (via CUBE)
CapacityFixed: 23 (T1) or 30 (E1) channelsFlexible: add sessions as needed
Physical connectionDedicated copper/fiber circuitShared IP network (Internet or MPLS)
Location dependencyTied to building where circuit terminatesLocation-independent
Cost modelFixed monthly for all channelsPer-channel or usage-based pricing
Codec flexibilityG.711 only (TDM native)Any codec both endpoints support
Time to provisionWeeks to monthsHours to days

Decommissioning Legacy Cards

  1. Verify zero traffic — Use show voice call summary and show isdn status to confirm no active calls.
  2. Update dial plans — Remove/redirect CUCM route patterns, route groups, and route lists referencing the legacy gateway.
  3. Cancel carrier circuits — Ensure number porting is complete before cancellation (allow 2-4 weeks).
  4. Document the change — Update network diagrams, inventory systems, and DR plans.
  5. Physically remove cards — NIM cards support OIR (Online Insertion and Removal) but best practice is during a maintenance window.
  6. Reclaim resources — DSP resources on removed NIM are freed; consider redeploying the ISR if no longer needed for voice.
Five-Phase Migration: Legacy NIMs to SIP Trunks 1 Assess & Inventory Catalog NIMs, lines, utilization, special circuits 2-4 weeks 2 Prepare Gateway Convert to SIP, update IOS-XE, deploy CUBE 2-4 weeks 3 Set Up SIP Trunks Configure CUBE, establish provider trunk, dial-peers 1-2 weeks 4 Parallel Run PRI + SIP side by side, validate quality & failover 4-8 weeks 5 Cutover & Decommission Port numbers, cut traffic, remove legacy NIM cards 2-4 weeks Total Timeline: 3-5 Months Phase 4 (Parallel Run) is the Most Critical Phase Both legacy PRI and new SIP trunks run simultaneously Specific number ranges are routed through each path for validation Legacy PRI remains as failover until SIP quality is confirmed Typically lasts 4-8 weeks before final cutover proceeds

Key Points — Section 5.4

Pre-Study Quiz — Partition B (Sections 5.3 & 5.4)

1. Which gateway registration protocol gives CUCM the highest level of control over gateway behavior?

SIP
H.323
MGCP
SCCP

2. In CUCM's call routing hierarchy, what is the correct order from dialed digits to the physical gateway?

Route Group → Route List → Route Pattern → Gateway
Route Pattern → Route List → Route Group → Gateway
Route Pattern → Route Group → Route List → Gateway
Route List → Route Pattern → Route Group → Gateway

3. During a NIM-to-SIP migration, what is the primary purpose of the parallel run phase?

To allow the carrier time to disconnect PRI circuits
To validate SIP trunk quality and reliability while maintaining legacy fallback
To train end users on the new phone system
To configure CUCM route patterns for the first time

4. Which of the following is a key advantage of SIP trunks over PRI trunks?

SIP trunks use dedicated copper circuits for higher reliability
SIP trunks are limited to G.711 codec for guaranteed quality
SIP trunks offer flexible, location-independent capacity that can be provisioned in hours
SIP trunks require no SBC or border element for security

5. Before physically removing a legacy NIM card, what must you verify first?

That the card's firmware has been updated to the latest version
That zero calls are routing through the legacy NIM and all numbers have been ported
That CUCM has been upgraded to the latest major release
That the ISR router has been rebooted within the past 24 hours
Post-Study Quiz — Partition B (Sections 5.3 & 5.4)

1. Which gateway registration protocol gives CUCM the highest level of control over gateway behavior?

SIP
H.323
MGCP
SCCP

2. In CUCM's call routing hierarchy, what is the correct order from dialed digits to the physical gateway?

Route Group → Route List → Route Pattern → Gateway
Route Pattern → Route List → Route Group → Gateway
Route Pattern → Route Group → Route List → Gateway
Route List → Route Pattern → Route Group → Gateway

3. During a NIM-to-SIP migration, what is the primary purpose of the parallel run phase?

To allow the carrier time to disconnect PRI circuits
To validate SIP trunk quality and reliability while maintaining legacy fallback
To train end users on the new phone system
To configure CUCM route patterns for the first time

4. Which of the following is a key advantage of SIP trunks over PRI trunks?

SIP trunks use dedicated copper circuits for higher reliability
SIP trunks are limited to G.711 codec for guaranteed quality
SIP trunks offer flexible, location-independent capacity that can be provisioned in hours
SIP trunks require no SBC or border element for security

5. Before physically removing a legacy NIM card, what must you verify first?

That the card's firmware has been updated to the latest version
That zero calls are routing through the legacy NIM and all numbers have been ported
That CUCM has been upgraded to the latest major release
That the ISR router has been rebooted within the past 24 hours

Your Progress

Answer Explanations