Label Routing / Routesets Calling Number

Does the label routing script allow you to use route sets for matching on calling numbers?

I want to create routes for certain NAPs where they can only call from number ranges we have whitelisted.

Yes, there is some information here:

On this line in the scripts, you can select the search method:

before_filter :method => :routesets_digit_analyzer, :trie_order => :called

If you look in the “routesets_digit_analyzer.rb” file itself (Routing Scripts → filters → routesets_digit_analyzer.rb), this is explained in the comments:
The digit analyzer supports three kind of searching method:

* :called Longest match search is done on the called number.

* :calling Longest match search is done on the calling number.

* :called_calling Longest match is done on the called number first, followed by the calling number.

* :calling_called Longest match is done on the calling number first, followed by the called number.