[asterisk-users] Routing incoming call based on caller id

Danny Nicholas danny at debsinc.com
Fri Nov 6 09:59:05 CST 2009


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




More information about the asterisk-users mailing list