Solved

Get Provider From Cell Number

Posted on 2014-01-05
3
376 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
The goal of the tutorial is to teach the user how to block contacts and manage the block contact list.
The goal of the tutorial is to teach the user how download Skype and make an account and set it up. This tutorial will be in three parts.

743 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

11 Experts available now in Live!

Get 1:1 Help Now