Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Adam Blackburn <adam@ifit.com>
AJ ONeal <coolaj86@gmail.com> <http://coolaj86.com>
113 changes: 94 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,108 @@
sms-address
====================

### Basic Usage
(this project may be merged into the `sms-address` module)

sms-address returns an email address that can be used to send an SMS
message.
Performs a lookup of the mobile phone carrier company name to get the sms and mms gateway email addresses for that carrier.

It takes two arguments, phone number, and carrier.
You can use the SMS gateway address to send text messages from email.

Usage
===

```bash
npm install sms-address
```

```javascript
var sms = require('sms-address');
'use strict';

var smsAddress = require('sms-address')
, email
;

email = smsAddress.sms('verizon', 5550002222);

console.log(email);
// 5550002222@vtext.com
```

API
===

* `sms` - lookup sms domain or email
* `mms` - lookup mms domain or email
* `carrier` - reverse lookup carrier from sms, mms, or company name
* `lookup` - return an object with sms, mms, wireless, and carrier short name

var email = sms('123-456-7890', 'Verizon');
### sms

email === '1234567890@vtext.com';
Accepts any carrier name / company name string and an optional phone number
and returns the gateway domain or email to sms address or `null`

```javascript
lookups.sms(carrierString); // gateway
lookups.sms(carrierString[, phone]); // phone@gateway
```

```javascript
lookups.sms('Cellco DBA Verizon Wireless'); // "vtext.com"
lookups.sms('T-Mobile', '+15550002222'); // "5550002222@tmomail.net"
lookups.sms('att', '+15550002222'); // "5550002222@txt.att.net"
```

sms-address also exports the carriers it supports. US only for now.
### mms

Accepts any carrier name / company name string and an optional phone number
and returns the gateway domain or email to mms address or `null`

```javascript
lookups.mms(carrierString); // gateway
lookups.mms(carrierString[, phone]); // phone@gateway
```

```javascript
var sms = require('sms-address');
lookups.mms('AT&T Mobility'); // "mms.att.net"
lookups.mms('Sprint', '+15550002222'); // "5550002222@pm.sprint.com"
lookups.mms('tmobile', '+15550002222'); // "5550002222@tmomail.net"
```

### carrier

Accepts an sms or mms gateway domain or email address, or a carrier string
and returns the simple carrier string or `null`

```javascript
lookups.carrier(smsMmsOrCarrierString); // programmer-friendly carrier name
```

```javascript
lookups.sms('AT&T Mobility'); // "att"
lookups.sms('messaging.sprintpcs.com'); // "sprint"
lookups.carrier('5550002222@vzwpix.com'); // "verizon"
```

### lookup

```javascript
lookups.lookup(carrierStr[, phone, object]);
```

```javascript
lookups.lookup("Verizon");

{ carrier: 'verizon'
, smsGateway: 'vtext.com'
, mmsGateway: 'vzwpix.com'
}


console.log(sms.carriers)
lookups.lookup("Verizon Wireless", '5550002222', { foo: "bar" });

// outputs:
{
"Alaska Communications": "msg.acsalaska.com",
"Alltel": "sms.alltelwireless.com",
"Ameritech": "paging.acswireless.com",
"AT&T": "txt.att.net",
"BellSouth": "bellsouth.cl",
"Bluegrass Cellular": "sms.bluecell.com",
// and so on and so forth ...
{ foo: 'bar'
, wireless: true
, carrier: 'verizon'
, smsAddress: '5550002222@vtext.com
, mmsAddress: '5550002222@vzwpix.com
}
```
File renamed without changes.
168 changes: 168 additions & 0 deletions carriers/historic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
'use strict';
// HISTORIC
// this is a compiled list of known carriers that have not yet
// yet been seen in the wild. It is believed that they are
// bought out and deprecated (such as Alltel and Cingular), but since many
// numbers are still listed under their original carrier in many
// public records and some of their gateways still function, they
// are useful nonetheless.

// ALPHABETIC
// When editing this file, please maintain alphabetic order
module.exports = [
{ "name": 'alltel'
, "carrier": "Alltel"
, "sms": 'text.wireless.alltel.com'
, "wireless": true
}
// listed a second time for reverse lookup by the alternate sms address
, { "name": 'alltel'
, "carrier": "Alltel"
, "sms": 'message.alltel.com'
, "wireless": true
}
, { "name": 'alltel'
, "carrier": "Alltel"
, "sms": "sms.alltelwireless.com"
}
, { "name": "ameritech"
, "carrier": "Ameritech"
, "sms": "paging.acswireless.com"
}
, { "name": "bellsouth"
, "carrier": "BellSouth"
, "sms": "bellsouth.cl"
}
, { "name": "bluegrass"
, "carrier": "Bluegrass Cellular"
, "sms": "sms.bluecell.com"
}
, { "name": "cspire"
, "carrier": "C Spire Wireless"
, "sms": "cspire1.com"
}
, { "name": "cellcom"
, "carrier": "Cellcom"
, "sms": "cellcom.quiktxt.com"
}
, { "name": "cellularone"
, "carrier": "Cellular One"
, "sms": "mobile.celloneusa.com"
}
, { "name": "cellularsouth"
, "carrier": "Cellular South"
, "sms": "csouth1.com"
}
, { "name": 'cingular'
, "sms": 'cingularme.com'
, "wireless": true
}
, { "name": "charitonvalley"
, "carrier": "Chariton Valley Wireless"
, "sms": "sms.cvalley.net"
}
, { "name": "cleartalk"
, "carrier": "Cleartalk"
, "sms": "sms.cleartalk.us"
}
, { "name": "edge"
, "carrier": "Edge Wireless"
, "sms": "sms.edgewireless.com"
}
, { "name": "element"
, "carrier": "Element Mobile"
, "sms": "SMS.elementmobile.net"
}
, { "name": "esendex"
, "carrier": "Esendex"
, "sms": "echoemail.net"
}
, { "name": "googlevoice"
, "carrier": "Google Voice"
// valid only for receiving, not for sending
, "sms": "txt.voice.google.com"
, "test": function (string) {
// allow googlevoice or gvoice or google voice
var re = /\b(g(oogle)?\s*voice)\b/i
;

return re.test(string);
}
}
, { "name": 'gophone'
, "sms": 'cingularme.com'
, "wireless": true
}
, { "name": 'gophone'
, "carrier": "Cingular (GoPhone prepaid)"
, "sms": "cingulartext.com"
}
, { "name": "kajeet"
, "carrier": "Kajeet"
, "sms": "mobile.kajeet.net"
}
, { "name": "longlines"
, "carrier": "LongLines"
, "sms": "text.longlines.com"
}
, { "name": "metropcs"
, "carrier": "MetroPCS"
, "sms": "mymetropcs.com"
}
, { "name": 'nextel'
, "carrier": "Nextel"
, "sms": "messaging.nextel.com"
, "wireless": true
}
, { "name": "o2"
, "carrier": "O2"
, "sms": "mobile.celloneusa.com"
}
, { "name": "orange"
, "carrier": "Orange"
, "sms": "mobile.celloneusa.com"
}
, { "name": "pioneer"
, "carrier": "Pioneer Cellular"
, "sms": "zsend.com"
}
, { "name": 'powertel'
, "sms": 'ptel.net'
}
, { "name": "qwest"
// duplicated for second name as Qwest Wireless
, "carrier": "Qwest Wireless"
, "sms": "qwestmp.com"
}
, { "name": "redpocket"
, "carrier": "Red Pocket Mobile"
, "sms": "txt.att.net"
}
, { "name": "simple"
, "carrier": "Simple Mobile"
, "sms": "smtext.com"
}
, { "name": "southcentral"
, "carrier": "South Central Communications"
, "sms": "rinasms.com"
}
, { "name": "straighttalk"
, "carrier": "Straight Talk"
, "sms": "vtext.com"
}
, { "name": 'suncom'
, "sms": 'tms.suncom.com'
}
, { "name": "teleflip"
, "carrier": "Teleflip"
, "sms": "teleflip.com"
}
, { "name": "unicel"
, "carrier": "Unicel"
, "sms": "utext.com"
}
, { "name": "usamobility"
, "carrier": "USA Mobility"
, "sms": "usamobility.net"
}
];
Loading