A recorded version of this workshop is available on YouTube.

Preparations

  1. Create a 46elks account.
  2. Text your first name to +46766865445 to get an account on the production server. SMS account

Be patient!

Be patient with yourself and others. We'll help each other out!

What we're doing today

Set up your project

  1. Login to the production server.
    Change username to your own username on the server.

    $ ssh username@64.225.108.133
  2. Setup virtualenv
    $ python3 -m venv venv
    $ . venv/bin/activate
    $ pip install flask requests
  3. Setup the Flask project
    $ vim app.py
    
                
  4. Run your Flask app.
    Replace your_port_num with your own port number

    $ FLASK_APP=app.py flask run --host 0.0.0.0 --port your_port_num 
  5. Visit your Flask app
    Replace your_port_num with your own port number

    http://64.225.108.133:your_port_num/
  6. Add a 2nd route

    
                
  7. Visit your new route
    Replace your_port_num with your own port number

    http://64.225.108.133:your_port_num/hello

Setup your virtual phone number

  1. Log in to your 46elks account.
  2. Click numbers.

    You should automatically get a phone number when creating your 46elks account throught the registration link on this page.
    If you don't have a virtual phone number write in the chat and an elk will help you out!

  3. Click edit next to your virtual number.
  4. Click edit next to voice_start to edit the URL, and set it to
    http://64.225.108.133:your_port_number/incoming-calls
  5. Click save changes.

Test your app

Ask someone to call your virtual number and the call should be connected to your regular phone.

Forward incoming phone calls

  • Remove your previous code in app.py and add the following code:

    
              

    On row 11, replace port 5000 with your own port number.

  • Set up your answering machine

    1. Create a folder
      $ mkdir recorded-voice-messages
    2. Remove your previous code in app.py and add the following code:

      
                  

      On row 11, replace port 5000 with your own port number.

    3. Add a route to forward all calls

      
                  
    4. Only forward calls during daytime

      
                  
    5. Add an answering machine that lets the caller leave a message

      
                 

    Resources

    Audio

    Full code