Block Specific Number on Inbound

Home » Asterisk Users » Block Specific Number on Inbound
Asterisk Users 3 Comments

Greetings,

Is there a way to block a specific inbound number? I’ve found code online for blocking all nocallerid and all 800, etc. but nothing for a specific number. My company is wanting me to block a specific number. Is this possible in Asterisk 1.4 and 1.6 or do I need to go through my Service Provider?

Thanks,

Kevin Oravits
Phone Sys Admin

3 thoughts on - Block Specific Number on Inbound

  • Take a look at Blacklist

    I love that command and love to send nice intercept messages to the other
    side J

    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Kevin Oravits
    Sent: Thursday, December 29, 2011 8:40 PM

    Greetings,

    Is there a way to block a specific inbound number? I’ve found code online
    for blocking all nocallerid and all 800, etc. but nothing for a specific
    number. My company is wanting me to block a specific number. Is this
    possible in Asterisk 1.4 and 1.6 or do I need to go through my Service
    Provider?

    Thanks,

    Kevin Oravits

    Phone Sys Admin

  • Here’s what I do… Changed some variables for obscurity. 911 is the inbound #… exten 6000 rings to SIP/TEST

    exten => 911,1,GotoIf(${BLACKLIST()}?blacklisted)
    exten => 911,n,Macro(stdexten,6000,SIP/test)
    exten => 911,n,Playback(transfer,skip)
    exten => 911,n(blacklisted),Goto(blacklisted,s,1)

    Blacklisted context uses zapateller and plays the intercept message
    [blacklisted]
    exten => s,1,Answer
    exten => s,2,Wait(1)
    exten => s,3,Zapateller
    exten => s,4,Zapateller
    exten => s,5,Playback(ss-noservice)
    exten => s,6,Hangup