New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exit status for kamcmd #211
Comments
I think it is a relative point of view to be considered. kamcmd itself didn't fail, because it is a tool to take the command line parameters and send a command to kamailio. Then it prints the output from kamailio. In that respect, kamcmd was successful. I just tested with curl tool and if I request a page that doesn't exits on a web site, its return code is also 0. Making kamcmd aware of the meaning of the response from kamailio might add complexity and duplicate lot of context, which can become hard to maintain. I let the discussion here open for other opinions, to see what would be preferred to be done. I consider to be normal behaviour right now. |
I agree with you, my only concern is related to the fact that scripting kamcmd (on puppet for example), will end up in the case where you won't know if the command was successful or not. A solution would be to use the stdout, and do some logic on top of that. |
You can use jsonrpc or xmlrpc for more standard formatted output. It should be easier to parse the result returned by kamailio. Look at kamcli (https://github.com/asipto/kamcli) -- it can send jsonrpc commands via a local fifo file, if you prefer to avoid network communication. I will close this as not being an issue. Eventually you can start a discussion on sr-dev mailing list for enhancing kamcmd in being more flexible in such situations. |
Hello
I'm running Kamailio version: 4.2.5 (x86_64/linux).
kamcmd is always exiting with exit status "0" even if the command failed.
root@lb:
# kamcmd willfail# echo $?error: 500 - command willfail not found
root@lb:
0
[live] root@lb32:
# kamcmd permissions.trustedReload# echo $?Reload OK
root@lb:
0
The text was updated successfully, but these errors were encountered: