Skip to main content

JavaScript Example - cidspoof

About

Simple script to specify caller ID and place a call.

Example

Caller*ID spoof

/** 
cidspoof.js - Simple script to specify caller ID and place a call.
JavaScript Application for FreeSwitch::mod_spidermonkey.
Not responsible for your use of this script. Please consider all applicable laws before using.
-kn0x
**/
/** We using TeleTone to generate the confirmation tones **/
use("TeleTone");
/**Declare variables(necessary?)- I don't know JS, so who knows :P **/
var cidnum = "";
var dest = "";
var gateway = "sofia/gateway/provider/1"; /** sofia gateway config, 1 added for 11-digit dial **/
var teletone = new TeleTone(session);
session.answer();
teletone.generate("%(1000,20,800,820)");
cidnum = session.getDigits(10, "#", 12000);
teletone.generate("%(800,20,500,520)");
dest = session.getDigits(10, "#", 12000);
session.setVariable("effective_caller_id_number", cidnum);
session.execute("bridge", gateway + dest);
session.hangup(); /** Clean hangup **/