Difference between revisions of "Blacklist or whitelist"

From "PTTLink Wiki"
Jump to navigation Jump to search
Line 5: Line 5:
 
* database show blacklist
 
* database show blacklist
  
 
+
==Blacklist Configuration==
 
Add this to extensions.conf just below the [radio-secure] context.
 
Add this to extensions.conf just below the [radio-secure] context.
 
<pre>
 
<pre>
Line 15: Line 15:
 
; to remove:
 
; to remove:
 
; database del blacklist 1998
 
; database del blacklist 1998
 +
; to list
 +
; database show blacklist
 
   
 
   
 
[blacklist]
 
[blacklist]

Revision as of 14:48, 15 October 2017

Occasionally it becomes necessary to block a poorly operating node. This method makes it very easy to manage the blacklist with three simple Asterisk CLI commands:

  • database put blacklist 1998 "any comment"
  • database del blacklist 1998
  • database show blacklist

Blacklist Configuration

Add this to extensions.conf just below the [radio-secure] context.

[radio-secure]
...

; To add a node to the blacklist: 
; database put blacklist 1998 “any comment”
; to remove:
; database del blacklist 1998
; to list
; database show blacklist
 
[blacklist]
exten => _XXXX!,1,NoOp(${CALLERID(num)})
exten => _XXXX!,n,GotoIf($[${DB_EXISTS(blacklist/${CALLERID(num)})}]?blocked)
exten => _XXXX!,n,Goto(radio-secure,${EXTEN},1)
exten => _XXXX!,n(blocked),Hangup;

In iax.conf modify the [radio] context by commenting context = radio-secure and adding context = blacklist

[radio]
type = user
disallow = all
allow = ulaw
allow = adpcm
allow = gsm
codecpriority = host
;context = radio-secure
context = blacklist
transfer = no