Asterisk Pranks and Tricks


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:

Please enter a 10 digit number for the VOIP prank as well as your pin# and the type of prank:
<form name="myform" action="../cgi-bin/voip/" 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
<INPUT  type="submit" value="Click for Prank Call">
#!/usr/bin/perl -w
use strict;
use File::Copy;

my $password="XXXX";
my $filelocation="/var/spool/asterisk/outgoing/";
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;

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);

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/
exten => phonesex,n,Hangup

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

Success Stories

Related Links

Created by: chrishardie, Last modification: Sun 10 of Jun, 2012 (00:19 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+