Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I detect a cellular carrier dynamically through php/ajax/javascript? [closed]

I'm asking this because I've been on SO most of the day, and can’t seem to get/find an answer.

This is what I'm trying to do (without using a paid gateway):

-First of all I'm setting up a database with various info and dates.

-Using a cron I will be running a script to send out that various information (user supplied) to the user on that date via an email to SMS PHP script.

-To avoid maintaining an accurate cellular carrier list. I would like to somehow ping the number and return the carrier and the appropriate "@carrier-email-extension" to send out the message. (I don't want to ask the user during registration; to streamline registration - as not to be a PIA and get more users) - I currently have a dropdown with about 50 carriers listed (I know I may have forgotten or accidentally left out some), but I don't want to have to maintain the list. I would like to delete this part of the form. Ideally, I would like to check the number via ajax/javascript as it is entered and send the carrier info to MYSQL during submission.

-The user already agrees to get SMS messages/updates/texts from my service, so nothing malicious is going on. They will agree when setting up another message:

You will be sending a SMS message with the following information {listed information} to your mobile number, {mobile number} on {date}.

Any suggestions?

like image 217
rcpilotp51 Avatar asked Apr 08 '13 19:04

rcpilotp51


1 Answers

If you want to determine the actual carrier of a phone number, you should do what's called an HLR (Home Location Register) lookup. Many messaging services provide such a service and they usually have an HTTP API for that. However, it is going to cost you - there is a price per each lookup, quite small but it all adds up.

Also, if you need this for specific countries, the regulatory authority in charge of phone numbering may or may not have some kind of a database service that can be queried for numbering data. These usually have fixed costs, so you should do the math if you're doing enough lookups for that country's numbers so that it pays off.

like image 66
pilsetnieks Avatar answered Oct 12 '22 10:10

pilsetnieks