Revisiting Bluemix with Twilio
Tinniam V Ganesh 270004Y158 Visits (1312)
This post walks you through the steps to use Twilio with IBM's Bluemix to send an SMS and also make a voice call when you click a URL. Twilio, is a cloud communications SaaS organization which allows you to use standard web languages to build voice, SMS and VOIP applications via a Web API.
Twilio provides the ability to build VOIP applications using APIs. Twilio itself resides in the cloud and is always available. It also provides SIP integration which means that it can be integrated with Soft switches. Twilio looks really interesting with its ability to combine the cloud, Web and VOIP, SMS and the like.
The steps given below allow you to use your app to perform 2 things by clicking the app's URL namely webs
a) Send a SMS to your mobile phone
b) Make a voice call to your mobile phone
The code can be forked from Devops at websmstest
Connecting Twilio with Bluemix
2) Click Add a Service and under 'Web and Application' and choose Twilio.
3) Enter a name for the Twilio service. You will also need the Account SID and Authorization token
5) Once you have registered, go to your Twilio Dashboard for the Account SID and Auth Token. If the Auth token is encrypted, you can click the 'lock' symbol to display the Auth token in plain text.
Setup the application
12) You will need to modify the following files
13) In the manifest.yml make sure you enter the name of your application and the host
- host: websmstest disk: 1024M name: websmstest command: node app.js path: . domain: mybluemix.net mem: 128M instances: 1
14) Lastly make changes to your app.js.
var app = require('gopher'), twilio = require('twilio'); var config = JSON
Test the application
19) Now click on your application to open the details and then click the link adjacent to the Routes.
20) You should see that an SMS has been sent as shown
21) Your mobile should now display the message that was sent as shown below
22) Uncomment the lines which deal with making voice call and you should receive a voice announcement (see below) (Remember to comment the green highlighted line clie
23) Check the analytics in your Twilio dashboard
From my blog: Giga thoughts ...
Disclaimer: This article represents the author’s viewpoint only and doesn’t necessarily represent IBM’s positions, strategies or opinions