Skip to content

Instantly share code, notes, and snippets.

@warewolf
Created May 11, 2015 14:51
Show Gist options
  • Save warewolf/58dc06bbe0548f75c8a2 to your computer and use it in GitHub Desktop.
Save warewolf/58dc06bbe0548f75c8a2 to your computer and use it in GitHub Desktop.
How I block incoming calls in Asterisk

My incoming calls land in the context from-trunk

Config to block calls

/etc/asterisk/extensions.conf

[from-trunk]
...
 same =>    n,GotoIf($[${DB(blockcaller/${CALLERID(num)})} = 1 ]?blocked)
 same =>    n(blocked),Hangup
...

Adding a number to be blocked

pbx*CLI> database put blockcaller +18669103178 1

Removing a number from being blocked

pbx*CLI> database del blockcaller +17038675309

Listing current blocks

pbx*CLI> databse show blockcaller
@lowiedaniels
Copy link

Hi warewolf,

Can you tell me where exactly you place this in your dialplan ?

@nickkostov
Copy link

Hey there is there away into blocking outgoing not incoming phone calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment