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
Danny Nicholas
2010-Sep-10 21:05 UTC
[asterisk-users] A way to check against a list of numbers?
-----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 Ihave 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?>HoseFor 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.
Roger Burton West
2010-Sep-10 21:08 UTC
[asterisk-users] A way to check against a list of numbers?
On Fri, Sep 10, 2010 at 03:51:01PM -0500, Hose wrote:>Does anyone have any suggestions as to >how to approach that, or if they have a entirely different way in mind?AGI script that can look directly at your master list of numbers/routes? R
Steve Edwards
2010-Sep-10 21:10 UTC
[asterisk-users] A way to check against a list of numbers?
On Fri, 10 Sep 2010, Hose wrote:> 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?Depending on the number of DNISes involved, you could abuse the Asterisk database or put it into an external (MySQL?) database. The external database approach would let you cobble up a web page so somebody other than you can maintain it :) -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
Steve Edwards
2010-Sep-10 21:12 UTC
[asterisk-users] A way to check against a list of numbers?
On Fri, 10 Sep 2010, Jose P. Espinal wrote:> b. If you can do this using C, Perl or Python; it would not (possibly) > represent a considerable performance hit to your system.Any reasonably modern processor should be able to handle XXX AGIs written in C per second. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
Jose P. Espinal
2010-Sep-10 21:14 UTC
[asterisk-users] A way to check against a list of numbers?
Hi, If you have those numbers identified (no matter what the number pattern would be, but you know which will go to DAHDI, and which to SIP) and grouped somewhere, you could insert that information into a database and use AGI in order to set the proper technology to use in each case. e.g Having a table like: +-----------------+ | numbers_list | +-----------------+ number <---- insert the number tech <---- indicate the technology, e.g. 1 = SIP, 2 = DAHDI In the moment you are about to dial the number, you can have AGI to look for it in the DB, depending on its 'tech' field you set a channel variable to the proper technology, and then just dial the number. That could be a solution. Additional suggestions: a. If you take this approach, you could add a primary key to the table, and set the 'number' as index. (This is not related to Asterisk) b. If you can do this using C, Perl or Python; it would not (possibly) represent a considerable performance hit to your system. Regards, Hose wrote:> 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 >-- Jose P. Espinal http://www.eSlackware.com IRC: Khratos @ #asterisk / -doc / -bugs
2010/9/10 Hose <hose+asterisk at bluemaggottowel.com<hose%2Basterisk at bluemaggottowel.com>>> 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,How many numbers do you plan ?> 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 > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100911/b2a0e8fe/attachment.htm
Benny Amorsen
2010-Sep-13 18:18 UTC
[asterisk-users] A way to check against a list of numbers?
Hose <hose+asterisk at bluemaggottowel.com> writes:> The most straightforward way would be to just define explicit patterns. > Obviously that works, but doesn't seem scalable in terms of maintenance.I don't think that maintaining the list in the dial plan is all that bad, actually. Dump it in its own context and file... If that isn't convenient enough I'd go for the Asterisk database next. Also on the option list is private e164/enum or an SQL database. /Benny