EXAMPLE module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module serves as an example of how to write a module in OpenSIPS. Its primary goal is to simplify the development of new modules for newcomers, providing a clear and accessible starting point.
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- No dependencies on other OpenSIPS modules.
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”default_str (string)
Section titled “default_str (string)”The default parameter used when the example str function is called without any parameter.
Default value is "" (empty sring).
...modparam("example", "default_str", "TEST")...default_int (integer)
Section titled “default_int (integer)”The default parameter used when the example int function is called without any parameter.
Default value is “0”.
...modparam("example", "default_int", -1)...Exported Functions
Section titled “Exported Functions”example()
Section titled “example()”Function that simply prints a message to log, saying that it has been called.
This function can be used from any route.
...example();...example_str([string])
Section titled “example_str([string])”Function that simply prints a message to log, saying that it has been called. If a parameter is passed, it is printed in the log, otherwise the value of default str parameter is used.
Meaning of the parameters is as follows:
- string (string, optional) - parameter to be logged
This function can be used from any route.
...example_str("test");...example_int([int])
Section titled “example_int([int])”Function that simply prints a message to log, saying that it has been called. If a parameter is passed, it is printed in the log, otherwise the value of default int parameter is used.
Meaning of the parameters is as follows:
- int (integer, optional) - parameter to be logged
This function can be used from any route.
...example_int(10);...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. | Stefan Darius | 7 | 4 | 160 | 15 |
| 2. | Razvan Crainea (@razvancrainea) | 6 | 2 | 351 | 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 | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Jul 2024 - Jun 2026 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0