#!/usr/bin/perl # randomcid.agi # Generates a random local Caller ID based off the number dialed # By natas # http://www.oldskoolphreak.com # Put in your dial plan like so: # exten => _1NXXNXXXXXX,1,AGI(random.agi|${EXTEN:1}) use Asterisk::AGI; $AGI = new Asterisk::AGI; $AGI->ReadParse(); # Get the argument passed to the AGI $exten = $ARGV[0]; # Strip off the last 4 digits $npanxx = substr $exten, 0, 6; # Generate a random last 4 digits $gen = rand(99999); $gen =~ s/\.//g; $random = substr $gen, 0, 4; # Set the Caller ID to the NPA-NXX dialed and a random last 4 $AGI->set_callerid($npanxx.$random); # Place the call to the dialed number $AGI->exec('Dial', "IAX2/username\@provider/1$exten"); $AGI->hangup(); exit(0);