Module: kamailio
Branch: 5.0
Commit: 1ed8f8aabe7e1e444f9fabd4728896d23a48f630
URL:
https://github.com/kamailio/kamailio/commit/1ed8f8aabe7e1e444f9fabd4728896d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-04-04T13:53:10+02:00
kamctl: added srv command
- shortcuts to RPC commands to print sockets, aliases and available RPC
commands
(cherry picked from commit e271bb60d4cb0e3e2ec1ecca4ff2833885331732)
---
Modified: utils/kamctl/kamctl
Modified: utils/kamctl/kamctl.base
---
Diff:
https://github.com/kamailio/kamailio/commit/1ed8f8aabe7e1e444f9fabd4728896d…
Patch:
https://github.com/kamailio/kamailio/commit/1ed8f8aabe7e1e444f9fabd4728896d…
---
diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index 9e954c6..30d5878 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -1686,6 +1686,35 @@ dispatcher() {
#
##### ------------------------------------------------ #####
+### Server management
+#
+ksr_srv() {
+ case $1 in
+ sockets)
+ require_ctlengine
+ mecho "list listen sockets"
+ ctl_cmd_run corex.list_sockets corex.list_sockets
+ ;;
+ aliases)
+ require_ctlengine
+ mecho "list server aliases"
+ ctl_cmd_run corex.list_aliases corex.list_aliases
+ ;;
+ rpclist)
+ require_ctlengine
+ mecho "list server rpc commands"
+ ctl_cmd_run system.listMethods system.listMethods
+ ;;
+ *)
+ usage_ksr_srv
+ exit 1
+
+ esac
+}
+
+
+#
+##### ------------------------------------------------ #####
### DIALOG management
#
dialog() {
@@ -2904,6 +2933,11 @@ case $1 in
fi
;;
+ srv)
+ shift
+ ksr_srv "$@"
+ ;;
+
restart)
kamailio_stop
sleep 2
diff --git a/utils/kamctl/kamctl.base b/utils/kamctl/kamctl.base
index fe67a0c..29ee217 100644
--- a/utils/kamctl/kamctl.base
+++ b/utils/kamctl/kamctl.base
@@ -535,6 +535,20 @@ cat <<EOF
EOF
}
+usage_ksr_srv() {
+ echo
+ mecho " -- command 'srv' - server management commands"
+ echo
+cat <<EOF
+ * Examples: srv sockets
+ * srv rpclist
+ srv sockets ................... show the list of listen sockets
+ srv aliases ................... show the list of server aliases
+ srv rpclist ................... show the list of server rpc commands
+EOF
+}
+USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_ksr_srv"
+
##### ----------------------------------------------- #####
#### Common functions