DID (Direct Inward Dialing) Setup

Configure inbound phone numbers and route calls to in-groups, IVR, voicemail, or extensions

What are DIDs?

DID (Direct Inward Dialing) numbers are phone numbers that route incoming calls from the public telephone network (PSTN) to your Vicidial server. Your SIP carrier provides these numbers and forwards calls to your server via SIP trunks.

Each DID can be independently routed to different destinations: an inbound group (queue) for agent distribution, an IVR menu for self-service, a specific phone, voicemail, or an Asterisk dialplan extension.

DID Routing Flow

PSTN CallerInbound CallSIP CarrierRoutes to ServerDID MatchingVicidial DID TableIn-Group (Queue)IVR / Call MenuVoicemail / PhoneAgents

Adding a DID Number

Admin → Inbound → DIDs → Add a New DID
  1. DID Extension — The phone number exactly as received by Asterisk (e.g., 12125551234 with country code).
  2. DID Description — Descriptive label (e.g., "Main Office Line", "Sales DID").
  3. DID Route — Select the destination type (IN_GROUP, PHONE, VOICEMAIL, EXTENSION, IVR, AGENT, or CALLMENU).
  4. Route Value — The specific destination (e.g., the in-group ID, phone extension, or IVR name).
  5. Active — Set to Y to activate the DID routing.
  6. CID Group — Optionally assign a CID group for filtering or dynamic routing based on caller ID.

DID Routing Destinations

IN_GROUP

Route to an Inbound Group (queue) for ACD distribution to agents

PHONE

Route directly to a specific phone/extension (no queue)

VOICEMAIL

Route to a voicemail box

EXTENSION

Route to an Asterisk extension in the dialplan

IVR

Route to a Call Menu (IVR) for interactive voice response

AGENT

Route directly to a specific agent by user ID

CALLMENU

Route to a specific Vicidial Call Menu

Time-Based Routing & DID Filters

Vicidial supports routing DIDs differently based on time of day, day of week, and caller ID:

  • Call Time Routes — Define business hours vs. after-hours routing. During business hours, route to an in-group; after hours, route to voicemail or IVR.
  • DID Filter — Route differently based on the Caller ID of the incoming call. Match specific numbers or number patterns.
  • CID Group Filtering — Create groups of CID patterns for VIP routing, blocklisting, or priority queue placement.
  • Holiday Routing — Set alternate routing for specific dates (holidays, maintenance windows).

Provider DID Forwarding to Vicidial

Your SIP provider must be configured to send incoming calls for your DIDs to your Vicidial server:

  1. In your provider's portal, set the DID destination to your Vicidial server's public IP address.
  2. Ensure the carrier entry in Vicidial has the correct context=trunkinbound setting.
  3. The DID number in Vicidial must match exactly how the provider sends it (with or without country code).
  4. Test with asterisk -rx 'sip set debug on' and make a test inbound call to verify the DID number format received.

Asterisk Dialplan for DIDs

Vicidial automatically manages DID routing through its database, but in some cases you may need to modify the Asterisk dialplan directly:

; /etc/asterisk/extensions.conf
; Default trunkinbound context for carrier inbound
[trunkinbound]
exten => _X.,1,AGI(agi://127.0.0.1:4577/--aession--)
exten => _X.,2,Hangup()
 
; Vicidial's AGI handles DID lookup and routing
; It matches the dialed number against the DID table
; and routes to the configured destination automatically.
Note:In most setups, you do NOT need to edit extensions.conf for DID routing. Vicidial's AGI script handles all DID matching from the database. Only modify the dialplan for advanced custom routing scenarios.

Testing Inbound Calls

  1. Enable SIP debug: asterisk -rx 'sip set debug on'
  2. Call your DID number from an external phone.
  3. Check the Asterisk console for the incoming INVITE — note the DID number format.
  4. Verify the DID entry matches the received number in Admin → Inbound → DIDs.
  5. Confirm the call is routed to the correct destination (in-group, IVR, etc.).
  6. Check the real-time report to verify the inbound call appears in the queue or agent screen.
Back to Vicidial Guide Inbound Groups Carrier Setup