[OpenSIPS-Users] Global variable $rm gives number when using $json

Johan De Clercq johan at democon.be
Tue Jan 19 17:10:56 EST 2021


For that case, why don’t you make an extra parameter ? E.g. use-broken-implementation 0|1

Outlook voor iOS<https://aka.ms/o0ukef> downloaden
Van: Users <users-bounces at lists.opensips.org> namens Liviu Chircu <liviu at opensips.org>
Verzonden: Tuesday, January 19, 2021 4:38:58 PM
Aan: OpenSIPS users mailling list <users at lists.opensips.org>
Onderwerp: Re: [OpenSIPS-Users] Global variable $rm gives number when using $json

On 18.01.2021 20:53, Alex Kinch wrote:
I get this (identifying data redacted):

Jan 18 18:18:15 [33] request: INVITE from sip:XX at XX to sip:XX at XX
Jan 18 18:18:15 [33] Sending { "call_id": "942887463-1604195939-951239259", "ts": "2021-01-18 18:18:15Z", "src_ip": "XX", "dst_ip": "XX", "method": 1, "sip_from": "sip:XX at XX", "sip_to": "sip:XX at XX", "dialled": "XX" }

Any suggestions?

Hi Alex,

Thank you for the examples - indeed, that behavior is broken.

I just pushed a fix for this on "master" branch [1].  However, I'm a bit reluctant to backport it for the moment, because I haven't fully assessed its implications.  For example, could it be possible that people have already written code that relies on $json incorrectly returning the integer value of a variable which holds both a string and an integer, with string taking precedence (e.g. $rm)?

[1]: https://github.com/OpenSIPS/opensips/commit/6191f278a4

Liviu Chircu
www.twitter.com/liviuchircu<http://www.twitter.com/liviuchircu> | www.opensips-solutions.com<http://www.opensips-solutions.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210119/598c9d78/attachment.html>

More information about the Users mailing list