Revisiting Bluemix with Twilio

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 websmstest.bluemix.net

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

  1. Fire-up a Node.js Webstarter application from the Bluemix dashboard. In my case I have named the application websmstest. Once this is up and running

fig1

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

  1. For this go to http://www.twilio.com and sign up

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.

  1. Enter the Account SID and Auth Token in the Twilio service in Bluemix in the right hand panel shown in the picture below

fig2

  1. To get started click the link websmstest code from Devops.

  2. Next click the ‘Edit Code’ button at the top

  3. Then click ‘Fork’ and provide a suitable name for your project

fig6

  1. Check the option for a) Deploy to Bluemix. Uncheck the other options a) Make it private b) Add features for Scrum development

  2. On the left hand side navigate to the file you need to edit and make the changes with the Devops GUI editor. You will need to make the following changes

Setup the application

12) You will need to modify the following files

  1. manifest.yml
  2. app.js

13) In the manifest.yml make sure you enter the name of your application and the host

applications:

- 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.parse(process.env.VCAP_SERVICES);
 
var twilioSid, twilioToken;
config['user-provided'].forEach(function(service) {
    if (service.name == 'Twilio') {
        twilioSid = service.credentials.accountSID;
        twilioToken = service.credentials.authToken;
    }
});
 

// URL 
app.get('/', function(request, response) {
    var client = new twilio.RestClient(twilioSid, twilioToken);
 
    /* To make a voice call to your mobile phone uncomment the next 2 lines */
   //client.calls.create({
   //url: "http://twimlets.com/message?Message%5B0%5D=Hello",
   
    
     //  to: Enter your mobile phone  for e.g.98765 43210
     // from: Enter the number Twilio alloted to your account
     // body: The message you would like to send
     client.sendMessage({
    	  to: '+919876543210',
         from: '+16305476427',
         body:'Twilio notification through Bluemix!'
        }, function(err, message) {
        response.send('Message sent! ID:'+message.sid);
    });
});
  1. Enter your mobile number in the ‘to:’ line.

  2. Enter the number provided to you in your Twilio account see below

fig3

  1. In the app.js code above in step 14) use the green highlighted line to send a SMS to your mobile phone

  2. If you uncomment the blue highlighted lines a voice call will be made to your mobile

  3. Finally ‘Deploy’ the application on to Bluemix (more details on Deploying to Bluemix) can be found at Getting started with IBM Bluemix and IBM Devops services using Node.js

Test the application

19) Now click on your application to open the details and then click the link adjacent to the Routes.

fig8

20) You should see that an SMS has been sent as shown

fig4

21) Your mobile should now display the message that was sent as shown below

Screenshot_2014-06-22-13-41-44

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 client.sendMessage!)

1

23) Check the analytics in your Twilio dashboard

fig5

Disclaimer: This article represents the author’s viewpoint only and doesn’t necessarily represent IBM’s positions, strategies or opinions


Find me on Google+

Mixing Twilio with IBM Bluemix

This post walks you through the steps to get started with Twilio on IBM’s Bluemix. Twilio comes as a service that you can add  to your Mobile Cloud or Node.js app. Here’s a quick look at Twilio. Twilio, is a cloud communications IaaS organization which  allows you 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.

This post barely scratches the surface of Twilio & Blue mix. This article provides aa hands-on experience for integration of Twilio with Bluemix and is based on this Twilio blog post. It enables you to send a SMS to your mobile phone by typing in a URL.

As in my earlier post the steps are

1) Fire-up a Node.js  Webstarter application from the  Bluemix dashboard.  In my case I have named the application websms. Once this is up and running

2) Click Add a Service and under ‘Web and Application’ choose Twilio.

3) Enter a  name for the Twilio service. You will also need the Account SID and Authorization token

4) For this go to http://www.twilio.com and sign up2

5) Once you have registered, go to your 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.

6) Enter the Accout SID and Auth Token in the Twilio service in Bluemix

7)  To get started you can simply  fork my Twilio  websms code from devops.

8) Now clone the code into a folder you create as follows

git clone https://hub.jazz.net/git/tvganesh/websms

9) You will need to modify the following files

package.json

manifest.yml

app.js

 

10) You can create package.json by running
npm init. Make sure you enter the name of the application you created in Bluemix. In my case it is “websms’ For the rest of the options you can choose the default. Here is the package.json file
"name": "websms",
"version": "0.0.0",
"description": "This README.md file is displayed on your project page. You should edit this \r file to describe your project, including instructions for building and \r running the project, pointers to the license under which you are making the \r project available, and anything else you think would be useful for others to\r know.",
"main": "app.js",
"dependencies": {
"gopher": "^0.0.7",
"express": "^3.12.0",
"twilio": "^1.6.0",
"ejs": "^1.0.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://hub.jazz.net/git/tvganesh/websms"
},
"author": "",
"license": "ISC"
}

11) In the manifest.yml make sure you enter the name of your application and the host

applications:
- host: websms
disk: 1024M
name: websms
command: node app.js
path: .
domain: <your domain>
mem: 128M
instances: 1

12) Lastly make changes to your app.js.

// dependencies
var app = require('gopher'),
twilio = require('twilio');
var config = JSON.parse(process.env.VCAP_SERVICES);
var twilioSid, twilioToken;
config['user-provided'].forEach(function(service) {
if (service.name == 'Twilio') {
twilioSid = service.credentials.accountSID;
twilioToken = service.credentials.authToken;
}
});
// URL test
app.get('/', function(request, response) {
var client = new twilio.RestClient(twilioSid, twilioToken);
client.sendMessage({
to:'<Your mobile number>',
from:'<Number from Twilio dashboard',
body:'Twilio notification through Bluemix!'
}, function(err, message) {
response.send('Message sent! ID: '+message.sid);
});
});

13) After you have made the changes you will need to push the changes to Bluemix using the command line based ‘cf’ tool
14) Login into cf with
cf login – a http://api.ng.bluemix.net

15) Push the websms onto bluemix

16) In the folder where you websms files reside entr the following command
cf push websms -p . -m 512M

17) This should push the code to Bluemix.
Note: If you happen to get a
Server error, status code: 400, error code: 170001, message: Staging error: cannot get instances since staging failed
then you need to make sure to check the changes made to  files app.js, package.,json or the manigfest,yml.

18)  If all things went smoothly, go to your Bluemix dashboard and click the link adjacent to the Routes. You should see that an SMS has been sent as shown

3

19) Your mobile should now display the message that was sent as shown below
Screenshot_2014-06-22-13-41-44

20) Check the  analytics in your Twilio dashboard
1

Disclaimer: This article represents the author’s viewpoint only and doesn’t necessarily represent IBM’s positions, strategies or opinions

Find me on Google+

Accelerating growth through M-Banking & M-Health

While only roughly about 5% of the population has access to computers, more than 50% of the world population has mobile phones. Mobile phones have become cheaper and are more ubiquitous these days. Hence given the penetration of mobile phones it makes sense to use them for improving the lives of those in emerging economies. Two such technologies which hold enormous potential are m-banking and m-health described below.

M-banking: Financial services, a key driver for economic growth, is either negligible or completely absent in remote rural areas. Regular banking services are unviable in these areas. The small deposits and loans held by the rural poor make it unprofitable for traditional banks to operate in these areas through traditional delivery methods.  In these areas m-banking is truly a god send.

M-Banking refers to financial services offered by Service Providers to the unbanked poor in rural areas. The people in these villages can purchase either pre-paid or post-paid units from the Operator. They can then use these units to pay for goods and services. M-Banking offers a safe and secure method to the unbanked poor for sending and receiving payments through SMS’es. To make m-banking a reality, requires the coming together of the 3 major players namely the Service Provider, the Application developer and the financial institution which can regulate and disburse units of money.

A recent report by McKinsey with GSMA in 147 countries shows that more than 1.7 billion people in emerging economies will have a mobile phone without access to banking services. The McKinsey reports also states that by 2012 the opportunity in m-banking would generate $5 billion annually in direct revenue from financial transactions and $3 billion in indirect revenue through reduced customer churn and higher ARPU for traditional voice and SMS services.

Some examples of success are M-Pesa of Kenya, Wizzit in South Africa and Globe in Philippines.  M-banking provides a 24×7 service in the village and does not require any complicated infrastructure. One could imagine services where the unbanked poor could receive instant payment for the farm produce, could save money on a regular basis and pay for electricity bills instantaneously through SMS. This will increase both the sense of security and personal well being.

M-banking provides for tremendous socio-economic growth in the villages. With the increasing penetration and the ubiquity of mobile phones m-banking represents a sure-shot way of ensuring all round economic transformation in the villages.  M-banking helps in reducing risk and brings true convenience to financial transactions. However, appropriate authentication and authorization procedures should be used.

Mobile banking does not need expensive infrastructure that is required of banks, the network of ATMs for depositing and withdrawal of money. M-banking is convenient, secure, easy to use and can be quickly deployed. While the Service Providers are the facilitators of m-banking, it is the financial institutions that will regulate and provide banking facility to the unbanked poor.

Hence m-banking is a complete win-win situation for the all the players involved namely the CSPs, the financial institutions and the unbanked poor. Besides providing convenience, m-banking will be a key driver for all round economic growth in the villages.

M-Health: Another companion technology which has enormous potential in emerging markets is m-health. M-health relates to the provision of health services in rural areas where there is an acute shortage of qualified health workers. In these areas the use of mobile communication can help in addressing key health needs of the poor, thanks to the explosive growth of mobile phones in these areas.

Some of the key benefits of m-health is the ability to spread timely health related information and diagnoses to the health workers in the villages enabling the ability to quickly track and contain the spread of diseases and epidemics. Other applications include remote data collection and monitoring of health related issues.

Recent estimates indicate that half of the population in remote areas will have a mobile phone by 2012. This provides inmates in even the remote villages’ instant access to the important health related information’s-health along with m-banking can allow Health organizations to transfer funds which the needy can use for performing health checkups.

Like m-banking SMS is a key enabler of m-health. SMS’es can be sent to educate and spread awareness of diseases, transfer funds and for informing the availability of health services. Health workers can mobile phones or PDAs to collect and send disease related data.

M-health also provides a unique opportunity for Service Providers, Health institutions, insurance companies and the patients themselves.

Conclusion: With the increasing penetration of mobiles both m-banking and m-health are particularly relevant today. Both these technologies are capable of not only transforming the economic landscape but also providing the CSPs, financial and health institutions with a sound business and strategic advantage.

Find me on Google+

The Future of Telecom

Published in Voice & Data – Bright Future

Introduction: The close of the 20th century will long be remembered for one thing. The dotcom bust followed by the downward spiral of many major telecom and technology companies. For those who believe in the theory of the 12 year economic cycle this downturn is right about to end and we should see good times soon. Even otherwise there is good news for those in the telecom domain. We could shortly be witness to golden years ahead. There are many signs that seem to indicate that the telecom industry is on the verge of many major breakthroughs. Technologies like LTE, IMS, smartphones, cloud computing point to interesting times ahead. In fact telecom is at a inflexion point when the fortunes seem to be pointed northward. This article looks at some of the promising technologies which are going to bring back the sunshine to telecom.

3G Technologies –Better Quality of Experience (QoE): The auction of the 3G spectrum ended after 131 days of hectic bidding for this cutting edge telecom technology. 3G promises a whole new customer experience backed by extremely high data speeds. 3G promises download speed of up to 2 Mbps for stationary subscribers and 384 Kbps for moving subscribers. It is very clear that such high data speeds will inspire a host of new and exciting applications. Applications that span location based services (LBS), m-Commerce and NFC communications will be simply be irresistible to the users. Moreover the ability to watch video clips or live action on mobile TV or on laptops enabled with 3G dongles will have a lot of takers for 3G technology. App stores for 3G are bound to do a roaring business as 3G takes off in India.

Smartphones – The game changers: In the last decade or so in the telecom industry no other invention has had such a disruptive effect in the telecom domain as smartphones. Smartphones like the IPhone, Droid or Nexus One have changed the rules of the game. The impact of smartphone has been so huge that it actually spawned an entire industry of developers who developed applications for smartphones, content developers and app stores. The irresistible appeal of smartphones is the ease of use and the ability to browse the net as though they were using a normal data connection.  Users can watch youtube clips, play games or chat on the Smartphone.

IP Multimedia Systems (IMS) – Digital Convergence:  IP Multimedia System (IMS) , based on 3GPP’s Release 5 Specification in 2005, has been in the wings for quite some time. The IMS envisions an access agnostic telecommunication architecture that will use an all-IP Core for the transport of medium be it voice, data or video. IMS uses SIP protocol for signaling between network elements and SDP for exchanging media between applications.  The IMS architecture promises a whole slew of exciting application ranging from high quality video conference, high speed data access, white boarding or real time interactive gaining.  IMS represents a true convergence of the telecom wireless concepts with the data communication protocols. The types of services that are possible with IMS will be only limited by imagination. With the entry of smartphones and tablet PCs, IMS is a technology that is waiting to happen and will soon become prime time

Long Term Evolution (LTE)Blazing Speeds: Already there are upward of 5 billion mobile devices and a report from Cisco states that the total data navigating the net will exceed ½ a zettabyte (1021) by the year 2013. The exponential growth of data and the need to provide even higher Quality of Experience (QoE) led to the development of the LTE. LTE is considered 4G technology. LTE promises speeds anywhere between to 56 Mbps to 100 Mbps to users enabling unheard of speeds and applications.  What makes  LTE so attractive is that it promises better spectral efficiency and lower cost per bit than 3G networks. The competing technology for LTE is WIMAX which is also considered as 4G. But LTE has a better evolution path from 3G networks as opposed to WiMAX, While LTE is a packet only network there are sound strategies for handling voice traffic with LTE.  The standards body 3GPP offers two options for handling voice. The first is the Circuit switched (CS) fallback to 2G/3G network. In this scenario data access will be through the packet network of LTE while voice calls will use legacy 2G/3G voice networks. The other alternative is the switch voice traffic to the IMS network with its all-IP Core. This method is supported by the One Voice initiative of many major telecom companies and accepted by GSMA.  This strategy for handling voice through an IMS network is known as VoLTE (Voice over LTE)

Internet of Things- Towards a connected World:  “The Internet of Things” visualizes a highly interconnected world made of tiny passive or intelligent devices that connect to large databases and to the internet. This technology promises to transform the network from a dumb-bit pipe to a truly “computing” network. The Internet of Things or M2M (machine-to-machine) envisages an anytime, anywhere, anyone, anything network. The devices in this M2M network will be made up of passive elements, sensors and intelligent devices that communicate with the network. The devices will be capable of sensing, identifying and responding to changes in the immediate environment. Radio Frequency Identification (RFIDs) is one of the early and key enabler of this technology. The uses for this technology range from warning when the structural integrity of bridges is compromised to implantable devices in heart patients warning doctors of possible heart attacks.  The impact of the Internet of Things will be far-reaching. There are numerous applications for this technology. In fact, ubiquitous computing or the Internet of Things allows us to distribute processing power and intelligence throughout the network into a kind of ambient intelligence spread across the network. This technology promises to blur the lines between science fiction and reality.

App StoresThe final verdict:  The success of App Stores in the last couple of years has been nothing short of phenomenal. It is a complete ecosystem with App Store Developers, App Stores, and the Content Developers and Service Providers.  Apps and App stores have changed the rules of the game so completely. No longer is a mobile phone’s snazzy looks enough for it to be a best seller.  The mobile should be supported by cool downloadable apps for the user to use.  App Stores and apps will play an increasingly important role with apps being developed for smartphones and tablet PCs.  There are bound to be several interesting apps spanning technologies like   Location Based Service (LBS), mobile Commerce, eTicketing, Near Field Communication

Cloud Computing – Utility computing: Cloud Computing has been around some but is slowly gaining more and more prominence. Cloud computing follows a utility model for computing where the cloud user only pays for the computing power and storage capacity used. Cloud computing not involve any upfront Capacity expenditure (Capex).  Users of public clouds like EC2, App Engine or Azure can pay according to the usage of the resources provided by the cloud. Cloud technologies allow the CSPs to purchase processing power, platforms, and databases almost like a utility like electricity or water.  The cloud exhibits an elastic behavior and expands to accommodate increasing demands and contracts when the demand drops. Cloud computing will be slowly be adopted by more and more organizations and enterprises in the years to come.

AnalyticsMining intelligence from data:  Nowadays organizations all over are faced with a deluge of data.  For raw data to be useful it has been analyzed, classified and important patterns determined from the data. This is where data mining and analytics come into play. Analytics uses statistical methods to classify data, determine correlations, identify patterns, and highlight and detect key trends among large data sets. Analytics enables industries to plumb the data sets through the process of selecting, exploring and modeling large amount of data to uncover previously unknown data patterns. The insights which analytics provides can be channelized to business advantage. Data mining and predictive analytics unlock the hidden secrets of data and help businesses make strategic decisions. Analytics is bound to become more common and will play a predominant role in all organizations in the years to come.

Internet TVHot off the net:  If IMS represents the convergence of Telecom and the internet, Internet TV represents the marriage of TV and the internet. Internet TV is a technology whose time has come. Internet TV will bring a whole new user experience by allowing the viewer to be view rich content on his TV in an interactive manner. The technology titans like Apple, Microsoft and Google  have their own version of this technology. Internet TV combines TV, the internet and apps for this new technology.  Internet TV is bound to become popular with complementary technologies like IMS, LTE allowing for high speed data exchange and the popularity of websites like Youtube etc. Internet TV will receive a further boost from apps of smartphones and tablet PCs

IPv4 exhaustion – Damocles’ sword: While the future holds the promise of many new technologies it is also going throw a lot of attendant challenges. One serious problem that will need serious attention in the not too distant future is the IPv4 address space exhaustion.  This problem may be even more serious than the Y2K problem. The issue is that IPv4 can address only 2 32 or 4.3 billion devices. Already the pool has been exhausted because of new technologies like IMS which uses an all IP Core and the Internet of things with more devices, sensors connected to the internet – each identified by an IP address. The solution to this problem has been addressed long back and requires that the Internet adopt IPv6 addressing scheme. IPv6 uses 128-bit long address and allows 3.4 x 1038 or 340 trillion, trillion, trillion unique addresses. However the conversion to IPv6 is not happening at the required pace and pretty soon will have to be adopted on war footing. It is clear that while the transition takes place, both IPv4 and IPv6 will co-exist so there will be an additional requirement of devices on the internet to be able to convert from one to another

Conclusion:

Technologies like IMS, LTE, and Internet TV have a lot of potential and hold a lot of promise.  We as human beings have a constant need for better, faster and cheaper technologies. We can expect a lot of changes to happen in the next couple of years. We may once see rosy times ahead for telecom as a whole

<
Find me on Google+