[asterisk-users] A way to check against a list of numbers?

Danny Nicholas danny at debsinc.com
Fri Sep 10 16:05:27 CDT 2010


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Hose
Subject: [asterisk-users] A way to check against a list of numbers?

>Does anyone have a suggestion on how to handle this?  For example, if I
have a list of numbers that I want to go out a certain sip channel and
another that I want to go out the dahdi device, is there a way to do
this?  None of the numbers will fit into a pattern, so just plain 
pattern matching won't do. 

>The most straightforward way would be to just define explicit patterns.
Obviously that works, but doesn't seem scalable in terms of maintenance.
Ideally there should be a variable or list of numbers, and the dialplan
logic jumps into a subroutine that checks if the dialed number is on the
list, then routes accordingly.  Does anyone have any suggestions as to
how to approach that, or if they have a entirely different way in mind?

>Hose

For a small enough group of numbers, REGEXP would probably do the trick.
For a larger group, You could use Family/Key lookup in ASTDB. For a really
large group, you would need to go the MYSQL or AGI route.
IMO the ASTDB or MYSQL/AGI Route would be best as it allows on-the-fly
changes without dialplan pain.




More information about the asterisk-users mailing list