Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sidhantpanda/exotel-node
A NodeJs wrapper for Exotel APIs
https://github.com/sidhantpanda/exotel-node
Last synced: 23 days ago
JSON representation
A NodeJs wrapper for Exotel APIs
- Host: GitHub
- URL: https://github.com/sidhantpanda/exotel-node
- Owner: sidhantpanda
- Created: 2016-02-22T05:59:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-03-16T06:14:42.000Z (over 8 years ago)
- Last Synced: 2024-10-03T22:41:09.472Z (about 1 month ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Exotel NodeJs Wrapper
A NodeJs wrapper for Exotel APIs. Converts Exotel XML response to Javascript object.```npm install exotel-node```
### Include and initialize
```javascript
var Exotel = require('exotel-node');
Exotel.init(SID, TOKEN, EXOPHONE);
```### APIs available
* [Send SMS](#send_sms)
* [Connect call](#connect_call)
* [Get call details](#get_call_details)### Send SMS
```javascript
Exotel.sendSMS(TO_NUMBER, MESSAGE, function(error, response) {
if (!error) {
console.log(response);
}
});
```### Connect call (Connect agent to customer)
```javascript
Exotel.connectCall(AGENT_NUMBER, CUSTOMER_NUMBER, function(error, response) {
if (!error) {
console.log(response);
}
});
```### Get call details
```javascript
Exotel.getCallDetails(CALL_SID, function(error, response) {
if (!error) {
console.log(response);
console.log(response.DateCreated); // Date created
console.log(response.DateUpdated); // Date updated
console.log(response.AccountSid); // Account SID used to create the call
console.log(response.To); // Customer number/2nd number in API call
console.log(response.From); // Agent number/1st number in API call
console.log(response.Status); // Call status
console.log(response.StartTime); // Call start time
console.log(response.EndTime); // Call end time
console.log(response.Duration); // Call duration
console.log(response.Price); // Call cost
console.log(response.RecordingUrl); // Call recording url
}
});
```
---
### Submit issues
You can raise an issue in this repo or mail me at [email protected]