Protect your customers' privacy by creating a seamless interaction by provisioning Twilio numbers on the fly. Route all voice calls and messages through your very own 3rd party. This allows you to control the interaction between your customers, while putting your customer's privacy first.
You will need to configure Twilio to send requests to your application when SMSs are received.
You will need to provision at least one Twilio number with SMS capabilities so the application's users can make property reservations. You can buy a number right here. Once you have a number you need to configure it to work with your application. Open the number management page and open a number's configuration by clicking on it.
Remember that the number where you change the SMS webhook must be the same one you set on the TwilioPhoneNumber
settings.
Learn how to configure a Twilio phone number for Programmable Voice
To start using ngrok
in our project you'll have execute to the following line in the command prompt.
ngrok http 5000 -host-header="localhost:5000"
Keep in mind that our endpoint is:
http://<your-ngrok-subdomain>.ngrok.io/reservations/confirm
This project is configured to use a TwiML App that allows us to easily set the voice URLs for all Twilio phone numbers we purchase in this app.
Create a new TwiML app and use its Sid
as the TwiMLApplicationSID
application setting.
Learn more about creating a TwiML app here
Once you have created your TwiML app, configure your Twilio phone number to use it (instructions here).
If you don't have a Twilio phone number yet, you can purchase a new number in your Twilio Account Dashboard.
You'll need to update your TwiML app's voice and SMS URL setting to use your ngrok
hostname. It will look something like this:
http://<your-ngrok-subdomain>.ngrok.io/exchange/sms
http://<your-ngrok-subdomain>.ngrok.io/exchange/voice
-
Clone this repository and
cd
into it.git clone [email protected]:TwilioDevEd/airtng-flask.git
-
Create a new virtual environment.
-
If using vanilla virtualenv:
virtualenv venv source venv/bin/activate
-
If using virtualenvwrapper:
mkvirtualenv airtng-flask
-
-
Install the requirements.
pip install -r requirements.txt
-
Edit the following keys/values for the
config.py
file inside theairtng_flask/
directory. Be sure to replace the place holders and connection strings with real information or reuse the provided one, like the connection string.TWILIO_ACCOUNT_SID = 'your_twilio_account_sid' TWILIO_AUTH_TOKEN = 'your_twilio_auth_token' TWILIO_NUMBER = 'your_twilio_phone_number' APPLICATION_SID = 'your_application_sid' SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'dev.sqlite')
-
Run the migrations.
python manage.py db upgrade
-
Start the development server.
python manage.py runserver
-
Check it out at http://localhost:5000
You can run the tests locally through coverage:
-
Run the tests.
$ coverage run manage.py test
You can then view the results with coverage report
or build an HTML report with coverage html
.
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.