<?xml version="1.0" encoding='ISO-8859-1'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [

<!-- Include general documentation entities -->
<!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
%docentities;

]>
<!-- Module User's Guide -->

<chapter>

	<title>&adminguide;</title>

	<section>
	<title>Overview</title>
	<para>
	This module collects extensions from &kamailio; core.
	</para>
	<para>
	&kamailio; Core Cookbook is available at: &kamwikilink;
	</para>
	</section>

	<section>
	<title>Dependencies</title>
	<section>
		<title>&kamailio; Modules</title>
		<para>
		The following modules must be loaded before this module:
			<itemizedlist>
			<listitem>
			<para>
				<emphasis>No dependencies on other &kamailio; modules</emphasis>.
			</para>
			</listitem>
			</itemizedlist>
		</para>
	</section>
	<section>
		<title>External Libraries or Applications</title>
		<para>
		The following libraries or applications must be installed before running
		&kamailio; with this module loaded:
			<itemizedlist>
			<listitem>
			<para>
				<emphasis>None</emphasis>.
			</para>
			</listitem>
			</itemizedlist>
		</para>
	</section>
	</section>

	<section>
	<title>Functions</title>
		<section id="kex.f.setsflag">
		<title><function moreinfo="none">setsflag(flag)</function></title>
		<para>
			Set the script flag.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>flag</emphasis> - the index of the script flag to
				be set. Can be integer or pseudo-variable with integer value.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>setsflag</function> usage</title>
		<programlisting format="linespecific">
...
setsflag("1");
...
$var(flag) = 11;
setsflag("$var(flag)");
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.issflagset">
		<title><function moreinfo="none">issflagset(flag)</function></title>
		<para>
			Return true if the script flag is set.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>flag</emphasis> - the index of the script flag to
				be tested. Can be integer or pseudo-variable with integer value.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>issflagset</function> usage</title>
		<programlisting format="linespecific">
...
if(issflagset("1"))
{
    ...
}
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.resetsflag">
		<title><function moreinfo="none">resetsflag(flag)</function></title>
		<para>
			Reset the script flag.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>flag</emphasis> - the index of the script flag to
				be reset. Can be integer or pseudo-variable with integer value.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>resetsflag</function> usage</title>
		<programlisting format="linespecific">
...
resetsflag("1");
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.setbflag">
		<title><function moreinfo="none">setbflag(flag [, branch])</function></title>
		<para>
			Set the branch flag.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>flag</emphasis> - the index of the branch flag to
				be set. Can be integer or pseudo-variable with integer value.
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>branch</emphasis> - the index of the branch whose
				flag to be set. Can be integer or pseudo-variable with integer
				value. If omitted, then branch 0 is used (R-URI).
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>setbflag</function> usage</title>
		<programlisting format="linespecific">
...
setbflag("1");
...
$var(flag) = 11;
setbflag("$var(flag)", "1");
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.isbflagset">
		<title><function moreinfo="none">isbflagset(flag [, branch])</function></title>
		<para>
			Return true if the branch flag is set.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>flag</emphasis> - the index of the branch flag to
				be tested. Can be integer or pseudo-variable with integer value.
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>branch</emphasis> - the index of the branch whose
				flag to be set. Can be integer or pseudo-variable with integer
				value. If omitted, then branch 0 is used (R-URI).
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>isbflagset</function> usage</title>
		<programlisting format="linespecific">
...
if(isbflagset("1"))
{
    ...
}
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.resetbflag">
		<title><function moreinfo="none">resetbflag(flag [, branch])</function></title>
		<para>
			Reset the branch flag.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>flag</emphasis> - the index of the branch flag to
				be reset. Can be integer or pseudo-variable with integer value.
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>branch</emphasis> - the index of the branch whose
				flag to be set. Can be integer or pseudo-variable with integer
				value. If omitted, then branch 0 is used (R-URI).
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>resetbflag</function> usage</title>
		<programlisting format="linespecific">
...
resetbflag("1");
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.setdsturi">
		<title><function moreinfo="none">setdsturi(uri)</function></title>
		<para>
			Set the destination address URI (outbound proxy address).
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>uri</emphasis> - Valid SIP URI representing the
				address where to send the request. It must be a static string,
				no variables are evaluated at runtime. If you need to set
				outbound proxy address via a variable, use assignment to
				<emphasis>$du</emphasis>.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>setdsturi</function> usage</title>
		<programlisting format="linespecific">
...
setdsturi("sip:10.0.0.10");
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.resetdsturi">
		<title><function moreinfo="none">resetdsturi()</function></title>
		<para>
			Reset the destination address URI (outbound proxy address).
		</para>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>resetdsturi</function> usage</title>
		<programlisting format="linespecific">
...
resetdsturi();
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.isdsturiset">
		<title><function moreinfo="none">isdsturiset()</function></title>
		<para>
			Check if the destination address URI (outbound proxy address)
			is set.
		</para>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>isdsturiset</function> usage</title>
		<programlisting format="linespecific">
...
if(isdsturiset())
{
   ...
}
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.pv_printf">
		<title><function moreinfo="none">pv_printf(var, str)</function></title>
		<para>
			Evaluates the str and sets the resulting value to variable var. For
			backward compatibility reasons, the same function can be executed via
			'avp_printf(var, str)'.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>var</emphasis> - name of a writable variable
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>str</emphasis> - string that may contain variables
				which will be evaluated at runtime.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>pv_printf</function> usage</title>
		<programlisting format="linespecific">
...
pv_printf("$ru", "sip:$rU@$fd");
pv_printf("$avp(x)", "From: $fU - To: $tU");
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.is_myself">
		<title><function moreinfo="none">is_myself(uri)</function></title>
		<para>
			Check if the parameter matches the 'myself' condition (i.e., is
			a local IP or domain). Note that if the port is missing in the URI,
			then no port matching is done (in other words, port matching is
			skipped -- it does not use default SIP ports 5060 or 5061 for
			matching).
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>uri</emphasis> - Valid SIP URI or IP address to
				check against the list of local IP addresses or domains, matching
				as well the port and protocol if they are provided.
				The parameter value can contain pseudo-variables.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>is_myself</function> usage</title>
		<programlisting format="linespecific">
...
if(is_myself("$fu")) {
    ...
}
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.is_myhost">
		<title><function moreinfo="none">is_myhost(uri)</function></title>
		<para>
			Check if the host part of the parameter matches a local domain
			or IP address.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>uri</emphasis> - Valid SIP URI, hostname of IP address to
				check against the list of local IP addresses or domains. If it
				is a SIP URI, the port and protocol are ignored.
				The parameter value can contain pseudo-variables.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>is_myhost</function> usage</title>
		<programlisting format="linespecific">
...
if(is_myhost("$tu")) {
    ...
}
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.setdebug">
		<title><function moreinfo="none">setdebug(level)</function></title>
		<para>
			Set the debug log level per process.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>level</emphasis> - the debug log level to
				be set. Can be integer or pseudo-variable with integer value.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>setdebug</function> usage</title>
		<programlisting format="linespecific">
...
setdebug("1");
...
$var(level) = 2;
setdebug("$var(level)");
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.resetdebug">
		<title><function moreinfo="none">resetdebug()</function></title>
		<para>
		Reset the local debug log level back to the value of core parameter
		'debug'.
		</para>
		<para>
		This function can be used from ANY_ROUTE.
		</para>
		<example>
		<title><function>resetdebug</function> usage</title>
		<programlisting format="linespecific">
...
resetdebug();
...
</programlisting>
		</example>
		</section>
		<section id="kex.f.km_append_branch">
		<title><function moreinfo="none">km_append_branch([uri])</function></title>
		<para>
			This function was replaced by append_branch() from corex module, starting with
			version 4.0.0.
		</para>
		</section>
	</section>

	<section>
	<title>RPC Commands</title>
	<section id="kex.r.core.aliases_list">
		<title>
		<function moreinfo="none">core.aliases_list</function>
		</title>
		<para>
		Returns the list of local SIP server host aliases.
		</para>
	</section>
	<section id="kex.r.core.arg">
		<title>
		<function moreinfo="none">core.arg</function>
		</title>
		<para>
		Print command line arguments.
		</para>
		<para>
		Name: <emphasis>core.arg</emphasis>
		</para>
		<para>Parameters: <emphasis>none</emphasis>.</para>
 		<para>
		RPC Command Format:
		</para>
		<programlisting  format="linespecific">
...
&kamcmd; core.arg
...
		</programlisting>
    </section>
	<section id="kex.r.core.echo">
		<title>
		<function moreinfo="none">core.echo</function>
		</title>
		<para>
		Returns back its parameters.
		</para>
	</section>
	<section id="kex.r.core.flags">
		<title>
		<function moreinfo="none">core.flags</function>
		</title>
		<para>
		Returns the compile flags.
		</para>
	</section>
	<section id="kex.r.core.info">
		<title>
		<function moreinfo="none">core.info</function>
		</title>
		<para>
		Verbose info, including version number, compile flags, compiler, repository, hash
		</para>
	</section>
	<section id="kex.r.core.runinfo">
		<title>
		<function moreinfo="none">core.runinfo</function>
		</title>
		<para>
		Runtime details like running version, uptime, ...
		</para>
	</section>

	<section id="kex.r.core.kill">
		<title>
		<function moreinfo="none">core.kill</function>
		</title>
		<para>
		Kill the application.
		</para>
		<para>
		Name: <emphasis>core.kill</emphasis>
		</para>
		<para>Parameters: <emphasis>none</emphasis>.</para>
 		<para>
		RPC Command Format:
		</para>
		<programlisting  format="linespecific">
...
&kamcmd; core.kill
...
		</programlisting>
    </section>
	<section id="kex.r.core.printi">
		<title>
		<function moreinfo="none">core.printi</function>
		</title>
		<para>
		Returns the integers given as parameters.
		</para>
	</section>
	<section id="kex.r.core.prints">
		<title>
		<function moreinfo="none">core.prints</function>
		</title>
		<para>
		Returns the strings given as parameters.
		</para>
	</section>
	<section id="kex.r.core.ps">
		<title>
		<function moreinfo="none">core.ps</function>
		</title>
		<para>
		Returns the description of running processes.
		</para>
	</section>
	<section id="kex.r.core.psx">
		<title>
		<function moreinfo="none">core.psx</function>
		</title>
		<para>
		Returns the detailed description of running processes.
		</para>
	</section>
	<section id="kex.r.core.pwd">
		<title>
		<function moreinfo="none">core.pwd</function>
		</title>
		<para>
		Print working directory.
		</para>
		<para>
		Name: <emphasis>core.pwd</emphasis>
		</para>
		<para>Parameters: <emphasis>none</emphasis>.</para>
 		<para>
		RPC Command Format:
		</para>
		<programlisting  format="linespecific">
...
&kamcmd; core.pwd
...
		</programlisting>
    </section>
	<section id="kex.r.core.shmmem">
		<title>
		<function moreinfo="none">core.shmmem</function>
		</title>
		<para>
		Returns shared memory info. It has an optional parameter that specifies
		the measuring unit: b - bytes (default), k or kb, m or mb, g or gb.
		Note: when using something different from bytes, the value is truncated.
		</para>
	</section>
	<section id="kex.r.core.sockets_list">
		<title>
		<function moreinfo="none">core.sockets_list</function>
		</title>
		<para>
		Returns the list of local SIP server listen sockets.
		</para>
	</section>
	<section id="kex.r.core.tcp_info">
		<title>
		<function moreinfo="none">core.tcp_info</function>
		</title>
		<para>
		Returns TCP related info.
		</para>
	</section>
	<section id="kex.r.core.tcp_list">
		<title>
		<function moreinfo="none">core.tcp_list</function>
		</title>
		<para>
		Returns TCP connections details.
		</para>
	</section>
	<section id="kex.r.core.tcp_options">
		<title>
		<function moreinfo="none">core.tcp_options</function>
		</title>
		<para>
		Returns active TCP options.
		</para>
	</section>
	<section id="kex.r.core.udp4_raw_info">
		<title>
		<function moreinfo="none">core.udp4_raw_info</function>
		</title>
		<para>
		Returns udp4_raw mode related info.
		</para>
	</section>
	<section id="kex.r.core.uptime">
		<title>
		<function moreinfo="none">core.uptime</function>
		</title>
		<para>
		Print uptime.
		</para>
		<para>
		Name: <emphasis>core.uptime</emphasis>
		</para>
		<para>Parameters: <emphasis>none</emphasis>.</para>
 		<para>
		RPC Command Format:
		</para>
		<programlisting  format="linespecific">
...
&kamcmd; core.uptime
...
		</programlisting>
    </section>
	<section id="kex.r.core.version">
		<title>
		<function moreinfo="none">core.version</function>
		</title>
		<para>
		Print version information.
		</para>
		<para>
		Name: <emphasis>core.version</emphasis>
		</para>
		<para>Parameters: <emphasis>none</emphasis>.</para>
 		<para>
		RPC Command Format:
		</para>
		<programlisting  format="linespecific">
...
&kamcmd; core.version
...
		</programlisting>
    </section>
	<section id="kex.r.core.ppdefines">
		<title>
		<function moreinfo="none">core.ppdefines</function>
		</title>
		<para>
		List preprocessor defines enabled in config.
		</para>
		<para>
		Name: <emphasis>core.ppdefines</emphasis>
		</para>
		<para>Parameters: <emphasis>none</emphasis>.</para>
		<para>
		RPC Command Format:
		</para>
		<programlisting  format="linespecific">
...
&kamcmd; core.ppdefines
...
		</programlisting>
    </section>
	<section id="kex.r.core.modules">
		<title>
		<function moreinfo="none">core.modules</function>
		</title>
		<para>
		List loaded modules in config.
		</para>
		<para>
		Name: <emphasis>core.modules</emphasis>
		</para>
		<para>Parameters: <emphasis>none</emphasis>.</para>
		<para>
		RPC Command Format:
		</para>
		<programlisting  format="linespecific">
...
&kamcmd; core.modules
...
		</programlisting>
    </section>

	<section id="kex.r.pkg.stats">
		<title>
		<function moreinfo="none">pkg.stats</function>
		</title>
		<para>
			Print private memory (pkg) usage statistics per process. It
			can take optionally a filter to print statistics only for a
			specific process or set of processes. If no filter is given,
			it prints statistics for all processes.
		</para>
		<para>The filter can be:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>pid value</emphasis> - print statistics for
				specific process pid.
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>rank value</emphasis> - print statistics for
				specific process rank.
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>index value</emphasis> - print statistics for
				specific index in process table.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		Examples:
		</para>
        <programlisting  format="linespecific">
		&kamcmd; pkg.stats
		&kamcmd; pkg.stats pid 1234
		&kamcmd; pkg.stats rank 1
		&kamcmd; pkg.stats index 10
		</programlisting>
    </section>
	<section id="kex.r.pkg.info">
		<title>
		<function moreinfo="none">pkg.info</function>
		</title>
		<para>
			Get pkg manager details.
		</para>
		<para>
		Example:
		</para>
        <programlisting  format="linespecific">
		&kamcli; rpc pkg.info
		</programlisting>
    </section>
	<section id="kex.r.stats.get_statistics">
		<title>
		<function moreinfo="none">stats.get_statistics</function>
		</title>
		<para>Print the list of available internal statistics.</para>
		<para>NOTE: the result is an array of strings that have the list of
		statistics formatted like "name = value", being propagated over the time
		from the MI variant. Use "stats.fetch" or "stats.fetchn"commands to have
		a more JSON-friendly output.</para>
		<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
		be printed. If set to 'all' then all statistics are printed; if
		set to 'statsgroup:' then all statistics in the group are printed;
		if set to 'statsname' then the statistics identified by the name
		is printed.</para>
		<para>Examples:</para>
        <programlisting  format="linespecific">
		&kamcmd; stats.get_statistics all
		&kamcmd; stats.get_statistics core:
		&kamcmd; stats.get_statistics unsupported_methods
		&kamcmd; stats.get_statistics shmem: fwd_requests fwd_replies
		</programlisting>
    </section>
	<section id="kex.r.stats.fetch">
		<title>
		<function moreinfo="none">stats.fetch</function>
		</title>
		<para>Print the list of available internal statistics with a more
		json friendly output. Each printed statistic is a field in the output
		structure: {"statsgroup.statsname" : "statsvalue"}. The value is
		represented as string to accommodate large numbers.</para>
		<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
		be printed. If set to 'all' then all statistics are printed; if
		set to 'statsgroup:' then all statistics in the group are printed;
		if set to 'statsname' then the statistics identified by the name
		is printed (can be also 'statsgroup.stastname' or
		'statsgroup:statsname').</para>
		<para>Examples:</para>
        <programlisting  format="linespecific">
		&kamcmd; stats.fetch all
		&kamcmd; stats.fetch core:
		&kamcmd; stats.fetch unsupported_methods
		&kamcmd; stats.fetch shmem.free_size
		&kamcmd; stats.fetch shmem: fwd_requests fwd_replies
		</programlisting>
	</section>
	<section id="kex.r.stats.fetchn">
		<title>
		<function moreinfo="none">stats.fetchn</function>
		</title>
		<para>Print the list of available internal statistics with a more
		json friendly output. Each printed statistic is a field in the output
		structure: {"statsgroup.statsname" : statsvalue}. The value is
		represented as number.</para>
		<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
		be printed. If set to 'all' then all statistics are printed; if
		set to 'statsgroup:' then all statistics in the group are printed;
		if set to 'statsname' then the statistics identified by the name
		is printed (can be also 'statsgroup.stastname' or
		'statsgroup:statsname').</para>
		<para>Examples:</para>
        <programlisting  format="linespecific">
		&kamcmd; stats.fetchn all
		&kamcmd; stats.fetchn core:
		&kamcmd; stats.fetchn unsupported_methods
		&kamcmd; stats.fetchn shmem.free_size
		&kamcmd; stats.fetchn shmem: fwd_requests fwd_replies
		</programlisting>
    </section>
	<section id="kex.r.stats.reset_statistics">
		<title>
		<function moreinfo="none">stats.reset_statistics</function>
		</title>
		<para>Reset internal statistics.</para>
		<para>
		Parameters: <emphasis>statsid</emphasis> - same as for get_statistics.
		</para>
		<para>Examples:</para>
        <programlisting  format="linespecific">
		&kamcmd; stats.reset_statistics all
		&kamcmd; stats.reset_statistics core:
		&kamcmd; stats.reset_statistics unsupported_methods
		&kamcmd; stats.reset_statistics shmem: fwd_requests fwd_replies
		</programlisting>
    </section>
	<section id="kex.r.stats.clear_statistics">
		<title>
		<function moreinfo="none">stats.clear_statistics</function>
		</title>
		<para>Return statistics and reset their value in one command.</para>
		<para>
		Parameters: <emphasis>statsid</emphasis> - same as for get_statistics.
		</para>
		<para>Examples:</para>
        <programlisting  format="linespecific">
		&kamcmd; stats.reset_statistics all
		&kamcmd; stats.reset_statistics core:
		&kamcmd; stats.reset_statistics unsupported_methods
		&kamcmd; stats.reset_statistics shmem: fwd_requests fwd_replies
		</programlisting>
    </section>
	<section id="kex.r.system.listMethods">
		<title>
		<function moreinfo="none">system.listMethods</function>
		</title>
		<para>
		Print list of available RPC commands.
		</para>
		<para>
		Name: <emphasis>system.listMethods</emphasis>
		</para>
		<para>Parameters: <emphasis>none</emphasis>.</para>
		<para>
		RPC Command Format:
		</para>
		<programlisting  format="linespecific">
...
&kamcmd; system.listMethods
...
		</programlisting>
    </section>
	<section id="kex.r.system.methodHelp">
		<title>
		<function moreinfo="none">system.methodHelp</function>
		</title>
		<para>
		Print the help string for given method.
		</para>
	</section>
	<section id="kex.r.system.methodSignature">
		<title>
		<function moreinfo="none">system.methodSignature</function>
		</title>
		<para>
		Returns signature of given method.
		</para>
	</section>

	<section id="kex.r.mod.mem_stats">
		<title>
		<function moreinfo="none">mod.mem_stats</function>
		</title>
		<para>
			Print private(pkg) or shared(shm) memory currently allocated a given module or by all modules.
		</para>
		<para>
			NOTE: Processing is done only when the command is issued and involves iterating
            through the list of memory fragments and printing details about them.
		</para>
		<para>
			NOTE: Only the module functions that <emphasis>directly</emphasis> calls shm_alloc or
            pkg_alloc are taken into consideration.
		</para>
		<para>The first parameter can be one of the following:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>module_name</emphasis> - print statistics for specific module. Either
				a module name (like "usrloc") or "core" for the &kamailio; core.
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>all</emphasis> - print statistics for all modules that uses memory.
			</para>
		</listitem>
		</itemizedlist>

		<para>The second parameter can be:</para>
		<itemizedlist>
		<listitem>
			<para>
				<emphasis>pkg</emphasis> - print private (process) memory statistics.
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>shm</emphasis> - print shared memory statistics.
			</para>
		</listitem>
		<listitem>
			<para>
				<emphasis>all</emphasis> - print both private and shared memory statistics.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		Examples:
		</para>
        <programlisting  format="linespecific">
		&kamcmd; mod.stats core all
		&kamcmd; mod.stats tm shm
		&kamcmd; mod.stats kex pkg
		&kamcmd; mod.stats all all
		</programlisting>
		<para>
		Output:
		</para>
        <programlisting  format="linespecific">
Module: kex
{
    // this is the pkg zone of the module
    // function_name(line_where_pkg_malloc_was_called): size_alloc'ed_by_pkg_malloc
    init_rpc_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_malloc
    pkg_proc_stats_init(79): 864
    Total: 864
}
		</programlisting>
    </section>
	<section id="kex.r.mod.stats">
		<title>
		<function moreinfo="none">mod.stats</function>
		</title>
		<para>
			Same as RPC command "mod.mem_stats", this is an alias command to
			preserve backward compatibility.
		</para>
	</section>
	<section id="kex.r.mod.mem_statsx">
		<title>
		<function moreinfo="none">mod.mem_statsx</function>
		</title>
		<para>
			Similar to RPC command "mod.mem_stats", but the output has an
			extended format, printing info that includes the allocated size
			and the count of allocated chunks in a combined string value. The
			parameters are the same like for "mod.mem_stats".
		</para>
    </section>

    </section>
</chapter>
