Module: kamailio
Branch: master
Commit: e271bb60d4cb0e3e2ec1ecca4ff2833885331732
URL:
https://github.com/kamailio/kamailio/commit/e271bb60d4cb0e3e2ec1ecca4ff2833…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-03-31T12:06:32+02:00
kamctl: added srv command
- shortcuts to RPC commands to print sockets, aliases and available RPC
commands
---
Modified: utils/kamctl/kamctl
Modified: utils/kamctl/kamctl.base
---
Diff:
https://github.com/kamailio/kamailio/commit/e271bb60d4cb0e3e2ec1ecca4ff2833…
Patch:
https://github.com/kamailio/kamailio/commit/e271bb60d4cb0e3e2ec1ecca4ff2833…
---
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