#!/bin/bash # # backspoof-exchange.sh v1.0 - Nov 27, 2006 # # Useage: run this in /var/spool/asterisk/ as ./backspoof-exchange.sh [area code] [exchange] [beginning number] [end number] # # written by ATravelingGeek # email: atg@atravelinggeek.com # # Use this only for legal stuff. I take NO responsibility for what you do with it # this script also needs work. I'll do that later. echo "Using area code $1" echo "scanning exchange $2" if [ -n "$3" ]; then # -n tests to see if the argument is non empty echo "resuming from $3" num=$3 else echo "resuming opt is blank; starting at 1000" num=1000 fi if [ -n "$4" ]; then # -n tests to see if the argument is non empty echo "scanning to $4" range_to=$4 else tmp=$4 echo "scanning 1000 more to $((tmp+1000))" range_to=$((tmp+1000)) num=1000 fi #num=1000 while [ $num -le $range_to ] do echo "Channel: IAX2/[ACCOUNT @ PROVIDER]/[INBOUND NUM]" > $1-$2-$num.call echo "CallerID: $1$2$num" >> $1-$2-$num.call echo "MaxRetries: 0" >> $1-$2-$num.call echo "RetryTime: 1" >> $1-$2-$num.call echo "WaitTime: 2" >> $1-$2-$num.call echo "Extension: 0" >> $1-$2-$num.call mv $1-$2-$num.call outgoing/ echo "sleeping 5 seconds for $1-$2-$num.call" sleep 5 num=$((num+1)) done