[sr-dev] git:master:d2416957: kamctl: require db or ctl engine made specific for dispatcher subcommands

Daniel-Constantin Mierla miconda at gmail.com
Thu Nov 19 13:31:23 CET 2015


Module: kamailio
Branch: master
Commit: d2416957e4caec8a64abec82029ea18c52a7bc2d
URL: https://github.com/kamailio/kamailio/commit/d2416957e4caec8a64abec82029ea18c52a7bc2d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-11-19T13:31:10+01:00

kamctl: require db or ctl engine made specific for dispatcher subcommands

---

Modified: utils/kamctl/kamctl

---

Diff:  https://github.com/kamailio/kamailio/commit/d2416957e4caec8a64abec82029ea18c52a7bc2d.diff
Patch: https://github.com/kamailio/kamailio/commit/d2416957e4caec8a64abec82029ea18c52a7bc2d.patch

---

diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index 39e89eb..22d9643 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -1583,15 +1583,15 @@ cr() {
 ### DISPATCHER management
 #
 dispatcher() {
-	require_dbengine
-	require_ctlengine
 	case $1 in
 		show)
+			require_dbengine
 			mecho "dispatcher gateways"
 			QUERY="select * FROM $DISPATCHER_TABLE ORDER BY $DISPATCHER_SETID_COLUMN; "
 			$DBROCMD "$QUERY"
 			;;
 		addgw|add)
+			require_dbengine
 			shift
 			if [ $# -lt 2 ] ; then
 				merr "too few parameters"
@@ -1638,6 +1638,7 @@ dispatcher() {
 
 			;;
 		rmgw|rm)
+			require_dbengine
 			shift
 			if [ $# -ne 1 ] ; then
 				merr "missing gateway id to be removed"
@@ -1654,10 +1655,12 @@ dispatcher() {
 
 			;;
 		reload)
+			require_ctlengine
 			$CTLCMD ds_reload
 			;;
 
 		dump)
+			require_ctlengine
 			$CTLCMD ds_list
 			;;
 




More information about the sr-dev mailing list