[OpenSIPS-Users] is this a bug? acc module setting empty string for unset fields
Kingsley Tart
kingsley at dns99.co.uk
Tue May 11 08:58:45 EST 2021
On Mon, 2021-05-10 at 19:25 +0300, Liviu Chircu wrote:
> On 10.05.2021 19:19, Kingsley Tart wrote:
> > I could do, but I was hoping to avoid that as it feels like bad
> > practice and it's inefficient - more of a workaround than a proper fix.
>
> Speaking for myself, I don't think I've ever seen a non-VARCHAR custom
> accounting column with the "acc" module.
I think this is probably the reason ;)
If it's the only way to make it work, people are doing it that way
because they have to.
> Also, if you think about it,
> writing the 1 integer value requires only 25% of the space if you're
> writing "1" instead of 1. So, YMMV with regards to efficiency, we're
> talking bits and pieces of data here, as the fields themselves are not
> that large, it's their sheer number required in the CDRs that's often
> problematic.
It depends on what you want to do to that column afterwards - see
Aron's message for example.
SQL databases have different datatypes for a reason. It would be nice
if the acc module could play nicer with that. Two possible solutions to
this are:
1. the acc module not try to set any fields where the value has not
been set in the routing script, or
2. the acc module defaults these fields to NULL instead of an empty
string
I prefer option 1 if given the choice.
--
Cheers,
Kingsley.
More information about the Users
mailing list