How can I determine the dynamics of cellular communications through php / ajax / javascript?

I ask about this because most of the day I was at SO and it seems that I could not find the answer.

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

- First of all, I am setting up a database with various information and dates.

-Using cron, I will run the script to send this information (to the user) to the user on this date by email to the SMS PHP script.

- To avoid maintaining an accurate list of mobile operators. I would like to somehow ping the number and return the carrier and the corresponding "@ carrier-email-extension" to send the message. (I do not want to ask the user during registration, to simplify registration - so as not to be a PIA and get more users). I currently have a drop-down menu with approximately 50 registered media (I know that I may have forgotten or accidentally forgot some), but I do not want 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 I type it and send the carrier information to MYSQL at the time of sending.

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

"You will send an SMS message with the following information {the specified information} to your mobile phone number {mobile phone number} on {date}."

Any suggestions?

+7
source share
3 answers

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

In addition, if necessary for specific countries, the regulatory body responsible for telephone numbering may or may not have any database service that may be requested for data numbering. Usually they have fixed costs, so you should do the math if you make enough requests for these numbers to pay off.

+2
source

I also had this problem - here is a quick solution that will provide you with a mobile phone for mobile phones for email functions for SMS, given only the cellular number:

<?php // leave this blank - we may never implement an authentication key $smsarc_API_key = ''; // enter the user 10 digit cell phone number. // example format: $smsarc_to = '5556667777'; $smsarc_number = '3123094991'; // lookup carrier $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, 'http://www.smsarc.com/api-carrier-lookup.php?sa_number='.$smsarc_number); $AskApache_result = curl_exec ($ch); $smsarc_message_status = $AskApache_result; curl_close($ch); // print the carrier lookup results echo $smsarc_carrier; ?> 

Developer API from your site: http://www.smsarc.com/free-php-cell-phone-carrier-lookup/

+4
source

Two-step process.

  • Find a country code for mobile devices .. You can use the Google API for this ... Google provides this for free (Google: libphonenumber - Google's phone number processing library)

  • A list of network codes is available on Wikipedia ... For each country, you must implement this by selecting the first country code with several digits. (Google: country code - Wikipedia)

You will find a network code list for each country where you will see the operator name and MCNC MNC list. When you find out the country code of a country from a mobile number, each career has a unique MNC MCC. Then for each country you need to program a lookup table; Select the first 3 digits of the mobile number and assign it a network code ... Do this exercise for the operators of your country, you will find out.

Since I implemented it for the text API , this is why I can tell you this. Its a lot of hard work. Good luck

+3
source

All Articles