Description

Using kamcmd to obtain statistics of SIP replies, for large values (exceeding 4 bytes) :
Example :

kamcmd> sl.stats
{
(...)
        302: -1294967293
}

The variable is an unsigned long, it can store values up to 2^64-1.
But RPC command sl.stats does not support this.

Possible Solutions

I think the fix is simple, we should just replace "d" by "j" when using "rpc->struct_add"
(function "rpc_stats" in file src/modules/sl/sl_stats.c).

E.g. :

        rpc->struct_add(st, "jjjj",
                        "300", total.err[RT_300],
                        "301", total.err[RT_301],
                        "302", total.err[RT_302],
                        "3xx", total.err[RT_3xx]);

I found a commit that did something similar with the shared memory stats :
f619cae

Additional Information

Kamailio 5.6.4


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/issues/3386@github.com>