Skip to content

EXAMPLE module

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.

The following modules must be loaded before this module:

  • No dependencies on other OpenSIPS modules.

The following libraries or applications must be installed before running OpenSIPS with this module loaded:

  • None.

The default parameter used when the example str function is called without any parameter.

Default value is "" (empty sring).

Set 'default_str' parameter
...
modparam("example", "default_str", "TEST")
...

The default parameter used when the example int function is called without any parameter.

Default value is “0”.

Set 'default_int' parameter
...
modparam("example", "default_int", -1)
...

Function that simply prints a message to log, saying that it has been called.

This function can be used from any route.

example usage
...
example();
...

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() usage
...
example_str("test");
...

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() usage
...
example_int(10);
...

Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)

#NameDevScoreCommitsLines++Lines—
1.Stefan Darius7416015
2.Razvan Crainea (@razvancrainea)623512

(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

#NameCommit Activity
1.Stefan DariusJun 2026 - Jul 2026
2.Razvan Crainea (@razvancrainea)Jul 2024 - Jun 2026

(1) including any documentation-related commits, excluding merge commits

Last edited by: Razvan Crainea (@razvancrainea).

All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0