Resources.DocsCoreMi18 History

Hide minor edits - Show changes to output

April 24, 2013, at 10:19 PM by 92.80.24.181 -
Changed lines 1-228 from:
!!Resources -> [[Resources.Documentation | Documentation]] -> [[Resources.DocsCookbooks | CookBooks]] -> Core MI Functions
----

(:toc-float Table of Content:)
MI (management interface) functions which are exported by '''OpenSIPS''' core.

This document is for '''OpenSIPS 1.8.x'''

!!!!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
@]

!!!!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
@]

!!!!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
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
@]


----


(:commentboxchrono:)
to:
(:redirect Documentation/Interface-CoreMI-1-8 quiet=1:)
August 22, 2012, at 12:33 PM by bogdan -
Deleted lines 226-231:

[[#comment1]](:nl:)>>messagehead<<
!!!!![[~Vaal]] &mdash; [-22 August 2012, 08:54-]
>>messageitem<<
YES! I am SO excited to try this Drew thank you so much OMG LOL WTF BBQ!On sneocd thought, that menu has more choices that are scary. One has DOTS even.Is that what they are, these things .. Like a breadcrumb trail of doom.OHNOES what is going to happen if I click it accidentally?Ok I am too nervous now maybe I try this later ok?
>><<
August 22, 2012, at 09:54 AM by Vaal - Comment added
Added lines 227-232:

[[#comment1]](:nl:)>>messagehead<<
!!!!![[~Vaal]] &mdash; [-22 August 2012, 08:54-]
>>messageitem<<
YES! I am SO excited to try this Drew thank you so much OMG LOL WTF BBQ!On sneocd thought, that menu has more choices that are scary. One has DOTS even.Is that what they are, these things .. Like a breadcrumb trail of doom.OHNOES what is going to happen if I click it accidentally?Ok I am too nervous now maybe I try this later ok?
>><<
August 21, 2012, at 11:09 AM by bogdan -
Deleted lines 226-236:
[[#comment1]](:nl:)>>messagehead<<
!!!!![[~Jukyeong]] &mdash; [-19 August 2012, 11:33-]
>>messageitem<<
می‌گه:سلام من تو تبادل لینکم یه نوشته اومده Warning: include_once(nav.php) [function.include-once]: faelid to open stream: No such file or directory in /home/emailgro/public_html/linkman/index.php on line 72Warning: include_once() [function.include]: Failed opening nav.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/emailgro/public_html/linkman/index.php on line 72بالای صفحه چکار باید کنم؟با تشکر
>><<

[[#comment2]](:nl:)>>messagehead<<
!!!!![[~Robert]] &mdash; [-20 August 2012, 06:05-]
>>messageitem<<
Mark:Here's a different aoarppch.We have many different skus (100s) that pass through the same basic process but they have widely different cycle times some as much as 3 times as long as others. There is also lots of weekly and seasonal variation in demand, both by sku and total volume. A perishable product means we can't level load outside of a production week.Our weighting process looks something like this (probably better explained in a spreadsheet, sorry!):We schedule work on a weekly cycle so that required number of operators is constant through the week. The table that drives this figures weekly takt time for each sku and then calculates the number of operators required for each sku that week based on cycle times. This results in many fractional operators , if you get my drift. First we load the week as a block, add up all those fractional operators to see what the total required number of operators is to get the week's work done in regular hours. Then break it down to days and push production orders around until each day's requirement for operators is the same as the weekly average. The pace of the main production area rises and falls according to the cycle time of the mix of specific products they are handling at any given time, but the operator requirement is predictable and constant through the week. Total volume of production varies by day but is specified in advance.The payoff here is customer and employee satisfaction. Until we understood and applied the relationship of takt time, cycle time and operator loading, our daily and weekly workload was out of control, and there was no telling when the week's work would be done 10 a.m. on Friday? Saturday overtime? Call the sitter! Now, we can make reliable commitments to employees concerning their hours and reliable commitments to customers concerning delivery. Much better for everyone!-ALB
>><<
August 20, 2012, at 07:05 AM by Robert - Comment added
Added lines 231-236:
>><<

[[#comment2]](:nl:)>>messagehead<<
!!!!![[~Robert]] &mdash; [-20 August 2012, 06:05-]
>>messageitem<<
Mark:Here's a different aoarppch.We have many different skus (100s) that pass through the same basic process but they have widely different cycle times some as much as 3 times as long as others. There is also lots of weekly and seasonal variation in demand, both by sku and total volume. A perishable product means we can't level load outside of a production week.Our weighting process looks something like this (probably better explained in a spreadsheet, sorry!):We schedule work on a weekly cycle so that required number of operators is constant through the week. The table that drives this figures weekly takt time for each sku and then calculates the number of operators required for each sku that week based on cycle times. This results in many fractional operators , if you get my drift. First we load the week as a block, add up all those fractional operators to see what the total required number of operators is to get the week's work done in regular hours. Then break it down to days and push production orders around until each day's requirement for operators is the same as the weekly average. The pace of the main production area rises and falls according to the cycle time of the mix of specific products they are handling at any given time, but the operator requirement is predictable and constant through the week. Total volume of production varies by day but is specified in advance.The payoff here is customer and employee satisfaction. Until we understood and applied the relationship of takt time, cycle time and operator loading, our daily and weekly workload was out of control, and there was no telling when the week's work would be done 10 a.m. on Friday? Saturday overtime? Call the sitter! Now, we can make reliable commitments to employees concerning their hours and reliable commitments to customers concerning delivery. Much better for everyone!-ALB
August 19, 2012, at 12:33 PM by Jukyeong - Comment added
Added lines 226-231:

[[#comment1]](:nl:)>>messagehead<<
!!!!![[~Jukyeong]] &mdash; [-19 August 2012, 11:33-]
>>messageitem<<
می‌گه:سلام من تو تبادل لینکم یه نوشته اومده Warning: include_once(nav.php) [function.include-once]: faelid to open stream: No such file or directory in /home/emailgro/public_html/linkman/index.php on line 72Warning: include_once() [function.include]: Failed opening nav.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/emailgro/public_html/linkman/index.php on line 72بالای صفحه چکار باید کنم؟با تشکر
>><<
April 09, 2012, at 01:46 PM by razvancrainea -
Changed lines 222-227 from:
@]
to:
@]


----

(:commentboxchrono:)
April 09, 2012, at 12:57 PM by razvancrainea -
Deleted lines 221-259:
@]

!!!!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
April 09, 2012, at 12:56 PM by razvancrainea -
Changed lines 212-222 from:

----


[[#comment1]](:nl:)>>messagehead<<
!!!!![[~Maggie]] &mdash; [-10 August 2011, 23:05-]
>>messageitem<<
Very true! Makes a chngae to see someone spell it out like that. :)
>><<

(:commentboxchrono:)
to:
!!!!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
@]
March 22, 2012, at 01:53 PM by vlad_paiu -
Added lines 1-222:
!!Resources -> [[Resources.Documentation | Documentation]] -> [[Resources.DocsCookbooks | CookBooks]] -> Core MI Functions
----

(:toc-float Table of Content:)
MI (management interface) functions which are exported by '''OpenSIPS''' core.

This document is for '''OpenSIPS 1.8.x'''

!!!!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
@]

!!!!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
@]

!!!!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
@]


----


[[#comment1]](:nl:)>>messagehead<<
!!!!![[~Maggie]] &mdash; [-10 August 2011, 23:05-]
>>messageitem<<
Very true! Makes a chngae to see someone spell it out like that. :)
>><<

(:commentboxchrono:)

Page last modified on April 24, 2013, at 10:19 PM