Lyle Giese
2009-Nov-06 15:48 UTC
[asterisk-users] Routing incoming call based on caller id
I am not that good at regex and it's use in Asterisk. I am running Asterisk 1.4.13 Currently I have this in my extensions.conf for incoming calls on our house phone line: [housemenu] exten => s,1,GotoIF($["${CALLERID(num)}" = "815xxxxxxx"]?s|12); 815xxxxxxx is our home phone number, when caller id fails or is missing that is what is recorded. I want to expand this from just branching on our home phone number to include any toll free number, (800, 866, 877, etc) as a telemarketer screening system. But I am not sure of the syntax here, but don't want to add another line for each 8xx toll free npa either. Looking for suggestion on syntax here and not even sure how to pattern match on only the area code(first three digits) here. Thanks for any suggestions! Lyle Giese LCR Computer Services, Inc.
Danny Nicholas
2009-Nov-06 15:59 UTC
[asterisk-users] Routing incoming call based on caller id
This might be the worst suggestion you'll get, but it WILL work; - exten => s,1,AGI(testval.agi,${CALLERID(num)}) - exten => s,2,Gotoif(${marketer}) The AGI should read a variable from STDIN, evaluate the first 3 digits and return variable marketer as TRUE or FALSE. You can do this in about 30 lines of PERL/PHP. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Lyle Giese Sent: Friday, November 06, 2009 9:48 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Routing incoming call based on caller id I am not that good at regex and it's use in Asterisk. I am running Asterisk 1.4.13 Currently I have this in my extensions.conf for incoming calls on our house phone line: [housemenu] exten => s,1,GotoIF($["${CALLERID(num)}" = "815xxxxxxx"]?s|12); 815xxxxxxx is our home phone number, when caller id fails or is missing that is what is recorded. I want to expand this from just branching on our home phone number to include any toll free number, (800, 866, 877, etc) as a telemarketer screening system. But I am not sure of the syntax here, but don't want to add another line for each 8xx toll free npa either. Looking for suggestion on syntax here and not even sure how to pattern match on only the area code(first three digits) here. Thanks for any suggestions! Lyle Giese LCR Computer Services, Inc. _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Lyle Giese wrote:> [housemenu] > exten => s,1,GotoIF($["${CALLERID(num)}" = "815xxxxxxx"]?s|12); > 815xxxxxxx is our home phone number, when caller id fails or is missing > that is what is recorded. > > I want to expand this from just branching on our home phone number to > include any toll free number, (800, 866, 877, etc) as a telemarketer > screening system. But I am not sure of the syntax here, but don't want > to add another line for each 8xx toll free npa either.how about something like this: [housemenu] exten => s/_815XXXXXXX,1,Goto(s|12) exten => s/_800XXXXXXX,1,Goto(tollfree|s|1) exten => s/_866XXXXXXX,1,Goto(tollfree|s|1) exten => s,1,<other callerid do something else...> -- Edwin Lam <edwin.lam at officegeneral.com> Systems Engineer, Office General, Inc. Ph: +1 415 439 4988 Fax: +1 415 283 3370 http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0xD6506D20