Solved

Get Provider From Cell Number

Posted on 2014-01-05
3
386 Views
Last Modified: 2014-01-06
I want to sms race results to participants if they provide a cell phone number.  I know that the cell phone needs to be tied to a provider in order to send it a text message.  Is there a way to get the provider from the number so the athlete doesn't have to provide that?
0
Comment
Question by:Bob Schneider
3 Comments
 
LVL 16

Assisted Solution

by:R. Andrew Koffron
R. Andrew Koffron earned 100 total points
ID: 39758437
with all the number porting the last several years I'd think it'd be very tough, and maybe you could get probably "x,y,z provider" type info but even land lines can be ported with a bit of finagling
0
 
LVL 12

Assisted Solution

by:ryan80
ryan80 earned 50 total points
ID: 39758496
You could reach out to Neustar to see if they would give you that info, but I doubt it. They maintain the national database with that info.

You could also use a sms of course at a cost.
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 350 total points
ID: 39758559
While you can send text via an email if you know the carrier http:Q_27955479.html#a3865569, you can do a lot more by using Twillio's api http://www.twilio.com/sms

The cost is $1 per month for a phone number and $0.075 to send out an sms (100 messages would cost you 75 cents).  All you need is the number.  It will not matter what the carrier is or if they use google voice.  You can also use the number to receive info and interact with the db.

The api is easy although they don't show classic asp http://www.twilio.com/docs/api/rest/sms
php
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library
 
// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "AC5ef8732a3c49700934481addd5ce1659"; 
$token = "{{ auth_token }}"; 
$client = new Services_Twilio($sid, $token);
 
// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$sms = $client->account->sms_messages->get("SM800f449d0399ed014aae2bcc0cc2f2ec");
echo $sms->body;

Open in new window

classic asp
<%
		thePhone=' could be hard coded, request.form("something") or a rs("something")
		theTextMessage=' could be hard coded, request.form("something") or a rs("something")
	    accountSid = "abcxyz"
		authToken = "abcxyz"

		' setup the URL
		baseUrl = "https://api.twilio.com"
		smsUrl = baseUrl & "/2010-04-01/Accounts/" & accountSid & "/SMS/Messages"

		' setup the request and authorization
		Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
		http.open "POST", smsUrl, False, accountSid, authToken
		http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

		' call parameters
		From = "+15555555555" ' Use +1 and your phone number t
		recipient = "+1"&thePhone 'the phone number to send 

		      
		body = "Hi, I am your text message"&theTextMessage

		postData = "From=" & Server.URLEncode(From)
		postData = postData & "&To=" & Server.URLEncode(recipient)
		postData = postData & "&Body=" & Server.URLEncode(body) 

		' send the POST data
		http.send postData

		' optionally write out the response if you need to check if it worked
		'Response.Write http.responseText

		' clean up
		Set http = Nothing
		
		end if

%>

Open in new window

0

Featured Post

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
What do we know about Legacy Video Conferencing? - Full IT support needed! - Complicated systems at outrageous prices! - Intense training required! Highfive believes we need to embrace a new alternative.
The goal of the tutorial is to teach the user how to make an account for Skype and brief over view of all the options. There are the parts in this series.
This Micro Tutorial will give you a basic overview of Skype through its settings, interface, and features.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now