(core|modules/kex): improve RPC method listing
[sip-router] / src / modules / kex / doc / kex_admin.xml
1 <?xml version="1.0" encoding='ISO-8859-1'?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4
5 <!-- Include general documentation entities -->
6 <!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
7 %docentities;
8
9 ]>
10 <!-- Module User's Guide -->
11
12 <chapter>
13         
14         <title>&adminguide;</title>
15         
16         <section>
17         <title>Overview</title>
18         <para>
19         This module collects extensions from &kamailio; core.
20         </para>
21         <para>
22         &kamailio; Core Cookbook is available at: &kamwikilink;
23         </para>
24         </section>
25         
26         <section>
27         <title>Dependencies</title>
28         <section>
29                 <title>&kamailio; Modules</title>
30                 <para>
31                 The following modules must be loaded before this module:
32                         <itemizedlist>
33                         <listitem>
34                         <para>
35                                 <emphasis>No dependencies on other &kamailio; modules</emphasis>.
36                         </para>
37                         </listitem>
38                         </itemizedlist>
39                 </para>
40         </section>
41         <section>
42                 <title>External Libraries or Applications</title>
43                 <para>
44                 The following libraries or applications must be installed before running
45                 &kamailio; with this module loaded:
46                         <itemizedlist>
47                         <listitem>
48                         <para>
49                                 <emphasis>None</emphasis>.
50                         </para>
51                         </listitem>
52                         </itemizedlist>
53                 </para>
54         </section>
55         </section>
56
57         <section>
58         <title>Functions</title>
59                 <section id="kex.f.setsflag">
60                 <title><function moreinfo="none">setsflag(flag)</function></title>
61                 <para>
62                         Set the script flag.
63                 </para>
64                 <para>Meaning of the parameters is as follows:</para>
65                 <itemizedlist>
66                 <listitem>
67                         <para>
68                                 <emphasis>flag</emphasis> - the index of the script flag to
69                                 be set. Can be integer or pseudo-variable with integer value.
70                         </para>
71                 </listitem>
72                 </itemizedlist>
73                 <para>
74                 This function can be used from ANY_ROUTE.
75                 </para>
76                 <example>
77                 <title><function>setsflag</function> usage</title>
78                 <programlisting format="linespecific">
79 ...
80 setsflag("1");
81 ...
82 $var(flag) = 11;
83 setsflag("$var(flag)");
84 ...
85 </programlisting>
86                 </example>
87                 </section>
88                 <section id="kex.f.issflagset">
89                 <title><function moreinfo="none">issflagset(flag)</function></title>
90                 <para>
91                         Return true of the script flag is set.
92                 </para>
93                 <para>Meaning of the parameters is as follows:</para>
94                 <itemizedlist>
95                 <listitem>
96                         <para>
97                                 <emphasis>flag</emphasis> - the index of the script flag to
98                                 be tested. Can be integer or pseudo-variable with integer value.
99                         </para>
100                 </listitem>
101                 </itemizedlist>
102                 <para>
103                 This function can be used from ANY_ROUTE.
104                 </para>
105                 <example>
106                 <title><function>issflagset</function> usage</title>
107                 <programlisting format="linespecific">
108 ...
109 if(issflagset("1"))
110 {
111     ...
112 }
113 ...
114 </programlisting>
115                 </example>
116                 </section>
117                 <section id="kex.f.resetsflag">
118                 <title><function moreinfo="none">resetsflag(flag)</function></title>
119                 <para>
120                         Reset the script flag.
121                 </para>
122                 <para>Meaning of the parameters is as follows:</para>
123                 <itemizedlist>
124                 <listitem>
125                         <para>
126                                 <emphasis>flag</emphasis> - the index of the script flag to
127                                 be reset. Can be integer or pseudo-variable with integer value.
128                         </para>
129                 </listitem>
130                 </itemizedlist>
131                 <para>
132                 This function can be used from ANY_ROUTE.
133                 </para>
134                 <example>
135                 <title><function>resetsflag</function> usage</title>
136                 <programlisting format="linespecific">
137 ...
138 resetsflag("1");
139 ...
140 </programlisting>
141                 </example>
142                 </section>
143                 <section id="kex.f.setbflag">
144                 <title><function moreinfo="none">setbflag(flag [, branch])</function></title>
145                 <para>
146                         Set the branch flag.
147                 </para>
148                 <para>Meaning of the parameters is as follows:</para>
149                 <itemizedlist>
150                 <listitem>
151                         <para>
152                                 <emphasis>flag</emphasis> - the index of the branch flag to
153                                 be set. Can be integer or pseudo-variable with integer value.
154                         </para>
155                 </listitem>
156                 <listitem>
157                         <para>
158                                 <emphasis>branch</emphasis> - the index of the branch whose
159                                 flag to be set. Can be integer or pseudo-variable with integer
160                                 value. If omitted, then branch 0 is used (R-URI).
161                         </para>
162                 </listitem>
163                 </itemizedlist>
164                 <para>
165                 This function can be used from ANY_ROUTE.
166                 </para>
167                 <example>
168                 <title><function>setbflag</function> usage</title>
169                 <programlisting format="linespecific">
170 ...
171 setbflag("1");
172 ...
173 $var(flag) = 11;
174 setbflag("$var(flag)", "1");
175 ...
176 </programlisting>
177                 </example>
178                 </section>
179                 <section id="kex.f.isbflagset">
180                 <title><function moreinfo="none">isbflagset(flag [, branch])</function></title>
181                 <para>
182                         Return true of the branch flag is set.
183                 </para>
184                 <para>Meaning of the parameters is as follows:</para>
185                 <itemizedlist>
186                 <listitem>
187                         <para>
188                                 <emphasis>flag</emphasis> - the index of the branch flag to
189                                 be tested. Can be integer or pseudo-variable with integer value.
190                         </para>
191                 </listitem>
192                 <listitem>
193                         <para>
194                                 <emphasis>branch</emphasis> - the index of the branch whose
195                                 flag to be set. Can be integer or pseudo-variable with integer
196                                 value. If omitted, then branch 0 is used (R-URI).
197                         </para>
198                 </listitem>
199                 </itemizedlist>
200                 <para>
201                 This function can be used from ANY_ROUTE.
202                 </para>
203                 <example>
204                 <title><function>isbflagset</function> usage</title>
205                 <programlisting format="linespecific">
206 ...
207 if(isbflagset("1"))
208 {
209     ...
210 }
211 ...
212 </programlisting>
213                 </example>
214                 </section>
215                 <section id="kex.f.resetbflag">
216                 <title><function moreinfo="none">resetbflag(flag [, branch])</function></title>
217                 <para>
218                         Reset the branch flag.
219                 </para>
220                 <para>Meaning of the parameters is as follows:</para>
221                 <itemizedlist>
222                 <listitem>
223                         <para>
224                                 <emphasis>flag</emphasis> - the index of the branch flag to
225                                 be reset. Can be integer or pseudo-variable with integer value.
226                         </para>
227                 </listitem>
228                 <listitem>
229                         <para>
230                                 <emphasis>branch</emphasis> - the index of the branch whose
231                                 flag to be set. Can be integer or pseudo-variable with integer
232                                 value. If omitted, then branch 0 is used (R-URI).
233                         </para>
234                 </listitem>
235                 </itemizedlist>
236                 <para>
237                 This function can be used from ANY_ROUTE.
238                 </para>
239                 <example>
240                 <title><function>resetbflag</function> usage</title>
241                 <programlisting format="linespecific">
242 ...
243 resetbflag("1");
244 ...
245 </programlisting>
246                 </example>
247                 </section>
248                 <section id="kex.f.setdsturi">
249                 <title><function moreinfo="none">setdsturi(uri)</function></title>
250                 <para>
251                         Set the destination address URI (outbound proxy address).
252                 </para>
253                 <para>Meaning of the parameters is as follows:</para>
254                 <itemizedlist>
255                 <listitem>
256                         <para>
257                                 <emphasis>uri</emphasis> - Valid SIP URI representing the
258                                 address where to send the request. It must be a static string,
259                                 no variables are evaluated at runtime. If you need to set
260                                 outbound proxy address via a variable, use assginment to
261                                 <emphasis>$du</emphasis>.
262                         </para>
263                 </listitem>
264                 </itemizedlist>
265                 <para>
266                 This function can be used from ANY_ROUTE.
267                 </para>
268                 <example>
269                 <title><function>setdsturi</function> usage</title>
270                 <programlisting format="linespecific">
271 ...
272 setdsturi("sip:10.0.0.10");
273 ...
274 </programlisting>
275                 </example>
276                 </section>
277                 <section id="kex.f.resetdsturi">
278                 <title><function moreinfo="none">resetdsturi()</function></title>
279                 <para>
280                         Reset the destination address URI (outbound proxy address).
281                 </para>
282                 <para>
283                 This function can be used from ANY_ROUTE.
284                 </para>
285                 <example>
286                 <title><function>resetdsturi</function> usage</title>
287                 <programlisting format="linespecific">
288 ...
289 resetdsturi();
290 ...
291 </programlisting>
292                 </example>
293                 </section>
294                 <section id="kex.f.isdsturiset">
295                 <title><function moreinfo="none">isdsturiset()</function></title>
296                 <para>
297                         Check if the destination address URI (outbound proxy address)
298                         is set.
299                 </para>
300                 <para>
301                 This function can be used from ANY_ROUTE.
302                 </para>
303                 <example>
304                 <title><function>isdsturiset</function> usage</title>
305                 <programlisting format="linespecific">
306 ...
307 if(isdsturiset())
308 {
309    ...
310 }
311 ...
312 </programlisting>
313                 </example>
314                 </section>
315                 <section id="kex.f.pv_printf">
316                 <title><function moreinfo="none">pv_printf(var, str)</function></title>
317                 <para>
318                         Evalues the str and sets the resulting value to variable var. For
319                         backward compatibility reasons, the same function can be executed via
320                         'avp_printf(var, str)'.
321                 </para>
322                 <para>Meaning of the parameters is as follows:</para>
323                 <itemizedlist>
324                 <listitem>
325                         <para>
326                                 <emphasis>var</emphasis> - name of a writable variable
327                         </para>
328                 </listitem>
329                 <listitem>
330                         <para>
331                                 <emphasis>str</emphasis> - string that may contain variables
332                                 which will be evaluated at runtime.
333                         </para>
334                 </listitem>
335                 </itemizedlist>
336                 <para>
337                 This function can be used from ANY_ROUTE.
338                 </para>
339                 <example>
340                 <title><function>pv_printf</function> usage</title>
341                 <programlisting format="linespecific">
342 ...
343 pv_printf("$ru", "sip:$rU@$fd");
344 pv_printf("$avp(x)", "From: $fU - To: $tU");
345 ...
346 </programlisting>
347                 </example>
348                 </section>
349                 <section id="kex.f.is_myself">
350                 <title><function moreinfo="none">is_myself(uri)</function></title>
351                 <para>
352                         Check if the parameter matches the 'myself' condition (i.e., is
353                         a local IP or domain).
354                 </para>
355                 <para>Meaning of the parameters is as follows:</para>
356                 <itemizedlist>
357                 <listitem>
358                         <para>
359                                 <emphasis>uri</emphasis> - Valid SIP URI or IP address to
360                                 check against the list of local IP addresses or domains.
361                                 The parameter value can contain pseudo-variables.
362                         </para>
363                 </listitem>
364                 </itemizedlist>
365                 <para>
366                 This function can be used from ANY_ROUTE.
367                 </para>
368                 <example>
369                 <title><function>is_myself</function> usage</title>
370                 <programlisting format="linespecific">
371 ...
372 if(is_myself("$fu")) {
373     ...
374 }
375 ...
376 </programlisting>
377                 </example>
378                 </section>
379                 <section id="kex.f.setdebug">
380                 <title><function moreinfo="none">setdebug(level)</function></title>
381                 <para>
382                         Set the debug log level per process.
383                 </para>
384                 <para>Meaning of the parameters is as follows:</para>
385                 <itemizedlist>
386                 <listitem>
387                         <para>
388                                 <emphasis>level</emphasis> - the debug log level to
389                                 be set. Can be integer or pseudo-variable with integer value.
390                         </para>
391                 </listitem>
392                 </itemizedlist>
393                 <para>
394                 This function can be used from ANY_ROUTE.
395                 </para>
396                 <example>
397                 <title><function>setdebug</function> usage</title>
398                 <programlisting format="linespecific">
399 ...
400 setdebug("1");
401 ...
402 $var(level) = 2;
403 setdebug("$var(level)");
404 ...
405 </programlisting>
406                 </example>
407                 </section>
408                 <section id="kex.f.resetdebug">
409                 <title><function moreinfo="none">resetdebug()</function></title>
410                 <para>
411                 Reset the local debug log level back to the value of core parameter
412                 'debug'.
413                 </para>
414                 <para>
415                 This function can be used from ANY_ROUTE.
416                 </para>
417                 <example>
418                 <title><function>resetdebug</function> usage</title>
419                 <programlisting format="linespecific">
420 ...
421 resetdebug();
422 ...
423 </programlisting>
424                 </example>
425                 </section>
426                 <section id="kex.f.km_append_branch">
427                 <title><function moreinfo="none">km_append_branch([uri])</function></title>
428                 <para>
429                         This function was replaced by append_branch() from corex module, starting with
430                         version 4.0.0.
431                 </para>
432                 </section>
433         </section>
434
435         <section>
436         <title>RPC Commands</title>
437         <section id="kex.r.core.aliases_list">
438                 <title>
439                 <function moreinfo="none">core.aliases_list</function>
440                 </title>
441                 <para>
442                 Returns the list of local SIP server host aliases.
443                 </para>
444         </section>
445         <section id="kex.r.core.arg">
446                 <title>
447                 <function moreinfo="none">core.arg</function>
448                 </title>
449                 <para>
450                 Print command line arguments.
451                 </para>
452                 <para>
453                 Name: <emphasis>core.arg</emphasis>
454                 </para>
455                 <para>Parameters: <emphasis>none</emphasis>.</para>
456                 <para>
457                 RPC Command Format:
458                 </para>
459                 <programlisting  format="linespecific">
460 ...
461 &kamcmd; core.arg
462 ...
463                 </programlisting>
464     </section>
465         <section id="kex.r.core.echo">
466                 <title>
467                 <function moreinfo="none">core.echo</function>
468                 </title>
469                 <para>
470                 Returns back its parameters.
471                 </para>
472         </section>
473         <section id="kex.r.core.flags">
474                 <title>
475                 <function moreinfo="none">core.flags</function>
476                 </title>
477                 <para>
478                 Returns the compile flags.
479                 </para>
480         </section>
481         <section id="kex.r.core.info">
482                 <title>
483                 <function moreinfo="none">core.info</function>
484                 </title>
485                 <para>
486                 Verbose info, including version number, compile flags, compiler, repository, hash
487                 </para>
488         </section>
489         <section id="kex.r.core.kill">
490                 <title>
491                 <function moreinfo="none">core.kill</function>
492                 </title>
493                 <para>
494                 Kill the application.
495                 </para>
496                 <para>
497                 Name: <emphasis>core.kill</emphasis>
498                 </para>
499                 <para>Parameters: <emphasis>none</emphasis>.</para>
500                 <para>
501                 RPC Command Format:
502                 </para>
503                 <programlisting  format="linespecific">
504 ...
505 &kamcmd; core.kill
506 ...
507                 </programlisting>
508     </section>
509         <section id="kex.r.core.printi">
510                 <title>
511                 <function moreinfo="none">core.printi</function>
512                 </title>
513                 <para>
514                 Returns the integers given as parameters.
515                 </para>
516         </section>
517         <section id="kex.r.core.prints">
518                 <title>
519                 <function moreinfo="none">core.prints</function>
520                 </title>
521                 <para>
522                 Returns the strings given as parameters.
523                 </para>
524         </section>
525         <section id="kex.r.core.ps">
526                 <title>
527                 <function moreinfo="none">core.ps</function>
528                 </title>
529                 <para>
530                 Returns the description of running processes.
531                 </para>
532         </section>
533         <section id="kex.r.core.psx">
534                 <title>
535                 <function moreinfo="none">core.psx</function>
536                 </title>
537                 <para>
538                 Returns the detailed description of running processes.
539                 </para>
540         </section>
541         <section id="kex.r.core.pwd">
542                 <title>
543                 <function moreinfo="none">core.pwd</function>
544                 </title>
545                 <para>
546                 Print working directory.
547                 </para>
548                 <para>
549                 Name: <emphasis>core.pwd</emphasis>
550                 </para>
551                 <para>Parameters: <emphasis>none</emphasis>.</para>
552                 <para>
553                 RPC Command Format:
554                 </para>
555                 <programlisting  format="linespecific">
556 ...
557 &kamcmd; core.pwd
558 ...
559                 </programlisting>
560     </section>
561         <section id="kex.r.core.shmem">
562                 <title>
563                 <function moreinfo="none">core.shmem</function>
564                 </title>
565                 <para>
566                 Returns shared memory info. It has an optional parameter that specifies
567                 the measuring unit: b - bytes (default), k or kb, m or mb, g or gb.
568                 Note: when using something different from bytes, the value is truncated.
569                 </para>
570         </section>
571         <section id="kex.r.core.sockets_list">
572                 <title>
573                 <function moreinfo="none">core.sockets_list</function>
574                 </title>
575                 <para>
576                 Returns the list of local SIP server listen sockets.
577                 </para>
578         </section>
579         <section id="kex.r.core.tcp_info">
580                 <title>
581                 <function moreinfo="none">core.tcp_info</function>
582                 </title>
583                 <para>
584                 Returns TCP related info.
585                 </para>
586         </section>
587         <section id="kex.r.core.tcp_list">
588                 <title>
589                 <function moreinfo="none">core.tcp_list</function>
590                 </title>
591                 <para>
592                 Returns TCP connections details.
593                 </para>
594         </section>
595         <section id="kex.r.core.tcp_options">
596                 <title>
597                 <function moreinfo="none">core.tcp_options</function>
598                 </title>
599                 <para>
600                 Returns active TCP options.
601                 </para>
602         </section>
603         <section id="kex.r.core.udp4_raw_info">
604                 <title>
605                 <function moreinfo="none">core.udp4_raw_info</function>
606                 </title>
607                 <para>
608                 Returns udp4_raw mode related info.
609                 </para>
610         </section>
611         <section id="kex.r.core.uptime">
612                 <title>
613                 <function moreinfo="none">core.uptime</function>
614                 </title>
615                 <para>
616                 Print uptime.
617                 </para>
618                 <para>
619                 Name: <emphasis>core.uptime</emphasis>
620                 </para>
621                 <para>Parameters: <emphasis>none</emphasis>.</para>
622                 <para>
623                 RPC Command Format:
624                 </para>
625                 <programlisting  format="linespecific">
626 ...
627 &kamcmd; core.uptime
628 ...
629                 </programlisting>
630     </section>
631         <section id="kex.r.core.version">
632                 <title>
633                 <function moreinfo="none">core.version</function>
634                 </title>
635                 <para>
636                 Print version information.
637                 </para>
638                 <para>
639                 Name: <emphasis>core.version</emphasis>
640                 </para>
641                 <para>Parameters: <emphasis>none</emphasis>.</para>
642                 <para>
643                 RPC Command Format:
644                 </para>
645                 <programlisting  format="linespecific">
646 ...
647 &kamcmd; core.version
648 ...
649                 </programlisting>
650     </section>
651
652         <section id="kex.r.pkg.stats">
653                 <title>
654                 <function moreinfo="none">pkg.stats</function>
655                 </title>
656                 <para>
657                         Print private memory (pkg) usage statistics per process. It
658                         can take optinally a filter to print statistics only for a
659                         specific process or set of processes. If no filter is given,
660                         it prints statistics for all processes.
661                 </para>
662                 <para>The filter can be:</para>
663                 <itemizedlist>
664                 <listitem>
665                         <para>
666                                 <emphasis>pid value</emphasis> - print statistics for
667                                 specific process pid.
668                         </para>
669                 </listitem>
670                 <listitem>
671                         <para>
672                                 <emphasis>rank value</emphasis> - print statistics for
673                                 specific process rank.
674                         </para>
675                 </listitem>
676                 <listitem>
677                         <para>
678                                 <emphasis>index value</emphasis> - print statistics for
679                                 specific index in process table.
680                         </para>
681                 </listitem>
682                 </itemizedlist>
683                 <para>
684                 Examples:
685                 </para>
686         <programlisting  format="linespecific">
687                 &kamcmd; pkg.stats
688                 &kamcmd; pkg.stats pid 1234
689                 &kamcmd; pkg.stats rank 1
690                 &kamcmd; pkg.stats index 10
691                 </programlisting>
692     </section>
693         <section id="kex.r.stats.get_statistics">
694                 <title>
695                 <function moreinfo="none">stats.get_statistics</function>
696                 </title>
697                 <para>Print the list of available internal statistics.</para>
698                 <para>Parameters: <emphasis>statsid</emphasis> - which statistics to
699                         be printed. If set to 'all' then all statistics are printed; if
700                         set to 'statsgroup:' then all statistics in the group are printed;
701                         if set to 'statsname' then the statistics identified by the name
702                         is printed.</para>
703                 <para>Examples:</para>
704         <programlisting  format="linespecific">
705                 &kamcmd; stats.get_statistics all
706                 &kamcmd; stats.get_statistics core:
707                 &kamcmd; stats.get_statistics unsupported_methods
708                 &kamcmd; stats.get_statistics shmem: fwd_requests fwd_replies
709                 </programlisting>
710     </section>
711         <section id="kex.r.stats.reset_statistics">
712                 <title>
713                 <function moreinfo="none">stats.reset_statistics</function>
714                 </title>
715                 <para>Reset internal statistics.</para>
716                 <para>
717                 Parameters: <emphasis>statsid</emphasis> - same as for get_statistics.
718                 </para>
719                 <para>Examples:</para>
720         <programlisting  format="linespecific">
721                 &kamcmd; stats.reset_statistics all
722                 &kamcmd; stats.reset_statistics core:
723                 &kamcmd; stats.reset_statistics unsupported_methods
724                 &kamcmd; stats.reset_statistics shmem: fwd_requests fwd_replies
725                 </programlisting>
726     </section>
727         <section id="kex.r.stats.clear_statistics">
728                 <title>
729                 <function moreinfo="none">stats.clear_statistics</function>
730                 </title>
731                 <para>Return statistics and reset their value in one command.</para>
732                 <para>
733                 Parameters: <emphasis>statsid</emphasis> - same as for get_statistics.
734                 </para>
735                 <para>Examples:</para>
736         <programlisting  format="linespecific">
737                 &kamcmd; stats.reset_statistics all
738                 &kamcmd; stats.reset_statistics core:
739                 &kamcmd; stats.reset_statistics unsupported_methods
740                 &kamcmd; stats.reset_statistics shmem: fwd_requests fwd_replies
741                 </programlisting>
742     </section>
743         <section id="kex.r.system.listMethods">
744                 <title>
745                 <function moreinfo="none">system.listMethods</function>
746                 </title>
747                 <para>
748                 Print list of available RPC commands.
749                 </para>
750                 <para>
751                 Name: <emphasis>system.listMethods</emphasis>
752                 </para>
753                 <para>Parameters: <emphasis>none</emphasis>.</para>
754                 <para>
755                 RPC Command Format:
756                 </para>
757                 <programlisting  format="linespecific">
758 ...
759 &kamcmd; system.listMethods
760 ...
761                 </programlisting>
762     </section>
763         <section id="kex.r.system.methodHelp">
764                 <title>
765                 <function moreinfo="none">system.methodHelp</function>
766                 </title>
767                 <para>
768                 Print the help string for given method.
769                 </para>
770         </section>
771         <section id="kex.r.system.methodSignature">
772                 <title>
773                 <function moreinfo="none">system.methodSignature</function>
774                 </title>
775                 <para>
776                 Returns signature of given method.
777                 </para>
778         </section>
779
780         <section id="kex.r.mod.stats">
781                 <title>
782                 <function moreinfo="none">mod.stats module_name/all pkg/shm/all</function>
783                 </title>
784                 <para>
785                         Print private(pkg) or shared(shm) memory currently allocated a given module or by all modules.
786                 </para>
787                 <para>
788                         NOTE: Processing is done only when the command is issued and involves iterating
789             throug the list of memory fragments and printing details about them.
790                 </para>
791                 <para>
792                         NOTE: Only the module functions that <emphasis>directly</emphasis> calls shm_alloc or
793             pkg_alloc are taken into consideration.
794                 </para>
795                 <para>The first parameter can be one of the following:</para>
796                 <itemizedlist>
797                 <listitem>
798                         <para>
799                                 <emphasis>module_name</emphasis> - print statistics for specific module. Either 
800                                 a module name (like "usrloc") or "core" for the &kamailio; core.
801                         </para>
802                 </listitem>
803                 <listitem>
804                         <para>
805                                 <emphasis>all</emphasis> - print statistics for all modules that uses memory.
806                         </para>
807                 </listitem>
808                 </itemizedlist>
809
810                 <para>The second parameter can be:</para>
811                 <itemizedlist>
812                 <listitem>
813                         <para>
814                                 <emphasis>pkg</emphasis> - print private (process) memory statistics.
815                         </para>
816                 </listitem>
817                 <listitem>
818                         <para>
819                                 <emphasis>shm</emphasis> - print shared memory statistics.
820                         </para>
821                 </listitem>
822                 <listitem>
823                         <para>
824                                 <emphasis>all</emphasis> - print both private and shared memory statistics.
825                         </para>
826                 </listitem>
827                 </itemizedlist>
828                 <para>
829                 Examples:
830                 </para>
831         <programlisting  format="linespecific">
832                 &kamcmd; mod.stats core all
833                 &kamcmd; mod.stats userblacklist shm
834                 &kamcmd; mod.stats kex pkg
835                 &kamcmd; mod.stats all all
836                 </programlisting>
837                 <para>
838                 Output:
839                 </para>
840         <programlisting  format="linespecific">
841 Module: kex
842 {
843     // this is the pkg zone of the module
844     // function_name(line_where_pkg_malloc_was_called): size_alloc'ed_by_pkg_malloc
845     init_rpc_uptime(74): 56
846     Total: 56
847 }
848 {
849     // this is the shm zone of the module
850     // function_name(line_where_shm_malloc_was_called): size_alloc'ed_by_shm_malloc
851     pkg_proc_stats_init(79): 864
852     Total: 864
853 }
854                 </programlisting>
855     </section>
856     </section>
857 </chapter>
858