[sr-dev] git:5.2:cd3bf5c2: kamctl: also shift only on params when printing rpc command

Daniel-Constantin Mierla miconda at gmail.com
Wed Feb 20 12:45:48 CET 2019


Module: kamailio
Branch: 5.2
Commit: cd3bf5c2721385f80e5343f32d576b8fc9a0c672
URL: https://github.com/kamailio/kamailio/commit/cd3bf5c2721385f80e5343f32d576b8fc9a0c672

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-02-20T12:45:11+01:00

kamctl: also shift only on params when printing rpc command

(cherry picked from commit 6de8d942b626b05dff8dd5a4f20776db632eba19)

---

Modified: utils/kamctl/kamctl.rpcfifo

---

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

---

diff --git a/utils/kamctl/kamctl.rpcfifo b/utils/kamctl/kamctl.rpcfifo
index 0f8f171f48..ecf381fa41 100644
--- a/utils/kamctl/kamctl.rpcfifo
+++ b/utils/kamctl/kamctl.rpcfifo
@@ -149,12 +149,12 @@ rpc_cmd_print()
 		RPCPARAMS="yes"
 		shift
 	fi
-	while [ -n "$1" ] ; do
-		rpcparamval "${1}"
-		CMD="${CMD}, ${RPCVAL}"
-		shift
-	done
 	if [ "$RPCPARAMS" = "yes" ]; then
+		while [ -n "$1" ] ; do
+			rpcparamval "${1}"
+			CMD="${CMD}, ${RPCVAL}"
+			shift
+		done
 		CMD="${CMD}]"
 	fi
 	CMD="${CMD}, \"reply_name\": \"${name}\", \"id\": $$}\n"




More information about the sr-dev mailing list