From 25b4d2be8121cfff67013810f3dd0c124713c9de Mon Sep 17 00:00:00 2001 From: Mikko Lehto Date: Fri, 28 Jul 2017 10:50:57 +0300 Subject: [PATCH] (core|modules/kex): improve RPC method listing --- src/core/core_cmd.c | 10 +- src/modules/kex/doc/kex_admin.xml | 231 +++++++++++++++++++++++------- 2 files changed, 185 insertions(+), 56 deletions(-) diff --git a/src/core/core_cmd.c b/src/core/core_cmd.c index 096ac82db9a..f2c9a32c649 100644 --- a/src/core/core_cmd.c +++ b/src/core/core_cmd.c @@ -72,12 +72,12 @@ static const char* dns_cache_mem_info_doc[] = { 0 /* Method signature(s) */ }; static const char* dns_cache_debug_doc[] = { - "dns debug info.", /* Documentation string */ + "dns debug info.", /* Documentation string */ 0 /* Method signature(s) */ }; static const char* dns_cache_debug_all_doc[] = { - "complete dns debug dump", /* Documentation string */ + "complete dns debug dump", /* Documentation string */ 0 /* Method signature(s) */ }; @@ -196,7 +196,7 @@ static const char* dst_blst_mem_info_doc[] = { 0 /* Method signature(s) */ }; static const char* dst_blst_debug_doc[] = { - "dst blacklist debug info.", /* Documentation string */ + "dst blacklist debug info.", /* Documentation string */ 0 /* Method signature(s) */ }; static const char* dst_blst_view_doc[] = { @@ -658,7 +658,7 @@ static void core_sfmalloc(rpc_t* rpc, void* c) static const char* core_sfmalloc_doc[] = { - "Returns sfmalloc debugging info.", /* Documentation string */ + "Returns sfmalloc debugging info.", /* Documentation string */ 0 /* Method signature(s) */ }; @@ -957,7 +957,7 @@ static void core_sockets_list(rpc_t* rpc, void* c) /* - * RPC Methods exported by this module + * RPC Methods exported by core */ static rpc_export_t core_rpc_methods[] = { {"system.listMethods", system_listMethods, system_listMethods_doc, RET_ARRAY}, diff --git a/src/modules/kex/doc/kex_admin.xml b/src/modules/kex/doc/kex_admin.xml index f7750daa1a1..49414ed1a9f 100644 --- a/src/modules/kex/doc/kex_admin.xml +++ b/src/modules/kex/doc/kex_admin.xml @@ -19,9 +19,7 @@ This module collects extensions from &kamailio; core. - &kamailio; Core CookBook is available at: - - http://kamailio.org/dokuwiki/ + &kamailio; Core Cookbook is available at: &kamwikilink; @@ -436,7 +434,15 @@ resetdebug();
RPC Commands -
+
+ + <function moreinfo="none">core.aliases_list</function> + + + Returns the list of local SIP server host aliases. + +
+
<function moreinfo="none">core.arg</function> @@ -455,8 +461,32 @@ resetdebug(); &kamcmd; core.arg ... -
-
+
+
+ + <function moreinfo="none">core.echo</function> + + + Returns back its parameters. + +
+
+ + <function moreinfo="none">core.flags</function> + + + Returns the compile flags. + +
+
+ + <function moreinfo="none">core.info</function> + + + Verbose info, including version number, compile flags, compiler, repository, hash + +
+
<function moreinfo="none">core.kill</function> @@ -475,8 +505,40 @@ resetdebug(); &kamcmd; core.kill ... -
-
+
+
+ + <function moreinfo="none">core.printi</function> + + + Returns the integers given as parameters. + +
+
+ + <function moreinfo="none">core.prints</function> + + + Returns the strings given as parameters. + +
+
+ + <function moreinfo="none">core.ps</function> + + + Returns the description of running processes. + +
+
+ + <function moreinfo="none">core.psx</function> + + + Returns the detailed description of running processes. + +
+
<function moreinfo="none">core.pwd</function> @@ -495,8 +557,58 @@ resetdebug(); &kamcmd; core.pwd ... -
-
+
+
+ + <function moreinfo="none">core.shmem</function> + + + 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. + +
+
+ + <function moreinfo="none">core.sockets_list</function> + + + Returns the list of local SIP server listen sockets. + +
+
+ + <function moreinfo="none">core.tcp_info</function> + + + Returns TCP related info. + +
+
+ + <function moreinfo="none">core.tcp_list</function> + + + Returns TCP connections details. + +
+
+ + <function moreinfo="none">core.tcp_options</function> + + + Returns active TCP options. + +
+
+ + <function moreinfo="none">core.udp4_raw_info</function> + + + Returns udp4_raw mode related info. + +
+
<function moreinfo="none">core.uptime</function> @@ -518,7 +630,7 @@ resetdebug();
- <function moreinfo="none">version</function> + <function moreinfo="none">core.version</function> Print version information. @@ -536,26 +648,7 @@ resetdebug(); ...
-
- - <function moreinfo="none">system.listMethods</function> - - - Print list of available RPC commands. - - - Name: system.listMethods - - Parameters: none. - - RPC Command Format: - - -... -&kamcmd; system.listMethods -... - -
+
<function moreinfo="none">pkg.stats</function> @@ -591,10 +684,10 @@ resetdebug(); Examples: </para> <programlisting format="linespecific"> - &sercmd; pkg.stats - &sercmd; pkg.stats pid 1234 - &sercmd; pkg.stats rank 1 - &sercmd; pkg.stats index 10 + &kamcmd; pkg.stats + &kamcmd; pkg.stats pid 1234 + &kamcmd; pkg.stats rank 1 + &kamcmd; pkg.stats index 10 </programlisting> </section> <section id="kex.r.stats.get_statistics"> @@ -609,10 +702,10 @@ resetdebug(); is printed.</para> <para>Examples:</para> <programlisting format="linespecific"> - &sercmd; stats.get_statistics all - &sercmd; stats.get_statistics core: - &sercmd; stats.get_statistics unsupported_methods - &sercmd; stats.get_statistics shmem: fwd_requests fwd_replies + &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.reset_statistics"> @@ -625,10 +718,10 @@ resetdebug(); </para> <para>Examples:</para> <programlisting format="linespecific"> - &sercmd; stats.reset_statistics all - &sercmd; stats.reset_statistics core: - &sercmd; stats.reset_statistics unsupported_methods - &sercmd; stats.reset_statistics shmem: fwd_requests fwd_replies + &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"> @@ -641,12 +734,48 @@ resetdebug(); </para> <para>Examples:</para> <programlisting format="linespecific"> - &sercmd; stats.reset_statistics all - &sercmd; stats.reset_statistics core: - &sercmd; stats.reset_statistics unsupported_methods - &sercmd; stats.reset_statistics shmem: fwd_requests fwd_replies + &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> + + + Print list of available RPC commands. + + + Name: system.listMethods + + Parameters: none. + + RPC Command Format: + + +... +&kamcmd; system.listMethods +... + +
+
+ + <function moreinfo="none">system.methodHelp</function> + + + Print the help string for given method. + +
+
+ + <function moreinfo="none">system.methodSignature</function> + + + Returns signature of given method. + +
@@ -700,10 +829,10 @@ resetdebug(); Examples: </para> <programlisting format="linespecific"> - &sercmd; mod.stats core all - &sercmd; mod.stats userblacklist shm - &sercmd; mod.stats kex pkg - &sercmd; mod.stats all all + &kamcmd; mod.stats core all + &kamcmd; mod.stats userblacklist shm + &kamcmd; mod.stats kex pkg + &kamcmd; mod.stats all all </programlisting> <para> Output: