Callmemaybe click-to-call service

To perform a call

Make a request with the following properties:

  • Url: https://callmemaybe.qdqmedia.com/call/
  • verb: POST
  • Headers:
    • Content-Type: application/x-www-form-urlencoded
    • Authorization: bearer mysecretkey, ask the web-team for a real secret key.
  • Body (POST parameters). The raw should look like user_phone=+34611111111&customer_phone=+34612345678:
    • customer_phone: One of the phone numbers to communicate. Mandatory.
    • user_phone: The other number to dial. Mandatory
    • customer_id: The customer_id to associate the call to. Mandatory

The phone parameters must include the country prefix. If they not, the default prefix will be applied (+34), but please do. Also, do not submit space formatted numbers like 91 234 54 34 because that's not a valid phone and you will get an error.

Deployment

0. Run tests

First, make sure tests are passing either in gitlab build or in your development environment running:

$ db_connection=postgres://testuser:testuser@localhost:5433/callmemaybe_test npm test

with the correct db_connection variable pointing to your local database. To run tests locally, you probably need to apply the migrations first with:

$ ./node_modules/.bin/knex migrate:latest --env testing

1. Deploy to tsuru

Just deploy using git. Both files, tsuru.yaml and Procfile will take care of everything. Check them in (the unlikely) case you need to perform a manual build.

2. Environment

To check the environment variables you need, visit the files:

  • config/defaults.json with the default configuration values
  • bin/callmemaybe.sh with the tsuru env -> nconf mapping
  • environment/ci/run.sh with the configuration for CI

Other considerations

If the call is triggered from user actions, please use a captcha to protect it.

In the deployment, there is other entry point that needs to be exposed at /outbound/.

The call service is not synchronous nor infallible, don't assume the call will be immediately done.