Skip to content

tapsters/elibphonenumber

 
 

Repository files navigation

elibphonenumber

Build Status

Erlang port of libphonenumber

Notes

  • This project is active. I'm doing updates very offen because I see the original author is no longer maintaining it.
  • Compatible with both rebar and rebar3 or hex
  • To change the libphonenumber version modify in rebar.config the TAG argument sent to make

Compile

In order to compile you need to make sure all dependencies needed to build libphonenumber are already installed.

Next you can find a resume for each operating system where library was tested but in case you encounter problems you can consult as well the documentation from building libphonenumber located here

Ubuntu

On the latest versions it's enough to do:

sudo apt-get install cmake cmake-curses-gui libgtest-dev libre2-dev libicu-dev 
sudo apt-get install libboost-dev libboost-thread-dev libboost-system-dev
sudo apt-get install libprotobuf-dev protobuf-compiler

In case you are using Ubuntu 14.04 also follow the following steps in order to install libre and cmake-3:

sudo apt-get remove cmake cmake-data
sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo -E apt-get update
sudo apt-get install cmake

wget http://mt.archive.ubuntu.com/ubuntu/pool/universe/r/re2/libre2-1_20140304+dfsg-2_amd64.deb -O libre2-1.deb
wget http://es.archive.ubuntu.com/ubuntu/pool/universe/r/re2/libre2-dev_20140304+dfsg-2_amd64.deb -O libre2-dev.deb
sudo dpkg -i libre2*.deb
Debian 9 (Stretch)

The same as for Ubuntu

sudo apt-get install cmake cmake-curses-gui libgtest-dev libre2-dev libicu-dev 
sudo apt-get install libboost-dev libboost-thread-dev libboost-system-dev
sudo apt-get install libprotobuf-dev protobuf-compiler
CentOS 7

Enable EPEL (for RE2 & gtest):

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

And install packages:

sudo yum install cmake git boost-devel gtest-devel libicu-devel protobuf-devel protobuf-compiler re2-devel
Mac Os

On Mac OS make sure you have brew installed and rebar will automatically install all necessary dependencies.

Get carrier for number

In order to do this make sure the application is started then use phonenumber_to_carrier:carrier_for_number/2 method

application:ensure_all_started(elibphonenumber).
phonenumber_to_carrier:carrier_for_number(<<"44743655551">>, <<"en">>).

Run the tests

rebar3 eunit

About

Erlang port for use libphonenumber from erlang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Erlang 65.6%
  • C++ 28.6%
  • Makefile 3.1%
  • Shell 2.7%