/real-connect

真・WeConnect

Primary LanguagePythonApache License 2.0Apache-2.0

real-connect

Setup

Before you can run or deploy the app, you will need to do the following:

  1. Use the Google Developers Console to create a project/app id. (App id and project id are identical)

  2. Enable Cloud Speech API.

  3. Create a Twilio Account.

  4. Install the Google Cloud SDK, including the gcloud tool, and gcloud app component.

  5. Setup the gcloud tool.

    gcloud init
    
  6. Install ngork

Run Locally

  1. Get credentials used in calling Google APIs.

    gcloud auth application-default login
    
  2. Configure your Twilio settings in the environment variables.

    export TWILIO_ACCOUNT_SID=[your-twilio-accoun-sid]
    export TWILIO_AUTH_TOKEN=[your-twilio-auth-token]
    
  3. Create a virtualenv, install dependencies, and run the sample:

    virtualenv env
    source env/bin/activate
    pip install -r requirements.txt
    python main.py
    
  4. Start ngrok to allow Twilio to connect webhooks on your local server.

    ngrok http 8080
    
  5. Create a number on Twilio, if you haven't already. Configure the voice request URL to be http://random-name.ngrok.io/.

Deploying (Google App Engine)

  1. Copy app.yaml.sample to app.yaml. Configure your Twilio settings in the environment variables section in app.yaml.

    cp app.yaml.sample app.yaml
    
  2. Use gcloud to deploy your app.

    gcloud app deploy
    
  3. Create a number on Twilio, if you haven't already. Configure the voice request URL to be https://your-app-id.appspot.com/.