Currently you are not logged in.

 Login | Register 

Main

Resources

Training

Events

Development

Resources -> Documentation -> CookBooks -> Core MI Functions v1.5


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

This document is for OpenSIPS 1.5.x

1. 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

2. 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

3. kill

The command will terminate OpenSIPS (and internal shutdown).
Arguments: none
Output: none

Examples of usage:

    # opensipsctl fifo kill

4. 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

5. 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:192.168.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

6. 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:: /

7. 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]

8. version

Prints the version string of a runningOpenSIPS.
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))

9. which

Prints all available MI commands from the queried OpenSIPSinstance.
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

10. 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
    ....

11. 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

12. 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

13. 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

14. 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

14.1 Comments

Andreas Sikkema?29 September 2009, 13:39

The examples for cache-* are not complete and will not wok as is. The need a parameter to tell the fucntion which cache store should be used.

  1. opensipsctl fifo cache_remove password_user1

should be (for example)

  1. opensipsctl fifo cache_remove local password_user1

[By Bogdan] Thank you Andreas, I made the fix in the docs

Add Comment 
Sign as Author 
Enter code 106

Your VoIP Account

News

OpenSIPS Getting Started

21st of April 2012 OpenSIPS Getting Started Video Tutorial about how to do an installation of OpenSIPS and OpenSIPS-CP...
Watch it now...

OpenSIPS Devel Course

12th of April 2012 Learn about OpenSIPS internals both core and modules...
Read more...

OpenSIPS 1.8.0

22nd of March 2012 OpenSIPS 1.8.0 major release ready...
Read more...

Dynamic Routing

20th of March 2012 Enhancements of DR engine...
Read more...

APT repository

23nd of February 2012 New official APT repository for Debian & Ubuntu
Read more...

OpenSIPS 1.7.2

22nd of February 2012 OpenSIPS 1.7.2 minor release out...
Read more...

SIP Validation Support

20th of February 2012 Prevent malformed SIP messages from propagating through your network
Read more...

DNS Caching Support

13th of February 2012 Cache system for all types of DNS records
Read more...

Distributed Dialog Profiles

9th of February 2012 Shared dialog profiles between multiple instances of OpenSIPS
Read more...

Configuration and Scripting Tool

19th of January 2012 Graphical Configuration and Scripting Tool for OpenSIPS
Read more...

Cassandra driver

05th of January 2012 Cassandra backend for OpenSIPS
Read more...

LUA integration

05th of January 2012 Using LUA scripting with OpenSIPS
Read more...

OpenSIPS Pavilion @ ITExpo 2012

22th of December 2011 OpenSIPS Pavilion booth #535, 1-3 Feb 2012
Read more...

OpenSIPS and HOMER

14th of December 2011 Distributed SIPtracing and SIPcapturing
Read more...

OpenSIPS eBootcamp

12th of December 2011 New Ebootcamp session starting on 15th of February 2012.
Read more...

OpenSIPS 1.7.1

23rd of November 2011 OpenSIPS 1.7.1 minor release out...
Read more...

Ratelimit

3rd of November 2011 Dynamic and distributed support...
Read more...

OpenSIPS VM 1.7.0

1st of November 2011 Live Virtual Machine for OpenSIPS 1.7...
Read more...

MI via HTTP

25th of October 2011 Bultin HTTP server for MI...
Read more...

Events via RabbitMQ

12th of October 2011 Event Interface can push events via RabbitMQ...
Read more...

Key-Value Cache/DBs

6th of October 2011 Script and module support for key-value oriented backend...
Read more...

GRUU support

4th of October 2011 OpenSIPS registrar with GRUU / RFC5627...
Read more...

OpenSIPS 1.8.0 preview

30th of September 2011 What is set to be done for OpenSIPS 1.8.0...
Read more...

OpenSIPS eBootcamp

28th of July 2011 New Ebootcamp session starting on 19th of September.
Read more...

OpenSIPS 1.7.0

12nd of July 2011 OpenSIPS 1.7.0 major release ready...
Read more...

ClueCon 2011

11th of July 2011 Talks and one-day free training
Read more...

New in 1.7.0

6th of July 2011 What is new in OpenSIPS 1.7.0
Read more...

SVN Freeze

30th of June 2011 Testing phase started for 1.7 release
Read more...

Topology Hiding

30th of June 2011 Topology Hiding based on dialog module
Read more...

New AVP naming

23rd of June 2011 A simpler and more efficient way of naming AVPs
Read more...

DB Optimization

22nd of June 2011 Multi-row DB insert operations.
Read more...

Event Notification Interface

26th of May 2011 External interaction via the Event Interface.
Read more...

OpenSIPS eBootcamp

28th of March 2011 New Ebootcamp session starting on 2nd of May.
Read more...

UAC_REGISTRANT module

10th of March 2011 New module to allow OpenSIPS to UAC register.
Read more...

Performance degradation with complexity

08th of March 2011 Tests to show how performance is affected with complexity.
Read more...

Load and performance monitoring

22nd of February 2011 New statistics and traps for OpenSIPS monitoring.
Read more...

OpenSIPS 2.0

17th of February 2011 OpenSIPS 2.0 first code release.
Read more...

OpenSIPS Online Meeting

15th of February 2011 OpenSIPS Online Monthly Meetings started.
Read more...

OpenSIPS Social Event

24th of January 2011 OpenSIPS Social Event - Miami, 3rd of February.
Read more...

OpenSIPS eBootcamp

17th of January 2011 New Ebootcamp session starting on 28th of February.
Read more...

OpenSIPS 1.6.4

20th of December 2010 OpenSIPS 1.6.4 major release ready...
Read more...

OpenSIPS media timeout

16th of December 2010 Ghost call hunting with media timeout ...
Read more...


Edit | History | Print | Recent Changes | Search
Page last modified on May 12, 2011, at 11:30 AM