Skip to content

Phone number validation, sanitization and formatting for FreeSWITCH

License

Notifications You must be signed in to change notification settings

rtckit/mod_phonenumber

Repository files navigation

mod_phonenumber

Exposes libphonenumber to FreeSWITCH

Build Status Version License

Installation

As with FreeSWITCH, Debian is reference platform for mod_phonenumber:

curl -sL \
  https://rtckit.io/mod_phonenumber/freeswitch-mod-phonenumber_`curl -s https://rtckit.io/mod_phonenumber/release.txt`_`dpkg --print-architecture`.deb \
  -o freeswitch-mod-phonenumber.deb
sudo dpkg -i freeswitch-mod-phonenumber.deb

Make sure the module is added to modules.conf.xml or loaded manually (e.g. load mod_phonenumber).

Usage

mod_phonenumber has been developed against FreeSWITCH 1.10+; although it may work well with previous versions, they are not explicitly supported.

The module can be used in three modes: as a dialplan application, through the API interface or whenever a new channel is created through hooks. Regardless of the invocation mode, it expects:

  • one or mode actions to execute
  • a phone number to execute the actions against
  • a set of parameters

Please refer to rtckit.io/mod_phonenumber/ for the complete documentation.

Build

In order to build the module from source, the environment requires the typical C/C++ build essentials for your platform (build-essential), the FreeSWITCH development files (libfreeswitch-dev) as well as the libicu and libphonenumber libraries and their respective development files (libicu-dev and libphonenumber-dev).

make
make install

Tests

Before running the test suite, make sure sure the module is built and installed.

make check

License

MIT, see LICENSE file.

Acknowledgments

Contributing

Bug reports (and small patches) can be submitted via the issue tracker. Forking the repository and submitting a Pull Request is preferred for substantial patches.

If you believe the module returns incorrect results, please test the input against libphonenumber's online demo application and if the results are different, please raise an issue here. Otherwise, it could be an issue in the upstream and the bug should be reported in the libphonenumber repository.