[asterisk-users] Checking blank CallerID in Dialplan

Danny Nicholas danny at debsinc.com
Thu May 20 13:40:12 CDT 2010


This is a drawn-out, but efficient way to "fix" this problem.  Create two
programs.  Program 1 reads Master.csv (or whatever you use to store your CDR
in). Reads through CDR and creates a "blacklist" of numbers and ID's.  write
blacklist to a text file or database.  Program 2 runs from dialplan as AGI.
Returns "Blacklist" or "OK" to dialplan as local variable.  I'm a "Perl
Weenie", so I would do this with text files, but C code and a database would
be more efficient (actually, unless the list got quite cumbersome, C code
and text file would be most efficient).
Dialplan

Exten => s,1,answer
Exten => s,n,AGI(check_bl.agi,${CALLERID(num)},${CALLERID(name)})
Exten => s,n,Gotoif($[${BLACKVAL} = "OK"]?6]
Exten => s,n,playback(nice-goodbye)
Exten => s,n,hangup
Exten => s,n,noop(caller is "ok", continue)

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Myles Wakeham
Sent: Thursday, May 20, 2010 11:43 AM
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] Checking blank CallerID in Dialplan

I am trying to implement a change to our Dialplan that will thwart 
tele-spammers that are calling us with blanked out caller ID.

The caller IDs seem to vary between originating callers when they block 
caller ID.  I've seen the following:

"anonymous"
""

So I'm checking for these.  However recently one company seems to be 
bypassing this, so what I wanted to do was implement some logic that 
checks for actual numbers in the caller ID.

We have a couple of different SIP providers for incoming calls.  Some 
prefix numbers with a +  and others don't.  But I'm logging incoming 
calls that are getting through our tele-spam filter and it seems that 
they are blank, but I suspect they contain empty spaces which is why our 
matches don't work.

Does anyone have some sample DialPlan code that they are using to thwart 
incoming calls with no caller ID?  I was thinking of maybe converting 
the caller ID num to a numeric value and testing for 'not equal to 0' 
but that won't work with the + prefix.

All suggestions greatly appreciated.

Myles
-- 
-----------------------------
Myles Wakeham
Director of Engineering
Tech Solutions USA, Inc.
www.techsolusa.com
Phone +1-480-451-7440


-- 
_____________________________________________________________________
-- 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




More information about the asterisk-users mailing list