gaaf left a comment (kamailio/kamailio#4450)

> It doesn't feel like the right approach here, overwriting the existing string 
> value, it can break existing config conditions.

Unless I oversee something, those existing configs must be very wrong then. Do 
you mean the case where someone is comparing something that is deliberately 
converted to an int with a string? Like `$(rP{s.int}) == "tls"`? I don't think 
that's very likely.

And, is there really an overwriting of the value? AFAIK, transformations do not 
touch the input, they produce _new_ output. Otherwise, doesn't `{s.md5}` also 
overwrite the "existing string value"?
```
compute_md5(_tr_buffer, val->rs.s, val->rs.len);
val->rs.s = _tr_buffer;
```
If needed I can rewrite the in2str conversion to use a _tr_buffer (which should 
probably be done anyway to prevent overwriting in a cascade/nesting of 
transformations).

 
> Maybe it would be good to add new PV with has only the numeric value

Well, that doesn't fix the bug with the `{s.int}` transformation.

NB. It also adds to the already overwhelming amount of PV's with somewhat 
duplicated/similar contents. I'd rather remove all those separate string and 
int PV's and replace them with the `strintval` variant.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4450#issuecomment-3480988914
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/4450/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to