<font size=2 face="sans-serif">I don't think that would work as you are
blocking the 0666</font><font size=3 face="Arial">xxxxxx</font><font size=2 face="sans-serif">
number as the incoming extension and in his case, it would be the caller
id number, not the extension.</font>
<br>
<br><font size=2 face="sans-serif">I would do something like this:</font>
<br>
<br><font size=2 face="sans-serif">exten => _</font><font size=3 face="Arial">520xxxxxx</font><font size=2 face="sans-serif">,1,GoSub(sub_blocked_caller,${EXTEN},1)</font>
<br><font size=2 face="sans-serif"> same => n,</font><font size=3 face="Arial">Dial(SIP/224,
30)</font>
<br>
<br><font size=2 face="sans-serif">[sub_blocked_caller]</font>
<br><font size=2 face="sans-serif">exten => _X.,1,NoOp(Incoming Call
from ${CALLERID(name)} (${CALLERID(num)}) to ${EXTEN})</font>
<br><font size=2 face="sans-serif"> same => n,GotoIf(${DB_EXISTS(BLOCKED/${CALLERID(num)})}?blocked)</font>
<br><font size=2 face="sans-serif"> same => n,Return()</font>
<br><font size=2 face="sans-serif"> same => n(blocked),NoOp(Attempted
call from a blocked number ${CALLERID(num)})</font>
<br><font size=2 face="sans-serif">; 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</font>
<br><font size=2 face="sans-serif"> same => n,Set(DB(BLOCKED/${CALLERID(num)})=$[${DB(BLOCKED/${CALLERID(num)})}
+ 1])</font>
<br><font size=2 face="sans-serif"> same => n,Answer()</font>
<br><font size=2 face="sans-serif"> same => n,Playback(silence/1&cannot-complete-network-error&privacy-blocked)</font>
<br><font size=2 face="sans-serif"> same => n,Hangup()</font>
<br>
<br><font size=2 face="sans-serif">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.</font>
<br><font size=2 face="sans-serif"><br>
Kevin Larsen - Systems Analyst - Pioneer Balloon - Ph: 316-688-8208</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">"Danny Nicholas"
<danny@debsinc.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">"'Asterisk Users
Mailing List - Non-Commercial Discussion'" <asterisk-users@lists.digium.com>,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">01/14/2013 09:39 AM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [asterisk-users]
block one number in incoming calls</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by:
</font><font size=1 face="sans-serif">asterisk-users-bounces@lists.digium.com</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=2 color=#004080 face="Calibri">I would suggest this</font>
<br><font size=2 color=#004080 face="Calibri">Exten => _0666XXXXXX,1,answer()</font>
<br><font size=2 color=#004080 face="Calibri">Exten => _0666XXXXXX,n,playback(tt-monkeys)</font>
<br><font size=2 color=#004080 face="Calibri">Exten => _0666XXXXXX,n,hangup()</font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 color=#004080 face="Calibri">You could just hangup on
them, but playing the screeching monkeys will get the message to them to
leave you alone.</font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 face="Tahoma"><b>From:</b> asterisk-users-bounces@lists.digium.com
[</font><a href="mailto:asterisk-users-bounces@lists.digium.com"><font size=2 face="Tahoma">mailto:asterisk-users-bounces@lists.digium.com</font></a><font size=2 face="Tahoma">]
<b>On Behalf Of </b>Salaheddine Elharit<b><br>
Sent:</b> Monday, January 14, 2013 9:34 AM<b><br>
To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<b><br>
Subject:</b> [asterisk-users] block one number in incoming calls</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=3 face="Arial">Hello list</font>
<br><font size=3 face="Arial"> </font>
<br><font size=3 face="Arial">could you please help me about one question.</font>
<br><font size=3 face="Arial"> </font>
<br><font size=3 face="Arial">i have asterisk 1.4 installed, i configure
the inbound call in my asterisk like below.</font>
<br><font size=3 face="Arial"> </font>
<br><font size=3 face="Arial">exten => 520xxxxxx,1,Dial(SIP/224, 30).</font>
<br><font size=3 face="Arial"> </font>
<br><font size=3 face="Arial">when the customer call my number (520xxxxxx)
the sip phone 224 works without issue</font>
<br><font size=3 face="Arial"> </font>
<br><font size=3 face="Arial">my problem i have a lot of calls coming from
this number (0666xxxxxx) and i want to block it.</font>
<br><font size=3 face="Arial"> </font>
<br><font size=3 face="Arial">if you can give me an example please .</font>
<br><font size=3 face="Arial"> </font>
<br><font size=3 face="Arial">thanks and regards</font><tt><font size=2>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by </font></tt><a href="http://www.api-digital.com/"><tt><font size=2>http://www.api-digital.com</font></tt></a><tt><font size=2>
--<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
</font></tt><a href=http://www.asterisk.org/hello><tt><font size=2>http://www.asterisk.org/hello</font></tt></a><tt><font size=2><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
</font></tt><a href="http://lists.digium.com/mailman/listinfo/asterisk-users"><tt><font size=2>http://lists.digium.com/mailman/listinfo/asterisk-users</font></tt></a>
<br>