Upgrade 3CX to v18 and get it hosted free!

Asterisk Pranks and Tricks

Author image

About

This page is devoted to creative pranks and tricks that one could play by manipulating Asterisk, its dialplan and applications. In honor of April Fools` Day, please add your A) ideas for pranks B) actual dialplan excerpts for pranks and C) stories of playing pranks with Asterisk. Please avoid posting pranks that explicitly seek to endanger lives or create irreparable harm to others (e.g. re-routing emergency calls).

Prank Ideas

  • Exchange Dial() with DialVoiceChange()

Prank Implementations

I have a web page set up whereby I can launch a prank call very conveniently. The web page contains a form that calls a perl script which then initiates the call:

pranks.html:

<html>
Please enter a 10 digit number for the VOIP prank as well as your pin# and the type of prank:
<br><br><br>
<form name="myform" action="../cgi-bin/voip/prankcall.pl" method="POST">
Call:<input type="text" name="numtocall" size=12><br>
From:<input type="text" name="cid" size=12><br>
Pin:<input type="password" name="pinnum" size=4><br>
Which prank:<select name="whatprank">
        <option value="banana">Banana Phone
        <option value="parrot">Parrot Call
        <option value="phonesex">Phone Sex
        <option value="birthday">Happy Birthday
</select><br>
<INPUT  type="submit" value="Click for Prank Call">
</form>
</html>

prankcall.pl:

#!/usr/bin/perl -w
use strict;
use File::Copy;

my $password="XXXX";
my $filelocation="/var/spool/asterisk/outgoing/webcall.call";
my $pair;
my $field;
my $value;
my %INPUT;
my $ldprovider = "SIP/provider";


print "Content-type: text/html\r\n\r\n";
print "<html>\n";
print "<title>Prank Call</title>\n";


my $in = <STDIN>;
my @inputvalues = split(/\&/,$in);
foreach $pair (@inputvalues) {
        if($pair=~m/([^=]+)=(.*)/) {
                $field = $1;
                $value = $2;
                $value =~ s/\+/ /g;
                $value =~ s/%([\dA-Fa-f]{2})/pack("C", hex($1))/eg;
                $INPUT{$field}=$value;
                }
}

my $ntc = $INPUT{'numtocall'};
my $vnum = length ($ntc);
if($vnum != 10) {
        die print "<h3><br><br><br><center><font color=red>Sorry, that's not a valid number, please try again</html>";

}

my $pinnum = $INPUT{'pinnum'};
if ($pinnum != $password) {
        die print "<h3><br><br><br><center><font color=red>Sorry, you have entered an incorrect PIN number, please try again</html>";
}

my $whatprank = $INPUT{'whatprank'};

my $cid = $INPUT{'cid'};

open (CALLQUEUE, ">$filelocation") || die print "Could not open file";
print CALLQUEUE "channel: $ldprovider/1$ntc\ncallerid: $cid\ncontext: pranks\nextension:$whatprank\npriority:1\n";
close (CALLQUEUE);

print "<h2>\n";
print "<br><br><br><br><Center> Expect the $whatprank prank call to <font color=blue>$INPUT{'numtocall'}</font> shortly\n\n";
print "</html>\n\n";
exit (0);

extensions.conf:

[pranks]
exten => banana,1,MP3Player(music/raffi - banana phone.mp3)
exten => banana,n,Hangup

exten => parrot,1,Answer
exten => parrot,2,Parrot(P(4.0))
exten => parrot,3,Hangup

exten => phonesex,1,Answer
exten => phonesex,n,Dial(SIP/[email protected])
exten => phonesex,n,Hangup

exten => birthday,1,MP3Player(music/Happy Birthday - Frank Sinatra.mp3)
exten => birdthay,n,Hangup

Success Stories

Related Links


Article Reviews

Write a Review

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

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.
Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.