mrt:plivo-meteor

v1.0.0Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Meteor wrapper for Plivo, the telephony framework

This smart package wraps the npm package for Plivo, an open source telephony and SMS application prototyping framework.

This uses version 0.1.0 of the Plivo Node.js package and the new meteor 0.6.0 npm bindings.

To get started, replace AUTH_ID, AUTH_TOKEN with your Plivo credentials and use some of the examples below:

####Send an SMS text message

1
2  plivo = Plivo.RestAPI({
3    authId: AUTH_ID,
4    authToken: AUTH_TOKEN,
5  });
6
7  var params = {
8      'src': 'xxxxxxxxxx', // Caller Id
9      'dst' : 'xxxxxxxxxx', // User Number to Call
10      'text' : "Hi, message from Plivo",
11      'type' : "sms",
12  };
13
14  plivo.send_message(params, function (status, response) {
15      console.log('Status: ', status);
16      console.log('API Response:\n', response);
17  });
18
19

####Place a phone call, and respond with instructions from the given URL

1
2  plivo = Plivo.RestAPI({
3    authId: AUTH_ID,
4    authToken: AUTH_TOKEN,
5  });
6  
7  var params = {};
8  params.from = "xxxxxxxxxx";
9  params.to = "xxxxxxxxxx";
10  params.answer_url = "http://somesite.com/answer_url.xml";
11
12  plivo.make_call(params, function (status, response) {
13      console.log('Status: ', status);
14      console.log('API Response:\n', response);
15  });
16
17

For more examples, check out the official Plivo node.js quickstart repo.