<osas@voipembedded.com.com>
- Copyright © 2009 Daniel-Constantin Mierla
+ Copyright © 2009 Daniel-Constantin Mierla
- Copyright © 2014 VoIP Embedded, Inc.
+ Copyright © 2014 VoIP Embedded, Inc.
__________________________________________________________________
Table of Contents
1. Admin Guide
- 1.1. Overview
- 1.2. Dependencies
-
- 1.2.1. Kamailio Modules
- 1.2.2. External Libraries or Applications
-
- 1.3. Functions
-
- 1.3.1. setsflag(flag)
- 1.3.2. issflagset(flag)
- 1.3.3. resetsflag(flag)
- 1.3.4. setbflag(flag [, branch])
- 1.3.5. isbflagset(flag [, branch])
- 1.3.6. resetbflag(flag [, branch])
- 1.3.7. setdsturi(uri)
- 1.3.8. resetdsturi()
- 1.3.9. isdsturiset()
- 1.3.10. pv_printf(var, str)
- 1.3.11. is_myself(uri)
- 1.3.12. setdebug(level)
- 1.3.13. resetdebug()
- 1.3.14. km_append_branch([uri])
-
- 1.4. MI Commands
-
- 1.4.1. arg
- 1.4.2. kill
- 1.4.3. pwd
- 1.4.4. uptime
- 1.4.5. version
- 1.4.6. which
- 1.4.7. get_statistics
- 1.4.8. reset_statistics
- 1.4.9. clear_statistics
-
- 1.5. RPC Commands
-
- 1.5.1. pkg.stats
- 1.5.2. stats.get_statistics
- 1.5.3. stats.reset_statistics
- 1.5.4. stats.clear_statistics
+ 1. Overview
+ 2. Dependencies
+
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
+
+ 3. Functions
+
+ 3.1. setsflag(flag)
+ 3.2. issflagset(flag)
+ 3.3. resetsflag(flag)
+ 3.4. setbflag(flag [, branch])
+ 3.5. isbflagset(flag [, branch])
+ 3.6. resetbflag(flag [, branch])
+ 3.7. setdsturi(uri)
+ 3.8. resetdsturi()
+ 3.9. isdsturiset()
+ 3.10. pv_printf(var, str)
+ 3.11. is_myself(uri)
+ 3.12. setdebug(level)
+ 3.13. resetdebug()
+ 3.14. km_append_branch([uri])
+
+ 4. MI Commands
+
+ 4.1. arg
+ 4.2. kill
+ 4.3. pwd
+ 4.4. uptime
+ 4.5. version
+ 4.6. which
+ 4.7. get_statistics
+ 4.8. reset_statistics
+ 4.9. clear_statistics
+
+ 5. RPC Commands
+
+ 5.1. pkg.stats
+ 5.2. stats.get_statistics
+ 5.3. stats.reset_statistics
+ 5.4. stats.clear_statistics
+ 5.5. mod.stats module_name/all pkg/shm/all
List of Examples
Chapter 1. Admin Guide
-1.1. Overview
+ Table of Contents
+
+ 1. Overview
+ 2. Dependencies
+
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
+
+ 3. Functions
+
+ 3.1. setsflag(flag)
+ 3.2. issflagset(flag)
+ 3.3. resetsflag(flag)
+ 3.4. setbflag(flag [, branch])
+ 3.5. isbflagset(flag [, branch])
+ 3.6. resetbflag(flag [, branch])
+ 3.7. setdsturi(uri)
+ 3.8. resetdsturi()
+ 3.9. isdsturiset()
+ 3.10. pv_printf(var, str)
+ 3.11. is_myself(uri)
+ 3.12. setdebug(level)
+ 3.13. resetdebug()
+ 3.14. km_append_branch([uri])
+
+ 4. MI Commands
+
+ 4.1. arg
+ 4.2. kill
+ 4.3. pwd
+ 4.4. uptime
+ 4.5. version
+ 4.6. which
+ 4.7. get_statistics
+ 4.8. reset_statistics
+ 4.9. clear_statistics
+
+ 5. RPC Commands
+
+ 5.1. pkg.stats
+ 5.2. stats.get_statistics
+ 5.3. stats.reset_statistics
+ 5.4. stats.clear_statistics
+ 5.5. mod.stats module_name/all pkg/shm/all
+
+1. Overview
This module collects extensions from Kamailio core.
Kamailio Core CookBook is available at: http://kamailio.org/dokuwiki/
-1.2. Dependencies
+2. Dependencies
+
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
-1.2.1. Kamailio Modules
+2.1. Kamailio Modules
The following modules must be loaded before this module:
* No dependencies on other Kamailio modules.
-1.2.2. External Libraries or Applications
+2.2. External Libraries or Applications
The following libraries or applications must be installed before
running Kamailio with this module loaded:
* None.
-1.3. Functions
-
-1.3.1. setsflag(flag)
+3. Functions
+
+ 3.1. setsflag(flag)
+ 3.2. issflagset(flag)
+ 3.3. resetsflag(flag)
+ 3.4. setbflag(flag [, branch])
+ 3.5. isbflagset(flag [, branch])
+ 3.6. resetbflag(flag [, branch])
+ 3.7. setdsturi(uri)
+ 3.8. resetdsturi()
+ 3.9. isdsturiset()
+ 3.10. pv_printf(var, str)
+ 3.11. is_myself(uri)
+ 3.12. setdebug(level)
+ 3.13. resetdebug()
+ 3.14. km_append_branch([uri])
+
+3.1. setsflag(flag)
Set the script flag.
setsflag("$var(flag)");
...
-1.3.2. issflagset(flag)
+3.2. issflagset(flag)
Return true of the script flag is set.
}
...
-1.3.3. resetsflag(flag)
+3.3. resetsflag(flag)
Reset the script flag.
resetsflag("1");
...
-1.3.4. setbflag(flag [, branch])
+3.4. setbflag(flag [, branch])
Set the branch flag.
setbflag("$var(flag)", "1");
...
-1.3.5. isbflagset(flag [, branch])
+3.5. isbflagset(flag [, branch])
Return true of the branch flag is set.
}
...
-1.3.6. resetbflag(flag [, branch])
+3.6. resetbflag(flag [, branch])
Reset the branch flag.
resetbflag("1");
...
-1.3.7. setdsturi(uri)
+3.7. setdsturi(uri)
Set the destination address URI (outbound proxy address).
setdsturi("sip:10.0.0.10");
...
-1.3.8. resetdsturi()
+3.8. resetdsturi()
Reset the destination address URI (outbound proxy address).
resetdsturi();
...
-1.3.9. isdsturiset()
+3.9. isdsturiset()
Check if the destination address URI (outbound proxy address) is set.
}
...
-1.3.10. pv_printf(var, str)
+3.10. pv_printf(var, str)
Evalues the str and sets the resulting value to variable var. For
backward compatibility reasons, the same function can be executed via
pv_printf("$avp(x)", "From: $fU - To: $tU");
...
-1.3.11. is_myself(uri)
+3.11. is_myself(uri)
Check if the parameter matches the 'myself' condition (i.e., is a local
IP or domain).
}
...
-1.3.12. setdebug(level)
+3.12. setdebug(level)
Set the debug log level per process.
setdebug("$var(level)");
...
-1.3.13. resetdebug()
+3.13. resetdebug()
Reset the local debug log level back to the value of core parameter
'debug'.
resetdebug();
...
-1.3.14. km_append_branch([uri])
+3.14. km_append_branch([uri])
This function was replaced by append_branch() from corex module,
starting with version 4.0.0.
-1.4. MI Commands
+4. MI Commands
+
+ 4.1. arg
+ 4.2. kill
+ 4.3. pwd
+ 4.4. uptime
+ 4.5. version
+ 4.6. which
+ 4.7. get_statistics
+ 4.8. reset_statistics
+ 4.9. clear_statistics
-1.4.1. arg
+4.1. arg
Print command line arguments.
:arg:_reply_fifo_file_
_empty_line_
-1.4.2. kill
+4.2. kill
Kill the application.
:kill:_reply_fifo_file_
_empty_line_
-1.4.3. pwd
+4.3. pwd
Print working directory.
:pwd:_reply_fifo_file_
_empty_line_
-1.4.4. uptime
+4.4. uptime
Print uptime.
:uptime:_reply_fifo_file_
_empty_line_
-1.4.5. version
+4.5. version
Print version information.
:version:_reply_fifo_file_
_empty_line_
-1.4.6. which
+4.6. which
Print list of available MI commands.
:which:_reply_fifo_file_
_empty_line_
-1.4.7. get_statistics
+4.7. get_statistics
Print the list of available internal statistics.
_statsid_
_empty_line_
-1.4.8. reset_statistics
+4.8. reset_statistics
Reset internal statistics.
_statsid_
_empty_line_
-1.4.9. clear_statistics
+4.9. clear_statistics
Return statistics and reset their value in one command.
_statsid_
_empty_line_
-1.5. RPC Commands
+5. RPC Commands
-1.5.1. pkg.stats
+ 5.1. pkg.stats
+ 5.2. stats.get_statistics
+ 5.3. stats.reset_statistics
+ 5.4. stats.clear_statistics
+ 5.5. mod.stats module_name/all pkg/shm/all
+
+5.1. pkg.stats
Print private memory (pkg) usage statistics per process. It can take
optinally a filter to print statistics only for a specific process or
kamcmd pkg.stats rank 1
kamcmd pkg.stats index 10
-1.5.2. stats.get_statistics
+5.2. stats.get_statistics
Print the list of available internal statistics.
kamcmd stats.get_statistics unsupported_methods
kamcmd stats.get_statistics shmem: fwd_requests fwd_replies
-1.5.3. stats.reset_statistics
+5.3. stats.reset_statistics
Reset internal statistics.
kamcmd stats.reset_statistics unsupported_methods
kamcmd stats.reset_statistics shmem: fwd_requests fwd_replies
-1.5.4. stats.clear_statistics
+5.4. stats.clear_statistics
Return statistics and reset their value in one command.
kamcmd stats.reset_statistics core:
kamcmd stats.reset_statistics unsupported_methods
kamcmd stats.reset_statistics shmem: fwd_requests fwd_replies
+
+5.5. mod.stats module_name/all pkg/shm/all
+
+ Print private(pkg) or shared(shm) memory currently allocated a given
+ module or by all modules.
+
+ NOTE: Processing is done only when the command is issued and involves
+ iterating throug the list of memory fragments and printing details
+ about them.
+
+ NOTE: Only the module functions that directly calls shm_alloc or
+ pkg_alloc are taken into consideration.
+
+ The first parameter can be one of the following:
+ * module_name - print statistics for specific module. Either a module
+ name (like "usrloc") or "core" for the Kamailio core.
+ * all - print statistics for all modules that uses memory.
+
+ The second parameter can be:
+ * pkg - print private (process) memory statistics.
+ * shm - print shared memory statistics.
+ * all - print both private and shared memory statistics.
+
+ Examples:
+ kamcmd mod.stats core all
+ kamcmd mod.stats userblacklist shm
+ kamcmd mod.stats kex pkg
+ kamcmd mod.stats all all
+
+ Output:
+Module: kex
+{
+ // this is the pkg zone of the module
+ // function_name(line_where_pkg_malloc_was_called): size_alloc'ed_by_pkg_mal
+loc
+ init_mi_uptime(74): 56
+ Total: 56
+}
+{
+ // this is the shm zone of the module
+ // function_name(line_where_shm_malloc_was_called): size_alloc'ed_by_shm_mal
+loc
+ pkg_proc_stats_init(79): 864
+ Total: 864
+}