A multi-vendor library for cellular network services
Multi-vendor cellular network services for node.js
Everything else sucks
- Send SMS
- Make and Recieve Phone calls
- Twillio (SMS, Call)
var Telenode = require'telenode';var client = Telenodeproviderstwilio;clientcredentialssid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'authToken: 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY';clientSMSsendfrom: '+19171239876'to: '+19171239876'body: 'Hello World'if err throw err;console.log'Body: ' + body;;
Create a file that has the name of the service, place it in the providers directory. Everything that is exported is attached to the new
Telenode instance. Let's say we create a file called
//// this will become available on the new instance.//console.log'here it is';;//// create containers one level deep. they get bound to the correct context for you.//exportsContainer =thisgetInfo;console.log'something new';;
var client = foobar;//// This is a contrived example that will simply output text to the console,// but it demonstrates how the module will be attached to the instance.//clientContainergetTheSameInfo;clientContainergetSomeInfo;
Often your API service will want to let you know after some operation has finished. The plugin structure provides a web server to listen for API services that want to call back. In your provider module, you can add routes for this.
thisHTTProute'/inbound/url/sample/''POST'//// handle the inbound request from the API service.//;;
(The MIT License)
Copyright (c) 2010 hij1nx http://www.twitter.com/hij1nx
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.