Documentation

Documentation.Interface-CoreMI-3-0 History

Hide minor edits - Show changes to output

November 26, 2020, at 02:34 PM by liviu -
Deleted lines 371-381:
@]

!!!!raise_event
Raises an event through the Event Interface using an MI command.\\
'''Arguments''':
* ''event'' - event name
* ''params'' (optional) - array of elements, or a JSON object containing key-value pairs
'''Output''': None.\\
Examples of usage:
[@
# opensips-cli -x mi raise_event E_PIKE_BLOCKED 127.0.0.1
October 18, 2019, at 01:47 PM by rvlad_patrascu -
Changed line 1 from:
!!!!!Documentation -> [[Documentation.Manuals|Manuals]] -> [[Documentation.Manual-3-0|Manual 3.0]] -> Core MI Functions
to:
!!!!!Documentation -> [[Documentation.Manuals|Manuals]] -> [[Documentation.Manual-3-0|Manual devel]] -> Core MI Functions
Changed lines 19-22 from:
'''Arguments''': \\
- command (optional)\\
'''Output''': multiple MI nodes where each node contains an argument. The MI nodes have no name, but only value. If ''command'' is specified, the command returns an array that contains all the parameters the command can support.
to:
'''Arguments''': none\\
'''Output''': an array with multiple strings representing the arguments.
Changed lines 25-28 from:
./opensips
-f
/etc/openser/test.cfg
to:
[
"./opensips",
"-f",
"/etc/openser/test.cfg"
]
Changed lines 45-46 from:
'''Output''': an MI tree - first level (nodes named "List") will describe the list (name, owner, flags); Second level (nodes named "Rules) will describe the rules (blacklists) for each list (IP/mask, protocol, port, matching regexp, flags)
to:
'''Output''': an array with each object describing the list (name, owner, flags); the "Rules" item is an array with each object member describing the rules (blacklists) for each list (IP/mask, protocol, port, matching regexp, flags).
Changed lines 55-56 from:
'''Output''': an MI tree - one record per connection with the following attributes : ID, state, proto, source, destination, timeout, lifetime
to:
'''Output''': an array with one object per connection with the following attributes : ID, type, state, source, destination, lifetime, alias port.
Changed line 64 from:
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''log_level''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will change only for that process.
to:
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''log_level''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will change only for that process.\\
Changed lines 66-68 from:
* logging level (-3...4) (see [[Documentation.Script-CoreParameters-3-0#log_level|meaning of the values]])
* Unix pid (validated by OpenSIPS)
to:
* ''level'' (optional) - logging level (-3...4) (see [[Documentation.Script-CoreParameters-3-0#log_level|meaning of the values]])
* ''pid'' (optional) - Unix pid (validated by OpenSIPS)
Changed lines 72-74 from:
Process:: PID=10670 Debug=2 Type=attendant
Process:: PID=10672 Debug=3 Type=MI FIFO
Process:: PID=10673 Debug=1 Type=SIP receiver udp:193.068.3.033:5060
to:
{
"Processes": [
{
"PID": 10670,
"Log level": 2,
"Type": "attendant"
},
{
"PID": 10672,
"Log level": 3,
"Type": "MI FIFO"
},
{
"PID": 10673,
"Log level": 1,
"Type": "SIP receiver udp:193.168.3.133:5060"
},
]
}
Changed lines 92-94 from:
New global debug:: 1
to:
{
"New global log level": 1
}
Changed lines 96-99 from:
New debug:: 4
to:
{
"Log level": 1
}
Changed lines 106-107 from:
'''Output''': multiple MI nodes (named "Process") - each node contains process ID (internal), PID (OS), Type and description
to:
'''Output''': multiple objects, each one containing a process ID (internal), PID (OS) and Type.
Changed lines 111-116 from:
Process:: ID=0 PID=16224 Type=attendant
Process:: ID=1 PID=16225 Type=SIP receiver udp:193.068.1.2:5060
Process:: ID=2 PID=16226 Type=timer
Process:: ID=3 PID=16227 Type=MI FIFO
Process:: ID=4 PID=16228 Type=TCP receiver
Process:: ID=5 PID=16230 Type=TCP main
to:
{
"Processes": [
{
"ID": 0,
"PID": 27271,
"Type": "attendant"
},
{
"ID": 1,
"PID": 27272,
"Type": "MI FIFO"
},
{
"ID": 2,
"PID": 27273,
"Type": "time_keeper"
},
{
"ID": 3,
"PID": 27274,
"Type": "timer"
},
{
"ID": 4,
"PID": 27275,
"Type": "SIP receiver udp:127.0.0.1:5060"
},
{
"ID": 5,
"PID": 27276,
"Type": "Timer handler"
}
]
}
Changed lines 150-152 from:
'''Output''': a single MI node with name "WD" containing the working directory full path.

to:
'''Output''': a single item containing the working directory full path.

Changed lines 156-158 from:
WD:: /
to:
{
"WD": "/"
}
Changed lines 174-176 from:
'''Output''': three MI nodes: "Now" - current time; "Up since" - start time ; "Up time" - number of seconds since started.

to:
'''Output''': three items: "Now" - current time; "Up since" - start time ; "Up time" - number of seconds since started.

Changed lines 180-182 from:
Now:: Mon Jul 21 17:41:03 2008
Up since:: Mon Jul 21 17:36:33 2008
Up time:: 270 [sec]
to:
{
"Now": "Mon Jul 21 17:41:03 2008",
"Up since": "Mon Jul 21 17:36:33 2008",
"Up time": "270 [sec]"
}
Changed lines 190-191 from:
'''Output''': one MI node (named "Server") containing the version string.
to:
'''Output''': one item (named "Server") containing the version string.
Changed lines 195-198 from:
Server:: OpenSIPS (1.4.0dev14-notls (i386/linux))
to:
{
"Server": "OpenSIPS (3.0.0-dev (x86_64/linux))"
}
Changed lines 205-206 from:
'''Output''': multiple MI nodes (no name), each node containing (as value) the name of an available MI command. NOTE that the list of available MI commands may differ depending of what modules your '''OpenSIPS''' is using.
to:
'''Output''': an array of the names of available MI commands. NOTE that the list of available MI commands may differ depending of what modules your '''OpenSIPS''' is using.
Changed lines 210-228 from:
get_statistics
list_statistics
reset_statistics
uptime
version
pwd
arg
which
ps
kill
debug
list_blacklists
ul_rm
ul_rm_contact
ul_dump
ul_flush
ul_add
ul_show_contact
nh_enable_ping
to:
[
"get_statistics",
"list_statistics",
"reset_statistics",
"uptime",
"version",
"pwd",
"arg",
"which",
"ps",
"kill",
"log_level",
"xlog_level",
"shm_check",
"cache_store",
"cache_fetch",
"cache_remove",
"event_subscribe",
"events_list",
...
Changed lines 234-236 from:
'''Arguments''': input may be "all" - print all available statistics; "group:" - print only statistics from a certain group; "name" - print only this statistic. The '''OpenSIPS''' core defines the following groups: ''core'', ''shmem''; Modules export groups typically named like the module itself.\\
'''Output''': list of MI nodes (no name) - each MI mode contains the name and value of a single statistic variable.
to:
'''Arguments''':
* ''statistics'' - an array of the following possible values:
** "all" - print all available statistics;
** "group_name:" - print only statistics from a certain group named "group_name"; the '''OpenSIPS''' core defines the following groups: ''core'', ''shmem''; Modules export groups typically named like the module itself.
** "name" - print only the statistic named "name".
'''Output''': an object containing the names and values of statistic variables.
Changed lines 244-246 from:
core:rcv_requests = 35243
to:
{
"core:rcv_requests": 35243
}
Changed lines 248-254 from:
shmem:total_size = 33554432
shmem:used_size = 1686952
shmem:real_used_size = 1704592
shmem:max_used_size = 1704592
shmem:free_size = 31849840
shmem:fragments = 1
# opensips-cli -x mi get_statistics all
to:
{
"shmem:total_size": 1073741824,
"shmem:max_used_size": 3389232,
"shmem:free_size": 1070352592,
"shmem:used_size": 2808952,
"shmem:real_used_size": 3389232,
"shmem:fragments": 3769
}
# opensips-cli -x mi get_statistics shmem: core:
Changed lines 261-262 from:
Prints a list of all available statistics in the current configuration of OpenSIPS
to:
Prints a list of available statistics in the current configuration of OpenSIPS.
'''Arguments''':
* ''statistics'' (optional) - an array of the same possible values as for '''get_statistics''' MI command, with the exception of "all". Omitting the parameter will list all available statistics.
Changed lines 268-279 from:
shmem:total_size:: incremental
shmem:used_size:: incremental
shmem:real_used_size:: incremental
shmem:max_used_size:: incremental
shmem:free_size:: incremental
shmem:fragments:: incremental
core:rcv_requests:: incremental
core:rcv_replies:: incremental
core:fwd_requests:: incremental
core:fwd_replies:: incremental
core:drop_requests:: incremental
....
to:
{
"shmem:total_size": "non-incremental",
"shmem:max_used_size": "non-incremental",
"shmem:free_size": "non-incremental",
"shmem:used_size": "non-incremental",
"shmem:real_used_size": "non-incremental",
"shmem:fragments": "non-incremental",
"rpmem:rpm_total_size": "non-incremental",
"rpmem:rpm_used_size": "non-incremental",
...
Changed lines 282-283 from:
'''Arguments''': name of the variable to be reset.\\
to:
'''Arguments''':
* ''statistics'' - an array of the names of the variables to be reset.
Changed lines 289-291 from:
core:received_replies = 14543
to:
{
"tm:received_replies": 14543
}
Changed lines 294-296 from:
core:received_replies = 0
to:
{
"tm:received_replies": 0
}
Changed lines 302-305 from:
'''Arguments''': \\
- cache system to use - for the cache system implemented by '''OpenSIPS''' module 'localcache' the value of this parameter should be 'local' \\
- the label to be associated with this value \\
- the string to be stored \\
to:
'''Arguments''':
* ''system'' - cache system to use - for the cache system implemented by '''OpenSIPS''' module 'localcache' the value of this parameter should be 'local';
* ''attr'' - the label to be associated with this value;
* ''value'' - the string to be stored;
* ''expire'' (optional) - expire time for the stored value;
Changed lines 316-320 from:
'''Arguments''': \\
- cache system to use - for the cache system implemented by '''OpenSIPS''' module 'localcache' the value of this parameter should be 'local' \\
- the label associated with the value \\
'''Output''': MI tree containing the value if a record is found or 'Value not found' string otherwise.\\
to:
'''Arguments''':
* ''system'' - cache system to use - for the cache system implemented by '''OpenSIPS''' module 'localcache' the value of this parameter should be 'local'
* ''attr'' - the label associated with the value
'''Output''': object containing the value if a record is found or 'Value not found' string otherwise.\\
Changed lines 328-330 from:
'''Arguments''': \\
- cache system to use\\
- the label associated with the stored value \\
to:
'''Arguments''':
* ''system'' - cache system to use;
* ''attr'' - the label associated with the stored value;
Changed lines 340-343 from:
'''Arguments''': \\
- event name\\
- external application socket \\
- expire time, in seconds - if absent, the subscription is valid only one hour (3600 s)\\
to:
'''Arguments''':
* ''event'' - event name
* ''socket'' - external application socket
* ''expire'' (optional) - expire time, in seconds - if absent, the subscription is valid only one hour (3600 s)
Changed lines 357-360 from:
Event:: E_CORE_THRESHOLD id=0
Event:: E_RTPPROXY_STATUS id=1
Event:: E_PIKE_BLOCKED id=2
to:
{
"Events": [
{
"name": "E_CORE_THRESHOLD",
"id": 0
},
{
"name": "E_CORE_SHM_THRESHOLD",
"id": 1
},
{
"name": "E_CORE_PKG_THRESHOLD",
"id": 2
},
...
Added lines 374-384:
!!!!raise_event
Raises an event through the Event Interface using an MI command.\\
'''Arguments''':
* ''event'' - event name
* ''params'' (optional) - array of elements, or a JSON object containing key-value pairs
'''Output''': None.\\
Examples of usage:
[@
# opensips-cli -x mi raise_event E_PIKE_BLOCKED 127.0.0.1
@]
Changed lines 387-389 from:
'''Arguments''': \\
- event name\\
- external application socket \\
to:
'''Arguments''':
* ''event'' - event name
* ''socket'' (optional) - external application socket
Changed lines 394-400 from:
Event:: E_CORE_THRESHOLD id=0
Event:: E_RTPPROXY_STATUS id=1
Subscriber:: socket=unix:/tmp/event.sock expire=never
Subscriber:: socket=udp:127.0.0.1:8888 expire=1100
Event:: E_PIKE_BLOCKED id=2
Subscriber:: socket=rabbitmq:guest@127.0.0.1/hello expire=never
to:
{
"Events": [{
"name": "E_RTPPROXY_STATUS",
"id": 1,
"subscribers": [
...
]
},
{
"name": "E_PIKE_BLOCKED",
"id": 2,
"subscribers": [
...
]
}
]
}
Changed lines 413-416 from:
Event:: E_RTPPROXY_STATUS id=1
Subscriber:: socket=unix:/tmp/event.sock expire=never
Subscriber:: socket=udp:127.0.0.1:8888 expire=1100
to:
{
"Event": {
"name": "E_RTPPROXY_STATUS",
"id": 1,
"subscribers": [{
"socket": "unix:/tmp/event.sock",
"expire": "never",
},
{
"socket": "udp:127.0.0.1:8888",
"expire": 1100
}
]
}
}
Changed lines 430-431 from:
Event:: E_RTPPROXY_STATUS id=1
Subscriber:: socket=unix:/tmp/event.sock expire=never
to:
{
"Event": {
"name": "E_RTPPROXY_STATUS",
"id": 1,
"Subscriber": {
"socket": "unix:/tmp/event.sock",
"expire": "never"
}
}
}
Changed lines 444-446 from:
'''Arguments''':\\
- PID - mandatory, the pid of the process to perform the pkg dump\\
- log level - optional, a log level to be used for this dump\\
to:
'''Arguments''':
* ''pid'' - the PID of the process to perform the pkg dump
* ''log_level'' (optional) - a log level to be used for this dump
Changed lines 459-460 from:
'''Arguments''':\\
- log level - optional, a log level to be used for this dump\\
to:
'''Arguments''':
* ''log_level'' (otpional) - a log level to be used for this dump
Changed lines 481-483 from:
Get or set the global xlogging level in OpenSIPS processes. If no argument is passed to the '''xlog_level''' command, it will print the current '''xlog_level'''. If a logging '''level''' is given, it will be globally set for all OpenSIPS processes.
to:
Get or set the global xlogging level in OpenSIPS processes. If no argument is passed to the '''xlog_level''' command, it will print the current '''xlog_level'''. If a logging '''level''' is given, it will be globally set for all OpenSIPS processes. \\
'''Arguments''':
* ''level'' (otpional)
April 16, 2019, at 07:54 PM by 109.99.227.30 -
Changed line 111 from:
!!!!reload_script
to:
!!!!reload_routes
April 16, 2019, at 07:38 PM by 109.99.227.30 -
Changed line 25 from:
# opensipsctl fifo arg
to:
# opensips-cli -x mi arg
Changed line 39 from:
# opensipsctl fifo kill
to:
# opensips-cli -x mi kill
Changed line 49 from:
# opensipsctl fifo list_blacklists
to:
# opensips-cli -x mi list_blacklists
Changed line 59 from:
# opensipsctl fifo list_tcp_conns
to:
# opensips-cli -x mi list_tcp_conns
Changed line 71 from:
# opensipsctl fifo log_level
to:
# opensips-cli -x mi log_level
Changed line 89 from:
# opensipsctl fifo ps
to:
# opensips-cli -x mi ps
Changed line 106 from:
# opensipsctl fifo pwd
to:
# opensips-cli -x mi pwd
Changed lines 110-111 from:
!!!!uptime
Prints various time information about '''OpenSIPS''' - when it started to run, for how long it runs.\\
to:

!!!!reload_script
Triggers the reload of the routing block (the routes) from the script during the runtime.
Added lines 114-122:
'''Output''': none

Please note that there are some limitations of when a reload is possible or not. Depending on the initial configuration of your modules, the reload may be rejected as the usage of the functions in the new script is not compatible with the original module setting and initialization.\\
If the reload fails, take a look at the logs to understand why - it may have been a syntax error or maybe a module related constraint. Anyhow, if the reload fails, there is no impact on your running OpenSIPS.


!!!!uptime
Prints various time information about '''OpenSIPS''' - when it started to run, for how long it runs.\\
'''Arguments''': none\\
Changed line 128 from:
# opensipsctl fifo uptime
to:
# opensips-cli -x mi uptime
Changed line 141 from:
# opensipsctl fifo version
to:
# opensips-cli -x mi version
Changed line 153 from:
# opensipsctl fifo which
to:
# opensips-cli -x mi which
Changed line 182 from:
# opensipsctl fifo get_statistics rcv_requests
to:
# opensips-cli -x mi get_statistics rcv_requests
Changed line 184 from:
# opensipsctl fifo get_statistics shmem:
to:
# opensipsc-cli -x mi get_statistics shmem:
Changed line 191 from:
# opensipsctl fifo get_statistics all
to:
# opensips-cli -x mi get_statistics all
Changed line 200 from:
# opensipsctl fifo list_statistics
to:
# opensips-cli -x mi list_statistics
Changed line 222 from:
# opensipsctl fifo get_statistics received_replies
to:
# opensips-cli -x mi get_statistics received_replies
Changed lines 224-225 from:
# opensipsctl fifo reset_statistics received_replies
# opensipsctl fifo get_statistics received_replies
to:
# opensips-cli -x mi reset_statistics received_replies
# opensips-cli -x mi get_statistics received_replies
Changed line 240 from:
# opensipsctl fifo cache_store local password_user1 password
to:
# opensips-cli -x mi cache_store local password_user1 password
Changed line 252 from:
# opensipsctl fifo cache_fetch local password_user1
to:
# opensips-cli -x mi cache_fetch local password_user1
Changed line 263 from:
# opensipsctl fifo cache_remove local password_user1
to:
# opensips-cli -x mi cache_remove local password_user1
Changed line 276 from:
# opensipsctl fifo event_subscribe E_PIKE_BLOCKED udp:127.0.0.1:8888 1200
to:
# opensips-cli -x mi event_subscribe E_PIKE_BLOCKED udp:127.0.0.1:8888 1200
Changed line 285 from:
# opensipsctl fifo events_list
to:
# opensips-cli -x mi events_list
Changed line 300 from:
# opensipsctl fifo subscribers_list
to:
# opensips-cli -x mi subscribers_list
Changed line 308 from:
# opensipsctl fifo subscribers_list E_RTPPROXY_STATUS
to:
# opensips-cli -x mi subscribers_list E_RTPPROXY_STATUS
Changed line 313 from:
# opensipsctl fifo subscribers_list E_RTPPROXY_STATUS unix:/tmp/event.sock
to:
# opensips-cli -x mi subscribers_list E_RTPPROXY_STATUS unix:/tmp/event.sock
Changed line 326 from:
# opensipsctl fifo mem_pkg_dump 11854 -1
to:
# opensips-cli -x mi mem_pkg_dump 11854 -1
Changed line 340 from:
# opensipsctl fifo mem_shm_dump -1
to:
# opensips-cli -x mi mem_shm_dump -1
Changed line 352 from:
# opensipsctl fifo shm_check
to:
# opensips-cli -x mi shm_check
Changed line 361 from:
# opensipsctl fifo xlog_level -2
to:
# opensips-cli -x mi xlog_level -2
March 08, 2019, at 09:18 PM by 109.99.227.30 -
Added lines 345-352:
[[#xlog_level]]
!!!!xlog_level [level]
Get or set the global xlogging level in OpenSIPS processes. If no argument is passed to the '''xlog_level''' command, it will print the current '''xlog_level'''. If a logging '''level''' is given, it will be globally set for all OpenSIPS processes.

Example of usage:
[@
# opensipsctl fifo xlog_level -2
@]
March 07, 2019, at 04:44 PM by razvancrainea -
Changed lines 19-20 from:
'''Arguments''': none\\
'''Output''': multiple MI nodes where each node contains an argument. The MI nodes have no name, but only value.
to:
'''Arguments''': \\
- command (optional)\\
'''Output''': multiple MI nodes where each node contains an argument. The MI nodes have no name, but only value. If ''command'' is specified, the command returns an array that contains all the parameters the command can support.
September 27, 2018, at 07:20 PM by liviu -
Added lines 330-341:
@]

!!!!shm_check
Only available with ''QM_MALLOC'' + ''DBG_MALLOC''. Fully scans the shared memory pool in order to locate any inconsistencies. If any sign of memory corruption is detected, OpenSIPS will immediately abort. \\

'''Arguments''': None\\

'''Output''': current number of fragments.\\

Example of usage:
[@
# opensipsctl fifo shm_check
May 22, 2018, at 12:44 PM by 109.99.227.30 -
Changed line 307 from:
!!!mem_pkg_dump
to:
!!!!mem_pkg_dump
Changed line 322 from:
!!!mem_shm_dump
to:
!!!!mem_shm_dump
May 22, 2018, at 12:44 PM by 109.99.227.30 -
Changed lines 317-322 from:



----

(:commentboxchrono:)
to:
>>important<<
The processes without IPC support (like timer and per-module processes) will not be able to generate a memory dump.
>><<


!!!mem_shm_dump
Triggers a shm memory dump. The memory dump will written to OpenSIPS's log (syslog or stderr) using the 'memdump' logging level. The global 'memdump' log level may be overwritten by a custom value provided as argument to this command.\\
'''Arguments''':\\
- log level - optional, a log level to be used for this dump\\
'''Output''': None.\\
Examples of usage:
[@
# opensipsctl fifo mem_shm_dump -1
@]


----
May 22, 2018, at 12:41 PM by 109.99.227.30 -
Added lines 306-318:

!!!mem_pkg_dump
Triggers a pkg memory dump for a given process. The memory dump will written to OpenSIPS's log (syslog or stderr) using the 'memdump' logging level. The global 'memdump' log level may be overwritten by a custom value provided as argument to this command.\\
'''Arguments''':\\
- PID - mandatory, the pid of the process to perform the pkg dump\\
- log level - optional, a log level to be used for this dump\\
'''Output''': None.\\
Examples of usage:
[@
# opensipsctl fifo mem_pkg_dump 11854 -1
@]

March 28, 2018, at 06:01 PM by razvancrainea -
March 28, 2018, at 06:01 PM by razvancrainea -
Deleted lines 29-33:

!!!!debug %red%(Removed in OpenSIPS 3.0)%%

Replaced by [[#log_level|log_level]] function.
March 24, 2016, at 09:02 PM by 109.102.83.252 -
Changed line 70 from:
* logging level (-3...4) (see [[Documentation.Script-CoreFunctions-3-0#log_level|meaning of the values]])
to:
* logging level (-3...4) (see [[Documentation.Script-CoreParameters-3-0#log_level|meaning of the values]])
March 24, 2016, at 09:02 PM by 109.102.83.252 -
Changed lines 31-37 from:
[[#log_level]]
!!!!log_level [level] [pid]
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''log_level''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will change only for that process.
'''Arguments''':
* logging level (-3...4) (see [[Documentation.Script-CoreFunctions-3-0#log_level|meaning of the values]])
* Unix pid (validated by OpenSIPS)
to:
!!!!debug %red%(Removed in OpenSIPS 3.0)%%

Replaced by [[#log_level|log_level]] function.


!!!!kill
The command will terminate '''OpenSIPS''' (and internal shutdown).\\
'''Arguments''': none\\
'''Output''': none
Changed lines 43-50 from:
# opensipsctl fifo log_level
Process:: PID=10670 Debug=2 Type=attendant
Process:: PID=10672 Debug=3 Type=MI FIFO
Process:: PID=10673 Debug=1 Type=SIP receiver udp:193.068.3.033:5060
# opensipsctl fifo log_level 1
New global debug:: 1
# opensipsctl fifo log_level 4 10670
New debug:: 4
to:
# opensipsctl fifo kill
Changed lines 46-48 from:

!!!!kill
The command will terminate '''OpenSIPS''' (and internal shutdown).\\
to:
!!!!list_blacklists
The command lists all the defined (static or learned) blacklists from '''OpenSIPS'''.\\
Changed lines 49-50 from:
'''Output''': none
to:
'''Output''': an MI tree - first level (nodes named "List") will describe the list (name, owner, flags); Second level (nodes named "Rules) will describe the rules (blacklists) for each list (IP/mask, protocol, port, matching regexp, flags)
Changed line 53 from:
# opensipsctl fifo kill
to:
# opensipsctl fifo list_blacklists
Changed lines 56-57 from:
!!!!list_blacklists
The command lists all the defined (static or learned) blacklists from '''OpenSIPS'''.\\
to:
!!!!list_tcp_conns
The command lists all ongoing TCP/TLS connection from '''OpenSIPS'''.\\
Changed lines 59-60 from:
'''Output''': an MI tree - first level (nodes named "List") will describe the list (name, owner, flags); Second level (nodes named "Rules) will describe the rules (blacklists) for each list (IP/mask, protocol, port, matching regexp, flags)
to:
'''Output''': an MI tree - one record per connection with the following attributes : ID, state, proto, source, destination, timeout, lifetime
Changed line 63 from:
# opensipsctl fifo list_blacklists
to:
# opensipsctl fifo list_tcp_conns
Changed lines 66-70 from:
!!!!list_tcp_conns
The command lists all ongoing TCP/TLS connection from '''OpenSIPS'''.\\
'''Arguments''': none\\
'''Output''': an MI tree - one record per connection with the following attributes : ID, state, proto, source, destination, timeout, lifetime
to:
[[#log_level]]
!!!!log_level [level] [pid]
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''log_level''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will change only for that process.
'''Arguments''':
* logging level (-3...4) (see [[Documentation.Script-CoreFunctions-3-0#log_level|meaning of the values]])
* Unix pid (validated by OpenSIPS)
Changed lines 75-82 from:
# opensipsctl fifo list_tcp_conns
to:
# opensipsctl fifo log_level
Process:: PID=10670 Debug=2 Type=attendant
Process:: PID=10672 Debug=3 Type=MI FIFO
Process:: PID=10673 Debug=1 Type=SIP receiver udp:193.068.3.033:5060
# opensipsctl fifo log_level 1
New global debug:: 1
# opensipsctl fifo log_level 4 10670
New debug:: 4
Added line 84:
March 24, 2016, at 08:59 PM by 109.102.83.252 -
Changed lines 31-33 from:

!!!!debug [level] [pid]
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''debug''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will change only for that process.
to:
[[#log_level]]
!!!!log_level [level] [pid]
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''log_level''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will change only for that process.
Changed line 35 from:
* debug level (-3...4)
to:
* logging level (-3...4) (see [[Documentation.Script-CoreFunctions-3-0#log_level|meaning of the values]])
Changed line 40 from:
# opensipsctl fifo debug
to:
# opensipsctl fifo log_level
Changed line 44 from:
# opensipsctl fifo debug 1
to:
# opensipsctl fifo log_level 1
Changed line 46 from:
# opensipsctl fifo debug 4 10670
to:
# opensipsctl fifo log_level 4 10670
January 05, 2016, at 12:20 PM by liviu -
Changed line 33 from:
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''debug''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will be changed only for that process.
to:
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''debug''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will change only for that process.
January 05, 2016, at 12:19 PM by liviu -
Changed line 33 from:
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''debug''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is given, the logging level will be changed only for that process.
to:
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''debug''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is also given, the logging level will be changed only for that process.
March 13, 2015, at 08:50 PM by liviu -
Added line 144:
list_statistics
Deleted line 161:
nh_enable_rtpp
Added lines 181-200:
....
@]

!!!!list_statistics
Prints a list of all available statistics in the current configuration of OpenSIPS

Examples of usage:
[@
# opensipsctl fifo list_statistics
shmem:total_size:: incremental
shmem:used_size:: incremental
shmem:real_used_size:: incremental
shmem:max_used_size:: incremental
shmem:free_size:: incremental
shmem:fragments:: incremental
core:rcv_requests:: incremental
core:rcv_replies:: incremental
core:fwd_requests:: incremental
core:fwd_replies:: incremental
core:drop_requests:: incremental
August 12, 2014, at 01:23 PM by liviu -
Changed lines 32-37 from:
!!!!debug [level]
Gets or sets the value of the debug core variable. You may use it to dynamically (at runtime) change or inspect the debug level of your '''OpenSIPS'''. If no argument is passed, the function will fetch the value of the debug level.\\
'''Arguments''': debug level (-3...4)\\
'''Output''': debug level (only when no argument is passed). The value will be returned as a single MI node with name "DEBUG"

to:
!!!!debug [level] [pid]
Get or set the logging level of one or all OpenSIPS processes. If no argument is passed to the '''debug''' command, it will print a table with the current logging levels of all processes. If a logging '''level''' is given, it will be set for each process. If '''pid''' is given, the logging level will be changed only for that process.
'''Arguments''':
* debug level (-3...4)
* Unix pid (validated by OpenSIPS)
Changed lines 41-43 from:
DEBUG:: 4
to:
Process:: PID=10670 Debug=2 Type=attendant
Process:: PID=10672 Debug=3 Type=MI FIFO
Process:: PID=10673 Debug=1 Type=SIP receiver udp:193.068.3.033:5060
Added lines 45-47:
New global debug:: 1
# opensipsctl fifo debug 4 10670
New debug:: 4
March 20, 2014, at 08:55 PM by razvancrainea -
Added lines 1-284:
!!!!!Documentation -> [[Documentation.Manuals|Manuals]] -> [[Documentation.Manual-3-0|Manual 3.0]] -> Core MI Functions
(:title Core MI Functions - 3.0:)
----
(:allVersions Interface-CoreMI 3.0:)

\\

|| %color=#185662%[+'''Core MI Functions v3.0 '''+]%% ||

||[[Interface-MI-3-0|Prev]] || [[Interface-Events-3-0|Next]]||
----

(:toc-float Table of Content:)

MI (management interface) functions which are exported by '''OpenSIPS''' core.

!!!!arg
Returns the full list of arguments used when '''OpenSIPS''' was started. As in UNIX, the first argument is the name of executable binary.\\
'''Arguments''': none\\
'''Output''': multiple MI nodes where each node contains an argument. The MI nodes have no name, but only value.

Example of usage:
[@
# opensipsctl fifo arg
./opensips
-f
/etc/openser/test.cfg

@]


!!!!debug [level]
Gets or sets the value of the debug core variable. You may use it to dynamically (at runtime) change or inspect the debug level of your '''OpenSIPS'''. If no argument is passed, the function will fetch the value of the debug level.\\
'''Arguments''': debug level (-3...4)\\
'''Output''': debug level (only when no argument is passed). The value will be returned as a single MI node with name "DEBUG"


Examples of usage:
[@
# opensipsctl fifo debug
DEBUG:: 4
# opensipsctl fifo debug 1
@]


!!!!kill
The command will terminate '''OpenSIPS''' (and internal shutdown).\\
'''Arguments''': none\\
'''Output''': none

Examples of usage:
[@
# opensipsctl fifo kill
@]

!!!!list_blacklists
The command lists all the defined (static or learned) blacklists from '''OpenSIPS'''.\\
'''Arguments''': none\\
'''Output''': an MI tree - first level (nodes named "List") will describe the list (name, owner, flags); Second level (nodes named "Rules) will describe the rules (blacklists) for each list (IP/mask, protocol, port, matching regexp, flags)

Examples of usage:
[@
# opensipsctl fifo list_blacklists
@]

!!!!list_tcp_conns
The command lists all ongoing TCP/TLS connection from '''OpenSIPS'''.\\
'''Arguments''': none\\
'''Output''': an MI tree - one record per connection with the following attributes : ID, state, proto, source, destination, timeout, lifetime

Examples of usage:
[@
# opensipsctl fifo list_tcp_conns
@]

!!!!ps
The command will list all all '''OpenSIPS''' processes, along with type and description.\\
'''Arguments''': none\\
'''Output''': multiple MI nodes (named "Process") - each node contains process ID (internal), PID (OS), Type and description

Examples of usage:
[@
# opensipsctl fifo ps
Process:: ID=0 PID=16224 Type=attendant
Process:: ID=1 PID=16225 Type=SIP receiver udp:193.068.1.2:5060
Process:: ID=2 PID=16226 Type=timer
Process:: ID=3 PID=16227 Type=MI FIFO
Process:: ID=4 PID=16228 Type=TCP receiver
Process:: ID=5 PID=16230 Type=TCP main
@]

!!!!pwd
Prints the working directory of '''OpenSIPS''' instance.\\
'''Arguments''': none\\
'''Output''': a single MI node with name "WD" containing the working directory full path.


Examples of usage:
[@
# opensipsctl fifo pwd
WD:: /
@]

!!!!uptime
Prints various time information about '''OpenSIPS''' - when it started to run, for how long it runs.\\
'''Arguments''': none\\
'''Output''': three MI nodes: "Now" - current time; "Up since" - start time ; "Up time" - number of seconds since started.


Examples of usage:
[@
# opensipsctl fifo uptime
Now:: Mon Jul 21 17:41:03 2008
Up since:: Mon Jul 21 17:36:33 2008
Up time:: 270 [sec]
@]

!!!!version
Prints the version string of a running'''OpenSIPS'''.\\
'''Arguments''': none\\
'''Output''': one MI node (named "Server") containing the version string.

Examples of usage:
[@
# opensipsctl fifo version
Server:: OpenSIPS (1.4.0dev14-notls (i386/linux))
@]


!!!!which
Prints all available MI commands from the queried '''OpenSIPS'''instance.\\
'''Arguments''': none\\
'''Output''': multiple MI nodes (no name), each node containing (as value) the name of an available MI command. NOTE that the list of available MI commands may differ depending of what modules your '''OpenSIPS''' is using.

Examples of usage:
[@
# opensipsctl fifo which
get_statistics
reset_statistics
uptime
version
pwd
arg
which
ps
kill
debug
list_blacklists
ul_rm
ul_rm_contact
ul_dump
ul_flush
ul_add
ul_show_contact
nh_enable_ping
nh_enable_rtpp
@]

!!!!get_statistics
Prints the statistics (all, group or one) realtime values.\\
'''Arguments''': input may be "all" - print all available statistics; "group:" - print only statistics from a certain group; "name" - print only this statistic. The '''OpenSIPS''' core defines the following groups: ''core'', ''shmem''; Modules export groups typically named like the module itself.\\
'''Output''': list of MI nodes (no name) - each MI mode contains the name and value of a single statistic variable.

Examples of usage:
[@
# opensipsctl fifo get_statistics rcv_requests
core:rcv_requests = 35243
# opensipsctl fifo get_statistics shmem:
shmem:total_size = 33554432
shmem:used_size = 1686952
shmem:real_used_size = 1704592
shmem:max_used_size = 1704592
shmem:free_size = 31849840
shmem:fragments = 1
# opensipsctl fifo get_statistics all
....
@]

!!!!reset_statistics
Reset (to zero) the value of a statistic variable. Note that not all variables allow reset (depending of the nature of the information they carry - example "shmem:used_size").\\
'''Arguments''': name of the variable to be reset.\\
'''Output''': none.

Examples of usage:
[@
# opensipsctl fifo get_statistics received_replies
core:received_replies = 14543
# opensipsctl fifo reset_statistics received_replies
# opensipsctl fifo get_statistics received_replies
core:received_replies = 0
@]


!!!!cache_store
This command stores in a cache system a string value.\\
'''Arguments''': \\
- cache system to use - for the cache system implemented by '''OpenSIPS''' module 'localcache' the value of this parameter should be 'local' \\
- the label to be associated with this value \\
- the string to be stored \\
'''Output''': none. \\

Examples of usage:
[@
# opensipsctl fifo cache_store local password_user1 password
@]

!!!!cache_fetch
This command queries for a stored value.\\
'''Arguments''': \\
- cache system to use - for the cache system implemented by '''OpenSIPS''' module 'localcache' the value of this parameter should be 'local' \\
- the label associated with the value \\
'''Output''': MI tree containing the value if a record is found or 'Value not found' string otherwise.\\

Examples of usage:
[@
# opensipsctl fifo cache_fetch local password_user1
@]

!!!!cache_remove
This command removes a record from the cache system.\\
'''Arguments''': \\
- cache system to use\\
- the label associated with the stored value \\
'''Output''': None.\\
Examples of usage:
[@
# opensipsctl fifo cache_remove local password_user1
@]

[[#event_subscribe]]
!!!!event_subscribe
Subscribes an external application to a certain event.\\
'''Arguments''': \\
- event name\\
- external application socket \\
- expire time, in seconds - if absent, the subscription is valid only one hour (3600 s)\\
'''Output''': None.\\
Examples of usage:
[@
# opensipsctl fifo event_subscribe E_PIKE_BLOCKED udp:127.0.0.1:8888 1200
@]

!!!!events_list
Lists all the events published through the Event Interface.\\
'''Arguments''': None. \\
'''Output''': None.\\
Examples of usage:
[@
# opensipsctl fifo events_list
Event:: E_CORE_THRESHOLD id=0
Event:: E_RTPPROXY_STATUS id=1
Event:: E_PIKE_BLOCKED id=2

@]

!!!!subscribers_list
Lists information about the subscribers\\
'''Arguments''': \\
- event name\\
- external application socket \\
'''Output''': If no parameter is specified, then the command returns information about all events and their subscribers. If the event is specified, only the external applications subscribed for that event are returned. If the socket is also specified, only one subscriber information is returned.\\
Examples of usage:
[@
# opensipsctl fifo subscribers_list
Event:: E_CORE_THRESHOLD id=0
Event:: E_RTPPROXY_STATUS id=1
Subscriber:: socket=unix:/tmp/event.sock expire=never
Subscriber:: socket=udp:127.0.0.1:8888 expire=1100
Event:: E_PIKE_BLOCKED id=2
Subscriber:: socket=rabbitmq:guest@127.0.0.1/hello expire=never

# opensipsctl fifo subscribers_list E_RTPPROXY_STATUS
Event:: E_RTPPROXY_STATUS id=1
Subscriber:: socket=unix:/tmp/event.sock expire=never
Subscriber:: socket=udp:127.0.0.1:8888 expire=1100

# opensipsctl fifo subscribers_list E_RTPPROXY_STATUS unix:/tmp/event.sock
Event:: E_RTPPROXY_STATUS id=1
Subscriber:: socket=unix:/tmp/event.sock expire=never
@]

----

(:commentboxchrono:)

Page last modified on November 26, 2020, at 02:34 PM