[asterisk-users] block one number in incoming calls

Kevin Larsen kevin.larsen at pioneerballoon.com
Mon Jan 14 09:46:20 CST 2013


I don't think that would work as you are blocking the 0666xxxxxx number as 
the incoming extension and in his case, it would be the caller id number, 
not the extension.

I would do something like this:

exten => _520xxxxxx,1,GoSub(sub_blocked_caller,${EXTEN},1)
  same => n,Dial(SIP/224, 30)

[sub_blocked_caller]
exten => _X.,1,NoOp(Incoming Call from ${CALLERID(name)} 
(${CALLERID(num)}) to ${EXTEN})
  same => n,GotoIf(${DB_EXISTS(BLOCKED/${CALLERID(num)})}?blocked)
  same => n,Return()
  same => n(blocked),NoOp(Attempted call from a blocked number 
${CALLERID(num)})
; If we have a blocked call come in, we increment the number in the ASTDB 
so we know how many times we've blocked it
  same => 
n,Set(DB(BLOCKED/${CALLERID(num)})=$[${DB(BLOCKED/${CALLERID(num)})} + 1])
  same => n,Answer()
  same => 
n,Playback(silence/1&cannot-complete-network-error&privacy-blocked)
  same => n,Hangup()

Any numbers I wish to block are placed in my Asterisk Database. If they 
exist there, they get answered and they system logs the attempt and plays 
back an error message. Otherwise, it simply returns from the subroutine 
and continues on the call path like normal.

Kevin Larsen - Systems Analyst - Pioneer Balloon - Ph: 316-688-8208



From:   "Danny Nicholas" <danny at debsinc.com>
To:     "'Asterisk Users Mailing List - Non-Commercial Discussion'" 
<asterisk-users at lists.digium.com>, 
Date:   01/14/2013 09:39 AM
Subject:        Re: [asterisk-users] block one number in incoming calls
Sent by:        asterisk-users-bounces at lists.digium.com



I would suggest this
Exten => _0666XXXXXX,1,answer()
Exten => _0666XXXXXX,n,playback(tt-monkeys)
Exten => _0666XXXXXX,n,hangup()
 
You could just hangup on them, but playing the screeching monkeys will get 
the message to them to leave you alone.
 
From: asterisk-users-bounces at lists.digium.com [
mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Salaheddine 
Elharit
Sent: Monday, January 14, 2013 9:34 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] block one number in incoming calls
 
Hello list
 
could you please help me about one question.
 
i have asterisk 1.4  installed, i configure the inbound call in my 
asterisk  like below.
 
exten => 520xxxxxx,1,Dial(SIP/224, 30).
 
when the customer call my number (520xxxxxx) the sip phone 224 works 
without issue
 
my problem i have a lot of calls coming  from this number (0666xxxxxx) and 
i want to block it.
 
if you can give me an example please .
 
thanks and regards--
_____________________________________________________________________
-- 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/20130114/350fde77/attachment.htm>


More information about the asterisk-users mailing list