Get Provider From Cell Number

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?
Bob SchneiderCo-OwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

R. Andrew KoffronownerCommented:
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
ryan80Commented:
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.
Scott FellDeveloper & EE ModeratorCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Telecommunications

From novice to tech pro — start learning today.