[default]
exten => _X.,1,Noop(Dead calls rising)
exten => _X.,n,Set(uri=${CHANNEL(peerip)})
exten => _X.,n,Verbose(3,Unknown call from ${uri} to ${EXTEN})
exten => _X.,n,System(/root/block.sh ${uri})
#######block.sh script
#!/bin/bash
iptables -A INPUT -s $1 -j DROP
/etc/init.d/iptables-persistent save
/etc/init.d/iptables-persistent reload
#apt-get install iptables-persistent
#######
/root/block.sh 10.0.30
#######################
HOW to on FreePBX
nano /etc/asterisk/extensions_override_freepbx.conf
[from-sip-external]
exten => _X.,1,Noop(Dead calls rising)
exten => _X.,n,Set(uri=${CHANNEL(peerip)})
exten => _X.,n,Verbose(3,Unknown call from ${uri} to ${EXTEN})
exten => _X.,n,System(/var/log/asterisk/block.sh ${uri})
#######block.sh script
#!/bin/bash
iptables -A INPUT -s $1 -j DROP
No hay comentarios:
Publicar un comentario