Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Dialed Number Identification Service (DNIS) entry
How-to guide

How to route calls based on DNIS in Service Cloud Voice

DNIS-based routing happens in Amazon Connect's Contact Flow editor. The DNIS attribute is available as a system value on every inbound call; conditional branches in the flow read it and route accordingly.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 20, 2026

DNIS-based routing happens in Amazon Connect's Contact Flow editor. The DNIS attribute is available as a system value on every inbound call; conditional branches in the flow read it and route accordingly.

  1. Identify your inbound numbers and their intent

    List every phone number that lands in your Amazon Connect instance: 1-800-SALES, 1-800-SUPPORT, 1-800-BILLING, and so on. Each should map to a clear routing intent before you start building the flow.

  2. Open the inbound Contact Flow

    In the Amazon Connect console (accessed from Service Cloud Voice), open the main inbound Contact Flow. This is where calls land before any IVR or queue interaction.

  3. Add a Check Contact Attributes block

    For simple cases, use Check Contact Attributes to branch on the System Dialed Number attribute. For more complex routing, use a Lambda function that takes DNIS and returns a queue name.

  4. Build the branches

    For each expected DNIS value, create a branch in the Check Contact Attributes block. Each branch routes to a different queue or sub-flow. Include a default branch for unmatched numbers.

  5. Test each number

    Call each of your inbound numbers in turn. Confirm the call routes to the correct queue. Watch the live agent dashboard or the call''s transcript to verify.

  6. Add reporting

    Build a Salesforce report on the VoiceCall object filtered by DialedNumber. This gives you per-number volume metrics and confirms DNIS is being captured correctly for analytics.

Key options
Single-flow DNIS branchingremember

Check Contact Attributes block in the main flow. Simplest pattern for 2-10 inbound numbers.

Sub-flow per DNISremember

Each inbound number routes to a dedicated sub-flow. Use for complex per-number IVR logic.

Lambda lookupremember

External AWS Lambda function takes DNIS and returns routing instructions. Use when DNIS-to-queue mapping is dynamic.

Routing profile by skillremember

Combine DNIS with agent skill profiles in Amazon Connect for fine-grained routing.

Gotchas
  • DNIS comes from the telephony provider, not from Salesforce. Misconfigured DID at the carrier level can deliver wrong DNIS values; verify with your carrier before troubleshooting Salesforce.
  • Spoofed inbound numbers are rare but possible. DNIS values are reliable enough for routing decisions but not as the sole authentication factor for sensitive flows.
  • Toll-free numbers and direct-dial numbers may surface DNIS differently. Some carriers prefix toll-free DNIS with an indicator code; account for this in your branching logic.
  • DNIS routing happens before any IVR. If you want DNIS-aware IVR menus (Welcome to support, our hours are...), the welcome prompt should be in the post-DNIS branch, not the main flow.

See the full Dialed Number Identification Service (DNIS) entry

Dialed Number Identification Service (DNIS) includes the definition, worked example, deep dive, related terms, and a quiz.