CLOSEDDIAL module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module provides functionality which allows to group users using a common field, in such a way that a particular group defines abbreviated codes for users, allowing closed dialing within the group, locating users by their abbreviated code, besides their full identification. This module offers a functionality similar to Centrex. The relationship between users and their abbreviated codes, and their grouping is defined in a database table (see below).
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- A database module, like mysql, postgres or dbtext
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- None.
Exported Parameters
Section titled “Exported Parameters”db_url (string)
Section titled “db_url (string)”URL of the database table to be used.
Default value is “mysql://opensips:opensipsrw@localhost/opensips”.
...modparam("closeddial", "db_url", "mysql://username:password@dbhost/opensips")...user_column (string)
Section titled “user_column (string)”Column of the table which stores the username
Default value is “username”.
...modparam("closeddial", "user_column", "user")...domain_column (string)
Section titled “domain_column (string)”Column of the table which stores the domain associated to usernames.
Default value is “domain”.
...modparam("closeddial", "domain_column", "domain")...group_id_column (string)
Section titled “group_id_column (string)”Column of the table which stores the group_id which groups the usernames.
Default value is “group_id”.
...modparam("closeddial", "group_id_column", "groupid")...cd_user_column (string)
Section titled “cd_user_column (string)”Column of the table which stores the closed dial code associated to a username.
Default value is “cd_username”.
...modparam("closeddial", "cd_user_column", "cd_user")...cd_domain_column (string)
Section titled “cd_domain_column (string)”Column of the table which stores the domain associated to closed dial usernames.
Default value is “cd_domain”.
...modparam("closeddial", "cd_domain_column", "cddomain")...new_uri_column (string)
Section titled “new_uri_column (string)”Column of the table which stores the new URI which will be used to rewrite the request, in case a possitive match be found.
Default value is “new_uri”.
...modparam("closeddial", "new_uri_column", "new_uri")...use_domain (integer)
Section titled “use_domain (integer)”If enabled (set to non zero value) then domain will be used also used for searching new uri; otherwise only the username part will be used.
Default value is “0 (no)”.
...modparam("closeddial", "use_domain", 1)...Exported Functions
Section titled “Exported Functions”cd_lookup(domain [, group])
Section titled “cd_lookup(domain [, group])”This function is used to lookup in the database the corresponding URI for an abbreviated code dialed, according to group which From user belongs to. After finding the group for From user, the dialed code and found group are used to look for the new URI to rewrite the request.
If a positive match is found, R-URI is rewritten; if no match is found, R-URI is not changed.
Meaning of the parameters is as follows:
- domain
Table where searching is going to be perfomed on. - group Optional parameter which can be used to store the group to be used in searching. This group must be associated to From user.
Both of the parameters can contain pseudovariables.
This function can be used from REQUEST_ROUTE and FAILURE_ROUTE.
...
# Abbreviated code of two digitsif($(rU{s.len}) == 2){ # Group AVP could be loaded at register time. $avp(s:group)="companyA"; cd_lookup("closeddial", "$avp(s:group)");};...
# Abbreviated code of three digitsif($(rU{s.len}) == 3){ # Group is searched on database, by using # From username. cd_lookup("closeddial");};...Installation
Section titled “Installation”A table needs to be created on the database to store relationship between usernames, their corresponding abbreviated codes and their grouping using group attribute.
The SQL syntax to create the table can be found in closeddial-create.sql script at opensips/scripts folder.
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Sergio Gutierrez | 15 | 6 | 922 | 10 |
| 2. | Bogdan-Andrei Iancu (@bogdan-iancu) | 7 | 5 | 5 | 4 |
| 3. | Stefan Darius (@dariusstefan) | 7 | 3 | 287 | 37 |
| 4. | Razvan Crainea (@razvancrainea) | 3 | 1 | 2 | 2 |
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Jun 2026 - Jun 2026 |
| 3. | Sergio Gutierrez | Feb 2009 - Nov 2010 |
| 4. | Bogdan-Andrei Iancu (@bogdan-iancu) | Feb 2009 - Mar 2010 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Sergio Gutierrez, Bogdan-Andrei Iancu (@bogdan-iancu).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0