Dial x402

Virtual Phone Numbers: How DIDs Work for Voice and SMS

How virtual phone numbers (DIDs) work — number types, provisioning, porting, programmable number management, and how they connect to the PSTN through VoIP and CPaaS providers.

Virtual Phone Numbers

A virtual phone number is a telephone number not tied to a physical SIM card, copper line, or specific device. It routes through IP-based infrastructure — VoIP switches, SIP proxies, and CPaaS platforms — to an application endpoint, softphone, or forwarding destination. Virtual numbers are fully functional PSTN numbers: they receive inbound calls and SMS from any phone, and originate outbound traffic that appears to come from a real number. The difference is entirely in termination — software rather than hardware.

The industry term is DID (Direct Inward Dialing); in Europe and parts of Asia, the equivalent is DDI (Direct Dial-In). Both describe a number that routes inbound traffic directly to a specific endpoint without passing through a switchboard or attendant.


How DIDs Map to SIP Endpoints

A DID is a routing entry in a carrier or CPaaS provider's number management system. When traffic arrives for a DID, the switching infrastructure looks up the destination endpoint.

For voice, the DID resolves to a SIP URI — a logical address on the Session Initiation Protocol network. The call is delivered over an IP trunk to the registered endpoint: a softphone, PBX server, CPaaS webhook, or AI voice agent.

For SMS, the DID resolves to an SMPP bind or HTTP webhook. The provider's SMSC accepts the inbound message over SS7/MAP from the carrier network and forwards it to the application.

Inbound Call/SMS from PSTN
   |
   v
Carrier Network (SS7 / SIP interconnect)
   |
   v
Number Routing Database (DID -> endpoint mapping)
   |
   +---> Voice: SIP INVITE to registered SIP URI
   |
   +---> SMS: HTTP webhook POST or SMPP deliver_sm
   |
   v
Application / AI Agent / PBX

This separation of identity from infrastructure is what makes virtual numbers programmable — the same DID can be rerouted between endpoints in milliseconds via API, with no carrier provisioning delay.


Number Types

Different number types carry different regulatory requirements, cost structures, and capabilities.

Local Numbers (Geographic)

Local numbers are tied to a specific area code or numbering plan area (NPA). In North America, these are standard 10-digit numbers (e.g., +1 512 555 0100) corresponding to a city or region. Local numbers carry geographic credibility — recipients are more likely to answer calls from a recognizable area code.

For US A2P SMS, local numbers must be registered through the 10DLC framework administered by The Campaign Registry (TCR). Unregistered numbers are subject to filtering and throttling.

Toll-Free Numbers

Toll-free numbers use reserved prefixes (800, 888, 877, 866, 855, 844, 833 in North America) and are billed to the number holder rather than the caller. They are managed through the SMS/800 database, which maps each number to its responsible organization (RespOrg).

For SMS, toll-free numbers require toll-free verification — the provider submits business identity and use case to the Toll-Free Message Hub before A2P messaging is permitted at full throughput.

Mobile Numbers

Some providers offer virtual mobile numbers — numbers drawn from mobile number ranges that support SMS, MMS, and in some jurisdictions RCS. These are common in markets where regulations distinguish between mobile and fixed numbering ranges (UK, Australia, parts of Europe). In the United States, the distinction between mobile and landline number ranges has blurred; many CPaaS-provisioned numbers are technically drawn from mobile pools despite having no associated SIM card.

Short Codes

Short codes are 5- or 6-digit numbers (e.g., 55555) used exclusively for SMS and MMS. They support high throughput (100+ messages per second) and are designed for mass-audience use cases like 2FA, marketing, and alerts.

Short codes require application through the CSCA (Common Short Code Administration) and individual carrier approval. Provisioning takes 8-12 weeks at $500-$1,000/month for the lease alone. Dedicated short codes serve a single brand; shared short codes use keyword routing to multiplex multiple brands.

International and Non-Geographic Numbers

International virtual numbers allow a business to present a local presence in a foreign market without physical infrastructure in that country — e.g., a US company can provision a +44 (UK) or +49 (Germany) number and route traffic to endpoints anywhere. Non-geographic numbers (such as UK 03xx numbers) are not tied to any specific area code or region.

Regulatory requirements vary by country — some jurisdictions require a local business entity or address verification before issuing numbers.


How Provisioning Works

Virtual numbers exist as allocations within national numbering plans, assigned in blocks to carriers and CLECs (Competitive Local Exchange Carriers) by authorities like NANPA (North American Numbering Plan Administration) or Ofcom (UK).

The Provisioning Chain

  1. Numbering authority allocates blocks. NANPA assigns thousands-blocks (1,000 numbers) to carriers and CLECs, each associated with a rate center that determines geographic and regulatory jurisdiction.

  2. Carrier configures routing. The carrier adds the block to its switching infrastructure and configures SS7/SIP routing for inbound delivery.

  3. CPaaS provider leases numbers. Platforms like Twilio, Telnyx, and Bandwidth either operate as CLECs themselves or lease from upstream carriers. They expose available numbers through an API searchable by area code, prefix, or keyword.

  4. Developer provisions via API. A single API call reserves a number from the pool. It becomes active within seconds — immediately routable to webhooks, SIP endpoints, or forwarding destinations.

  5. Carrier registration (if required). For US A2P SMS, the number must be associated with a registered 10DLC campaign or toll-free verification before messaging is permitted at full throughput.


Number Porting

Local Number Portability (LNP) is the regulatory mandate that allows subscribers to keep their phone number when switching providers. In the United States, LNP is required under FCC rules adopted in 1996 and administered through the NPAC (Number Portability Administration Center) database.

The Porting Process

StepActionTypical Duration
1LOA (Letter of Authorization) — Subscriber authorizes the gaining carrier to port the numberDay 1
2Port request submission — Gaining carrier submits LOA, account number, and PIN to losing carrierDay 1-2
3Validation — Losing carrier validates against account records; rejects if LOA name, account number, or PIN is incorrectDay 2-5
4FOC (Firm Order Commitment) — Losing carrier issues a confirmed port execution dateDay 5-10
5Port execution — NPAC database updated; number routes to gaining carrierDay 7-28
6Confirmation — Both carriers confirm; losing carrier releases the numberDay of execution

Wireless-to-wireless ports complete in 1-3 business days. Wireline-to-wireless or VoIP-to-VoIP ports take 1-4 weeks. LOA mismatches are the most common cause of rejection and delay.


Programmable Number Management

Modern virtual numbers support dynamic, webhook-driven behavior controlled through APIs — not static routing configured by a carrier technician.

CapabilityDescription
Inbound call routingRoute calls based on time of day, caller ID, IVR input, or custom logic
SMS webhooksForward inbound SMS to an HTTP endpoint as JSON; respond synchronously or asynchronously
Call recordingRecord calls server-side; access recordings via API
IVRVoice menus using DTMF or speech recognition to route calls without a human operator
Call forwardingForward to any phone number, SIP endpoint, or WebRTC client
Number maskingProxy calls between two parties so neither sees the other's real number
SMS forwardingForward inbound SMS to another number, email, or application
VoicemailDetect unanswered calls; deliver voicemail via webhook or email

Every interaction with a virtual number triggers application logic that can be changed without touching carrier infrastructure.


Use Cases

  • Business phone systems. Cloud PBX solutions route virtual numbers to softphones, desk phones, or mobile apps via SIP.
  • Contact centers. Agent pools with automatic call distribution and skills-based routing.
  • Two-factor authentication. OTP delivery via SMS or voice call.
  • Privacy and temporary numbers. Ride-sharing, delivery, and marketplace platforms mask participant numbers during transactions.
  • AI voice and SMS agents. Autonomous agents with virtual numbers that make calls, send texts, and interact on the PSTN.
  • International presence. Local numbers in foreign markets without physical offices.

Number Lifecycle

Every virtual phone number follows a lifecycle from provisioning to eventual recycling.

PhaseDescription
ProvisioningNumber is reserved from the provider's available pool and assigned to a customer account
ActiveNumber is in service — receiving and originating calls and SMS, bound to application logic
Porting outNumber is being transferred to another provider via the LNP process
ReleaseCustomer releases the number back to the provider's pool; number is no longer routable to the previous application
QuarantineProvider holds the number in a cooldown period (typically 30-90 days) to prevent misrouted traffic and reduce confusion from recycled numbers
RecyclingNumber re-enters the available pool and can be provisioned by a new customer

Released numbers in quarantine may still receive traffic intended for the previous holder — a common source of misdirected 2FA codes and debt collection messages on newly provisioned numbers.


Regulatory Considerations

Virtual phone numbers are subject to the same telecommunications regulations as traditional phone numbers, plus additional requirements specific to programmatic use.

  • Activation requirements. Most carriers and CPaaS providers require that provisioned numbers be used within 30 days. Numbers that remain inactive may be automatically released back to the pool.
  • KYC (Know Your Customer). Regulatory requirements for identity verification vary by country. The US requires business identity verification for A2P messaging via 10DLC. The EU requires address verification for geographic numbers. India mandates Aadhaar-linked KYC for all number issuance.
  • FCC robocall rules. The STIR/SHAKEN framework requires call authentication to combat caller ID spoofing. Virtual number calls must be signed by the originating carrier for full attestation (A-level).
  • TCPA compliance. Virtual numbers used for A2P messaging or outbound calling are subject to all Telephone Consumer Protection Act consent requirements.
  • Number hoarding. Provisioning large blocks of numbers without active use violates carrier policies and FCC rules against number exhaustion.

Cost Structure

Virtual number pricing follows a monthly lease plus per-minute/per-message usage model.

Cost ComponentTypical Range (US)
Local number lease$1.00 - $2.00/month
Toll-free number lease$2.00 - $3.00/month
Short code lease$500 - $1,000/month
Inbound voice$0.0085 - $0.02/min
Outbound voice$0.014 - $0.03/min
Outbound SMS$0.0079 - $0.02/segment + carrier surcharges
Inbound SMS$0.0075 - $0.01/segment
Number porting$0 - $5 per number

International virtual numbers carry higher lease and usage rates, particularly in regulated markets requiring local business registration.


Provider Comparison

ProviderCountry CoverageNotable Strength
Twilio100+ countriesLargest ecosystem and documentation
Telnyx60+ countriesOwn network (not an aggregator), SIP trunking
BandwidthUS, CanadaTier 1 carrier (owns network infrastructure)
Vonage80+ countriesStrong international SMS coverage
Sinch60+ countriesAcquired multiple carriers; high SMS volume
Plivo65+ countriesCompetitive pricing for voice
SignalWireUS, Canada, select intlBuilt by FreeSWITCH creators; real-time media APIs

All providers listed offer local and toll-free numbers with SMS and voice support via REST APIs. Provider selection depends on geographic coverage, volume pricing, regulatory support, and SLA requirements.


Further Reading

  • How SMS Works — The full technical path of an SMS message through the PSTN, SS7 signaling, and SMSC routing.
  • CPaaS & Aggregator Stack — The routing chain from API call to carrier delivery, including aggregator tiers and interconnect models.

On this page