Module: kamailio
Branch: 5.2
Commit: c8b65f5f562db763b013ab945cba7caadb9f6535
URL:
https://github.com/kamailio/kamailio/commit/c8b65f5f562db763b013ab945cba7ca…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-02-20T12:45:02+01:00
kamctl: shift only when expecting more parameters for rpc command
(cherry picked from commit 8b1458e97270a4094085226dce1108d8ea5ca7af)
---
Modified: utils/kamctl/kamctl.rpcfifo
---
Diff:
https://github.com/kamailio/kamailio/commit/c8b65f5f562db763b013ab945cba7ca…
Patch:
https://github.com/kamailio/kamailio/commit/c8b65f5f562db763b013ab945cba7ca…
---
diff --git a/utils/kamctl/kamctl.rpcfifo b/utils/kamctl/kamctl.rpcfifo
index 881a8bdf53..0f8f171f48 100644
--- a/utils/kamctl/kamctl.rpcfifo
+++ b/utils/kamctl/kamctl.rpcfifo
@@ -106,13 +106,13 @@ rpc_cmd()
CMD="${CMD}, \"params\": [${RPCVAL}"
RPCPARAMS="yes"
fi
- shift
- while [ -n "$1" ] ; do
- rpcparamval "${1}"
- CMD="${CMD}, ${RPCVAL}"
- shift
- done
if [ "$RPCPARAMS" = "yes" ]; then
+ shift
+ while [ -n "$1" ] ; do
+ rpcparamval "${1}"
+ CMD="${CMD}, ${RPCVAL}"
+ shift
+ done
CMD="${CMD}]"
fi
CMD="${CMD}, \"reply_name\": \"${name}\", \"id\":
$$}\n"