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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Check Contact Attributes block in the main flow. Simplest pattern for 2-10 inbound numbers.
Each inbound number routes to a dedicated sub-flow. Use for complex per-number IVR logic.
External AWS Lambda function takes DNIS and returns routing instructions. Use when DNIS-to-queue mapping is dynamic.
Combine DNIS with agent skill profiles in Amazon Connect for fine-grained routing.
- 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.