[PYTHON] Raspberry pi Let's talk Scam repulsion phone

I got a call from a fraudulent group at my house.

The contents are "You are using the Internet!" "Yes, you are using it." "This is a management site." I don't know what the management site is, so I talked to each other. Annoying with a funny phone. I tried to buy an answering machine, but it seemed like it was popping up on Amazon, but I stopped because it was expensive. I accidentally popped a Rasp pi. That's right, let's make a PBX. Answering machines are also included in Asterisk, and since my home is a Hikari Denwa, I should be able to connect easily. It should be possible with simple settings and IVR scripts.

IP-PBX is a telephone exchange that builds a LAN network with a telephone and enables calls using the Internet.

IVR (Interactive Voice Response) is a system that distributes correspondence to communicators by voice guidance prepared in advance and number input according to the reason for incoming call.

Make a fraudulent phone call with your Raspberry pi.

Asterisk (PBX) is a telephone line switchboard that controls the connection of extension telephones. In addition to connecting extensions, it also controls what goes from the outside to the extension and what goes from the inside to the outside. Use this feature to let the Raspberry PI speak.

Prerequisites

--It has been converted to an optical telephone (IP telephone). --You have a contract for number notification. --You have a home internet contract.

The parent device of the phone is Raspberry pi, and the child device is a family smartphone!

image.png

Smartphone preparation

Install your favorite sip ip-phone.

Download Please install it on your mobile phone.

image.png

It's easy to set up.

image.png

Hikari Denwa settings on the router

image.png First, connect your iPhone to extension number 3 for testing.

image.png image.png

Please call the mail order site starting with 0120 for a trial.

  1. Install pbx (asterisk) on Raspberry pi. The installation method such as download is shown below.
$ sudo su
# cd /usr/src
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
# tar zxvf asterisk-16-current.tar.gz
# cd asterisk-16.3.0
root@raspberrypi:/usr/src/asterisk-16.3.0# sudo apt-get update -y
root@raspberrypi:/usr/src/asterisk-16.3.0# sudo apt-get install -y libedit-dev
root@raspberrypi:/usr/src/asterisk-16.3.0# apt-get install  ncurses-dev libxml2 libxml2-dev sqlite libsqlite3-dev libssl-dev
root@raspberrypi:/usr/src/asterisk-16.3.0# apt-get install alsa-utils sox libsox-fmt-all^
root@raspberrypi:/usr/src/asterisk-16.3.0# apt-get install uuid uuid-runtime uuid-dev
root@raspberrypi:/usr/src/asterisk-16.3.0# apt-get install libjansson4 libjansson-dev
root@raspberrypi:/usr/src/asterisk-16.3.0# apt-get install libpjsip-simple2 libpjsip-ua2 libpjsip2 libpjproject-dev libsrtp-dev srtp-utils
root@raspberrypi:/usr/src/asterisk-16.3.0# apt-get install subversion
root@raspberrypi:/usr/src/asterisk-16.3.0# apt-get install liburi-escape-xs-perl
root@raspberrypi:/usr/src/asterisk-16.3.0# cpan  URI::Escape
root@raspberrypi:/usr/src/asterisk-16.3.0# cpan  URI::Escape
root@raspberrypi:/usr/src/asterisk-16.3.0# cpan LWP::UserAgent
root@raspberrypi:/usr/src/asterisk-16.3.0# cpan LWP::Protocol::https
root@raspberrypi:/usr/src/asterisk-16.3.0# cpan JSON
root@raspberrypi:/usr/src/asterisk-16.3.0# apt-get install flac
root@raspberrypi:/usr/src/asterisk-16.3.0# ./configure --with-jansson-bundled

Success if the following Asterisk illustration mark appears


               .$$$$$$$$$$$$$$$=..      
            .$7$7..          .7$$7:.    
          .$$:.                 ,$7.7   
        .$7.     7$$$$           .$$77  
     ..$$.       $$$$$            .$$$7 
    ..7$   .?.   $$$$$   .?.       7$$$.
   $.$.   .$$$7. $$$$7 .7$$$.      .$$$.
 .777.   .$$$$$$77$$$77$$$$$7.      $$$,
 $$$~      .7$$$$$$$$$$$$$7.       .$$$.
.$$7          .7$$$$$$$7:          ?$$$.
$$$          ?7$$$$$$$$$$I        .$$$7 
$$$       .7$$$$$$$$$$$$$$$$      :$$$. 
$$$       $$$$$$7$$$$$$$$$$$$    .$$$.  
$$$        $$$   7$$$7  .$$$    .$$$.   
$$$$             $$$$7         .$$$.    
7$$$7            7$$$$        7$$$      
 $$$$$                        $$$       
  $$$$7.                       $$  (TM)     
   $$$$$$$.           .7$$$$$$  $$      
     $$$$$$$$$$$$7$$$$$$$$$.$$$$$$      
       $$$$$$$$$$$$$$$$.                

configure: Package configured for: 
configure: OS type  : linux-gnueabihf
configure: Host CPU : armv7l
configure: build-cpu:vendor:os: armv7l : unknown : linux-gnueabihf :
configure: host-cpu:vendor:os: armv7l : unknown : linux-gnueabihf :
root@raspberrypi:/usr/src/asterisk-16.3.0#

Install Japanese audio file

root@raspberrypi:/usr/src/asterisk-16.3.0# make menuselect

From the menu screen, select a file in the required format of CORE_SOUND-JA -.... in Core Sound Packages. image.png

Select as below image.png

Then run make

root@raspberrypi:/usr/src/asterisk-16.3.0# make

If successful, make install

image.png

Backup of configuration file

root@raspberrypi:/home/pi# cd /etc/asterisk
root@raspberrypi:/etc/asterisk# cp sip.conf sip.conf.bak
root@raspberrypi:/etc/asterisk# cp extensions.conf extensions.conf.bak

Installing aquestalkpi Creating a holder for Asterisk

mkdir /usr/lib/asterisk/atp
cp /home/pi/aquestalkpi/*  /usr/lib/asterisk/atp
cp -r /home/pi/aquestalkpi/*  /usr/lib/asterisk/atp

to be continued

Recommended Posts

Raspberry pi Let's talk Scam repulsion phone
Let's do Raspberry Pi?
Raspberry Pi backup
Let's operate GPIO of Raspberry Pi with Python CGI
What is Raspberry Pi?
pigpio on Raspberry pi
Raspberry Pi video camera
Raspberry Pi Bad Knowledge
DigitalSignage with Raspberry Pi
Raspberry Pi 4 setup memo
Cython on Raspberry Pi
Raspberry Pi system monitoring
Check! Let's develop Raspberry Pi Zero remotely-Try using Arafruit WebIDE