# Enforce Valid DNIS Length

&#x20;In this article, I am going to show you how to block calls that have valid length for the DNIS and ANI.&#x20;

Here is how a normal basic routing plan looks.  It basically just route all calls according to the vendor trunks defined in the dynamic route specified.&#x20;

![](https://2160858555-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYRPW5mw1EmjxhpuA4p%2F-MYWPCrfhziESThfOiBU%2F-MYWQGuAq1LlTXsDwWyR%2Fimage.png?alt=media\&token=730a348e-7837-4ae4-829d-cb4a52b34f70)

However, you can set it so that this rule is applied with the length of ANI and DNIS meets the valid size.&#x20;

You can do this by clicking "Edit" on this rule:

![](https://2160858555-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYRPW5mw1EmjxhpuA4p%2F-MYWPCrfhziESThfOiBU%2F-MYWQXnHgn7ucZ0bbu_G%2Fimage.png?alt=media\&token=a6b03be3-f196-4aa4-ba59-38b52061ea6a)

You can use ANI/DNIS Prefix, Min Length, and Max Length to specify traffic you don't like.  For those traffic, you can send them to a different Dynamic or Static Route that either always return 503 or route to a miss call vendors like some of our clients are doing.&#x20;
