Opensips::Pi

Opensips::Pi is an OpenSIPS Provisioning Interface for Ruby.

Installation

Add this line to your application's Gemfile:

gem 'opensips-pi'

And then execute:

$ bundle

Or manually install it:

$ gem install opensips-pi

Configuration

By default, opensipsctl is used to run all commands. You can change this as the following:

Opensips::Pi.bin = "/usr/sbin/opensipsctl"

To log information, an instance of Logger is used by default. You can also change this:

Opensips::Pi.logger = Rails.logger

Usage

To add a new user:

Opensips::Pi.add("username", "password")

To remove an user:

Opensips::Pi.remove("username")

To change user's password:

Opensips::Pi.password("username", "new_password")

More methods will be available soon. Feel free to fork this project and contribute with pull requests.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

This project is released under the MIT License. See LICENSE.txt for more information.