This custom Asterisk dialplan implements a simple proof-of-concept call spoofing flow and call forwarding to a local extension.
- Defines an included context
[from-internal-custom]which includes the[proof-of-concept-custom]dialplan. - In
[proof-of-concept-custom], an extension12345answers the call. - Plays a short welcome message (
pbx-transfer) and prompts the caller to enter a spoof number (please-enter-your+number). - Reads the spoof number into the variable
SPOOF(up to 12 digits, 5 seconds timeout). - If a spoof number was provided:
- Sets
CALLERID(num)to+${SPOOF}. - Sets
CALLERID(name)to+${SPOOF}. - Sets
CDR(outbound_cnum)to+${SPOOF}. If no spoof number provided, no changes to caller ID are made.
- Sets
- Prompts the caller to enter a target extension and reads it into
TARGET(up to 4 digits, 5 seconds timeout). - If
TARGETis empty, playsvm-goodbyeand hangs up. - Plays confirmation prompts (
if-this-is-correct,1-yes-2-no) and reads a single-digit confirmationCONFIRM. - If
CONFIRMequals1, proceeds todo_call; otherwise goes tohangup. do_calllogs aNoOpwith the target and currentCALLERID(num), playsauth-thankyou, then dialsPJSIP/${TARGET}for 30 seconds and hangs up.hangupplaysvm-goodbyeand hangs up.
extensions_custom.conf— contains the dialplan shown (context names:from-internal-custom,proof-of-concept-custom).
These guides were followed to build and configure this proof-of-concept: