GFLAGS module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”gflags module (global flags) keeps a bitmap of flags in shared memory and may be used to change behaviour of server based on value of the flags. Example:
if (is_gflag("1")) { t_relay("udp:10.0.0.1:5060");} else { t_relay("udp:10.0.0.2:5060");}The benefit of this module is the value of the switch flags can be manipulated by external applications such as web interface or command line tools. The size of bitmap is 32.
The module exports external commands that can be used to change the global flags via Management Interface. The MI commands are: “set_gflag”, “reset_gflag” and “is_gflag”.
Dependencies
Section titled “Dependencies”The module depends on the following modules (in the other words the listed modules must be loaded before this module):
- none
Exported Parameters
Section titled “Exported Parameters”initial (integer)
Section titled “initial (integer)”The initial value of global flags bitmap.
Default value is “0”.
modparam("gflags", "initial", 15)Exported Functions
Section titled “Exported Functions”set_gflag(flag)
Section titled “set_gflag(flag)”Set the bit at the position “flag” in global flags.
“flag” can have a value in the range of 0..31.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE.
...set_gflag("4");...reset_gflag(flag)
Section titled “reset_gflag(flag)”Reset the bit at the position “flag” in global flags.
“flag” can have a value in the range of 0..31.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE.
...reset_gflag("4");...is_gflag(flag)
Section titled “is_gflag(flag)”Check if bit at the position “flag” in global flags is set.
“flag” can have a value in the range of 0..31.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE.
...if(is_gflag("4")){ log("global flag 4 is set\n");} else { log("global flag 4 is not set\n");};...Exported MI Functions
Section titled “Exported MI Functions”Functions that check or change some flags accepts one parameter which is the flag bitmap/mask specifing the corresponding flags. It is not possible to specify directly the flag position that should be changed as in the functions available in the routing script.
set_gflag
Section titled “set_gflag”Set the value of some flags (specified by bitmask) to 1.
The parameter value must be a bitmask in decimal or hexa format. The bitmaks has a 32 bit size.
...$ opensipsctl fifo set_gflag 1$ opensipsctl fifo set_gflag 0x3...reset_gflag
Section titled “reset_gflag”Reset the value of some flags to 0.
The parameter value must be a bitmask in decimal or hexa format. The bitmaks has a 32 bit size.
...$ opensipsctl fifo reset_gflag 1$ opensipsctl fifo reset_gflag 0x3...is_gflag
Section titled “is_gflag”Returns true if the all the flags from the bitmask are set.
The parameter value must be a bitmask in decimal or hexa format. The bitmaks has a 32 bit size.
The function returns TRUE if all the flags from the set are set and FALSE if at least one is not set.
...$ opensipsctl fifo set_gflag 1024$ opensipsctl fifo is_gflag 1024TRUE$ opensipsctl fifo is_gflag 1025TRUE$ opensipsctl fifo is_gflag 1023FALSE$ opensipsctl fifo set_gflag 0x10$ opensipsctl fifo is_gflag 1023TRUE$ opensipsctl fifo is_gflag 1007FALSE$ opensipsctl fifo is_gflag 16TRUE...get_gflags
Section titled “get_gflags”Return the bitmap with all flags. The function gets no parameters and returns the bitmap in hexa and decimal format.
...$ opensipsctl fifo get_gflags0x303912345...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. | Bogdan-Andrei Iancu (@bogdan-iancu) | 40 | 28 | 514 | 419 |
| 2. | Daniel-Constantin Mierla (@miconda) | 14 | 12 | 42 | 22 |
| 3. | Stefan Darius (@dariusstefan) | 9 | 5 | 269 | 38 |
| 4. | Henning Westerholt (@henningw) | 8 | 6 | 42 | 31 |
| 5. | Jiri Kuthan (@jiriatipteldotorg) | 8 | 4 | 278 | 4 |
| 6. | Razvan Crainea (@razvancrainea) | 6 | 4 | 11 | 11 |
| 7. | Richard Revels | 3 | 1 | 24 | 11 |
| 8. | Anca Vamanu | 3 | 1 | 6 | 3 |
| 9. | Liviu Chircu (@liviuchircu) | 3 | 1 | 5 | 5 |
| 10. | Konstantin Bokarius | 3 | 1 | 2 | 5 |
All remaining contributors: Andrei Pelinescu-Onciul, Edson Gellert Schubert, Klaus Darilion, Ancuta Onofrei.
(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) | Sep 2011 - Jun 2026 |
| 3. | Liviu Chircu (@liviuchircu) | Mar 2014 - Mar 2014 |
| 4. | Bogdan-Andrei Iancu (@bogdan-iancu) | Oct 2005 - Jan 2013 |
| 5. | Anca Vamanu | Sep 2009 - Sep 2009 |
| 6. | Richard Revels | Aug 2008 - Aug 2008 |
| 7. | Daniel-Constantin Mierla (@miconda) | Oct 2005 - Jun 2008 |
| 8. | Konstantin Bokarius | Mar 2008 - Mar 2008 |
| 9. | Edson Gellert Schubert | Feb 2008 - Feb 2008 |
| 10. | Henning Westerholt (@henningw) | May 2007 - Dec 2007 |
All remaining contributors: Ancuta Onofrei, Klaus Darilion, Andrei Pelinescu-Onciul, Jiri Kuthan (@jiriatipteldotorg).
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Bogdan-Andrei Iancu (@bogdan-iancu), Richard Revels, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Henning Westerholt (@henningw), Klaus Darilion.
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0