[ previous ] [ next ] [ threads ]
 To :  Gerrit Jacobsen <g_jacobsen@y...>
 From :  "Information | asymetrixs.net" <info@a...>
 Subject :  Re: [yate] Pleaaaase 0, 1 as boolean possible in Yate
 Date :  Fri, 02 Apr 2010 12:25:42 +0200
Hey,

at DB site you can work with CASE as workaround (if you didn't know it
and for those who don't :-))

something like

SELECT CASE  WHEN 1 THEN "TRUE" ELSE "FALSE" END FROM ...

should work on INSERT and UPDATE too.

I don't think that yate has to support it, but str_false and str_true
are arrays anyway, so why not picking it up? :)

Looking at other programmiiny languages like C# for example 1 and 0 can
be converted to booleans, but are not recognized as those originally,
but PHP does, if i remeber correctly.


Best regards
Damian



Gerrit Jacobsen schrieb:
> Hello Yate team,
>
> it would be fabulous if yate would accept 0 and 1 as boolean values.
>
> String.cpp
> ..
> static const char* str_false[] = { "false", "no", "off", "disable",
> "f", "0", 0 };
> static const char* str_true[] = { "true", "yes", "on", "enable", "t",
> "1", 0 };
> ...
> would fix this
>
> It makes it much easier to insert boolean parameters into yate
> messages with the register module as DBs provide 0 and 1 as boolean
> answers.
>
> Thanks for considering this.
>
> Gerry
>
>