Hello,
xhttp is using internally the sl module for generating the http
response, that's likely the cause of getting the sl stats increased.
This behaviour is there for very long time, but I guess nobody has
noticed it before.
Probably the non-sip responses generated by sl should be skipped from
statistics, it would require c code development, maybe a new
inter-module api function with a parameter to skip updating stats.
Cheers,
Daniel
On 09.03.23 12:34, sadik.oualla.mohamed(a)gmail.com wrote:
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,
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave(a)lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
--
Daniel-Constantin Mierla --
www.asipto.com
www.twitter.com/miconda --
www.linkedin.com/in/miconda
Kamailio World Conference - June 5-7, 2023 -
www.kamailioworld.com
Kamailio Advanced Training - Online - March 27-30, 2023 -
www.asipto.com