Hello Daniel,
Thank you for your response. I can confirm that the value that gets increased twice is the "200" code response when calling the procedures over JSONRPC with HTTP, or maybe all HTTP responses code. The response that I get when calling the "sl.stats" procedure using the jsonrpc is:
{ "200" : 2, "202" : 0, "2xx" : 0, "300" : 0, "301" : 0, "302" : 0, "3xx" : 0, "400" : 0, "401" : 0, "403" : 0, "404" : 0, "407" : 0, "500" : 0, "5xx" : 0, "6xx" : 0, "xxx" : 0 }
I have compared this with the output of the "kamcmd sl.status" command and can confirm that the "200" value does not get incremented when using this tool. Based on my analysis, I suspect that this issue is caused by Kamailio treating the HTTP responses code as a "200" SIP response code.
I configured the "ctl" module with its "binrpc" paramater to test in wireshark how the transmition goes like this : " loadmodule "ctl" modparam("ctl", "binrpc", "unix:/run/kamailio/kamailio_ctl") modparam("ctl", "binrpc", "udp:*:1234") " So I created a socket client for the server 127.0.0.1:1234, and sent the message for example "sl.stats", I got a "bad request" response from kamailio, then I noticed in wireshark that the data sent from kamcmd and my script are different and encoded in different way... So my question is just how to avoid kamailio treating HTTP responses in a different way as SIP, because it may the problem not only for "200 ok" responses ...
Thank you very much! Best,