Posts

Showing posts with the label outbound

Asterisk Outbound Whitelisting

Asterisk Outbound Whitelisting There are numerous ways to handle outbound whitelisting on asterisk, but I needed a solution where the end user could simply ftp a text file to the server to update the whitelist. You will need to create the following files: /etc/asterisk/checkwhitelist.sh /etc/asterisk/whitelist.txt Start with: #vim /etc/asterisk/checkwhitelist.sh and add the following contents: if grep -q $1 "/etc/asterisk/whitelist.txt"; then echo "1" else echo "0" fi After creating the file, make it executable with the following command: chmod a+x /etc/asterisk/checkwhitelist.sh Also create the following file: #vim /etc/asterisk/whitelist.txt You can then add the allowed numbers to this text file, one per line. eg: 0123456789 0124567890 0126789012 I will keep the example dialplan simple for illustrative purposes: #vim /etc/asterisk/extensions.conf: Place the following code in you outbound context: [outgoing] include => internal exten => _XXX.,1,NoOp...