Skip to content
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

Extend documentation for conversion from number to boolean in core cookbook #3315

Closed
dilyanpalauzov opened this issue Dec 17, 2022 · 2 comments

Comments

@dilyanpalauzov
Copy link
Contributor

According to https://www.kamailio.org/wikidocs/cookbooks/devel/core/ (Core Cookbook) type boolean is documented as:

  • boolean - aliases to 1 (true, on, yes) or 0 (false, off, no)

Moreover the if() and while() statement can accept a number as condition. My expectation was that passing non-zero is always converted to true, but this is not correct.

Please document how numbers are converted to booleans in case of if() and while() conditions.

@henningw henningw changed the title Unclear conversion from number to boolean Extend documentation for conversion from number to boolean in core cookbook Dec 18, 2022
@henningw
Copy link
Contributor

Thanks for the issue. I marked it as enhancement request, which will be closed after some time if no developer started to work on it.
If you want to generally discuss it, please use the sr-users mailing list.

@miconda
Copy link
Member

miconda commented Dec 18, 2022

See https://www.kamailio.org/wikidocs/tutorials/faq/main/#how-is-the-function-return-code-evaluated which is linked from IF docs section. To extend it, just make PRs to the docs. Further discussions should be done on mailing list.

@miconda miconda closed this as completed Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants