OpenSIPS CP

February 24, 2025 ยท View on GitHub

This role installs the OpenSIPS CP tool.

Galaxy

Install your role using Ansible Galaxy:

ansible-galaxy install razvancrainea.opensips_cp

Role Variables

The following variables can be set to tune the role's install behavior:

VariableDescriptionDefault
opensips_cp_versionthe (git) version to installmaster
opensips_cp_dirthe directory where the source files should be installed/var/www/html/opensips-cp
opensips_cp_db_engineDatabase engine to be used (currently only mysql and postgres is supported)mysql
opensips_cp_db_hostDatabase hostlocalhost
opensips_cp_db_portDatabase portnot used
opensips_cp_db_userDatabase useropensips
opensips_cp_db_passDatabase passwordopensipsrw
opensips_cp_dbDatabase nameopensips
opensips_cp_passPassword for the default admin useropensips
opensips_cp_statsControls whether stats should be gatheredtrue
opensips_cp_force_deployForces a deployment with the latest codefalse
opensips_cp_system_nameName of the OpenSIPS CP systemSIP Servers
opensips_cp_system_descriptionDescription of the OpenSIPS CP systemOpenSIPS SIP server cluster
opensips_mi_idOpenSIPS JSON-RPC listener's id1
opensips_mi_hostOpenSIPS JSON-RPC listener's host127.0.0.1
opensips_mi_portOpenSIPS JSON-RPC listener's port8888
opensips_mi_rootOpenSIPS JSON-RPC listener's rootmi
opensips_mi_nameOpenSIPS JSON-RPC listener's nameSIP Server
opensips_mi_descOpenSIPS JSON-RPC listener's descriptionDefault box
opensips_monit_hostOpenSIPS Monit hostUndefined, not provided
opensips_monit_portOpenSIPS Monit port2812, useful only when opensips_monit_host is defined
opensips_mi_boxesAn array containing the host, port, root and desc nodes for each MI listener usedAn array with one box containing the opensips_mi_*` variables
opensips_cp_monit_hostHost used by the monit toolValue of opensips_mi_host
opensips_cp_monit_portPort used by the monit tool2812
opensips_cp_modulesPlease view Modules Configurationdefault_opensips_cp_modules

Modules Configuration

The opensips_cp_modules variable can be used to tune the modules that are being configured in OpenSIPS CP. It should be defined as a dictionary where each element contains the specifications of a group (users:, system:). Each group is another dictionary that contains one (or more) of the following keys:

  • name: the name of the group, as it should appear in the web interface
  • icon: path to the icon that shall be used for the group
  • modules: a dictionary containing elements for each module to be used. Example: { rtpproxy: RTPProxy, monit: Monit}) If one of the key is missing, it is taken from the default_opensips_cp_modules variable, if it is defined, or '' otherwise. Each module can also be built as a dictionary, containg one of the following keys:
    • name: The name of the module - if missing the default name is used
    • path: The path where the module can be fonud - if missing path is not provisioned

Limitations

Current known shortcomings of the module:

  • Tools cannot be (granularly) configured - only default config can be used
  • Only one box can be configured

Examples

The following is an example of a playbook that uses the opensips_cp role.

---
- hosts: all
  roles:
    - role: opensips_cp

Example of opensips_cp_modules variable:

opensips_cp_modules:
  system:
    modules:
      rtpproxy: RTPProxy
      monit: Monit
      smonitor: Statistics

Example of opensips_cp_modules specifying the module's path:

opensips_cp_modules:
  system:
    modules:
      monit: Monit
      smonitor: Statistics
  media:
    name: Media
    icon: images/icon-media.svg
    modules:
      rtpproxy:
        name: RTPProxy
        path: system/rtpproxy

License

GPLv3