Hi
Further trying to eliminate every possible cause of UDP drops...
We use Homer as HEP server in conjunction with the siptrace module.
So to prevent DQM traffic to be sent to Homer I added:
event_route[siptrace:msg] { if(is_method("KDMQ")) { drop(); } }
And had a closer look to the traffic sent to homer.
I noticed, also xhttp:requests, as far as I see the replies, not the requests, get mirrored to homer.
xhttp is not a sip method I could match I guess.
The event_route[siptrace:msg] docs state only method can be filtered. So I can not filter requests on the separate http port I listen on for xhttp json-rpc requests.
How can I prevent xhttp traffic to be mirrored to homer by the siptrace module?
Mit freundlichen Grüssen
-Benoît Panizzon-
docs read like you can filter on headers and body. So maybe is_present_hf("Sia") works for filtering xhttp replies.
Regards, Bastian
On Tue, Oct 17, 2023 at 1:54 PM Benoit Panizzon via sr-users < sr-users@lists.kamailio.org> wrote:
Hi
Further trying to eliminate every possible cause of UDP drops...
We use Homer as HEP server in conjunction with the siptrace module.
So to prevent DQM traffic to be sent to Homer I added:
event_route[siptrace:msg] { if(is_method("KDMQ")) { drop(); } }
And had a closer look to the traffic sent to homer.
I noticed, also xhttp:requests, as far as I see the replies, not the requests, get mirrored to homer.
xhttp is not a sip method I could match I guess.
The event_route[siptrace:msg] docs state only method can be filtered. So I can not filter requests on the separate http port I listen on for xhttp json-rpc requests.
How can I prevent xhttp traffic to be mirrored to homer by the siptrace module?
Mit freundlichen Grüssen
-Benoît Panizzon-
I m p r o W a r e A G - Leiter Commerce Kunden ______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00 CH-4133 Pratteln Fax +41 61 826 93 01 Schweiz Web http://www.imp.ch ______________________________________________________ __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hi Benoit,
how are you measure the traffic you don't want to your Homer? Print stuff in that Kamailio event route or something else?
Kind regards Karsten Horsmann
Benoit Panizzon via sr-users sr-users@lists.kamailio.org schrieb am Di., 17. Okt. 2023, 13:54:
Hi
Further trying to eliminate every possible cause of UDP drops...
We use Homer as HEP server in conjunction with the siptrace module.
So to prevent DQM traffic to be sent to Homer I added:
event_route[siptrace:msg] { if(is_method("KDMQ")) { drop(); } }
And had a closer look to the traffic sent to homer.
I noticed, also xhttp:requests, as far as I see the replies, not the requests, get mirrored to homer.
xhttp is not a sip method I could match I guess.
The event_route[siptrace:msg] docs state only method can be filtered. So I can not filter requests on the separate http port I listen on for xhttp json-rpc requests.
How can I prevent xhttp traffic to be mirrored to homer by the siptrace module?
Mit freundlichen Grüssen
-Benoît Panizzon-
I m p r o W a r e A G - Leiter Commerce Kunden ______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00 CH-4133 Pratteln Fax +41 61 826 93 01 Schweiz Web http://www.imp.ch ______________________________________________________ __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hi Karsten
how are you measure the traffic you don't want to your Homer? Print stuff in that Kamailio event route or something else?
Basically, I want to mirror sip messages to homer, only sip messages relevant to calls, not anything else which might be processed by kamailio.
modules.inc:loadmodule "siptrace.so" modules.inc:modparam("siptrace", "trace_flag", 22); modules.inc:modparam("siptrace", "trace_on", 1) modules.inc:modparam("siptrace", "trace_mode", 1) modules.inc:modparam("siptrace", "hep_mode_on", 1) modules.inc:modparam("siptrace", "hep_version", 3) modules.inc:modparam("siptrace", "hep_capture_id", HEP_CAP_AGENT) modules.inc:modparam("siptrace", "duplicate_uri", HOMERSIPURI)
I also use the xhttp interface for jsonrpc and a custom API.
For this I have kamailio also listen to TCP port 8080 to have those API xhttp requests clearly separated from call traffic.
But, as I understand, xhttp requests are initially handled as if they were sip requests and get processed request_route{}
So my request route starts with:
request_route {
# Handle DMQ requests route(DMQ_CAPTURE);
# Make sure we operate on the correct port (not on the xhttp one) if ($Rp != 5060 && $Rp != 5061) { xlog("L_ERROR", "REQUEST_ROUTE $rm to wrong port $Rp\n"); exit; }
so all SIP method requests to port 8080 are being dropped.
I process xhttp traffic with the appropriate event route and of course reject http requests to sip ports with the appropriate http error message.
event_route[xhttp:request] { if ($avp(debug) > 0) { xlog("L_INFO", "$cfg(route): XHTTP Request to URI: $hu Port: $Rp BODY: $rb\n"); } if ($Rp != 8080) { # We got a HTTP Request on a sip port. Reject! xhttp_reply("418", "I'm a teapot", "text/html", "<html><body>I'm not a Web-Server!</body></html>"); exit; } if ($hu =~ "^/RPC") { ### KAMAILIO JSONRCP pass-through jsonrpc_dispatch(); } else if ($hu =~ "^/API") { ### IMPROWARE API
[...]
What I observe is the siptrace module being triggered right at the start of request_route. This makes sense, I want to mirror every sip message.
But his also causes mirroring of the xhttp requests and replies to port 8080.
Is there a way to prevent this?
siptrace has an event route capable of filtering, as I understand it is only possible to filter on the SIP request method, not anything else:
event_route[siptrace:msg] { if(is_method("KDMQ")) { drop(); } }
Do I miss something? How can I prevent/filter xhttp requests to be mirrored by the siptrace module?
Mit freundlichen Grüssen
-Benoît Panizzon-
I used to have this problem, but I don't have it right now. I've never fixed the problem, but I'm on 5.6.1 now and it doesn't happen. What version have you got?
James
On Mon, 23 Oct 2023 at 07:26, Benoit Panizzon via sr-users sr-users@lists.kamailio.org wrote:
Hi Karsten
how are you measure the traffic you don't want to your Homer? Print stuff in that Kamailio event route or something else?
Basically, I want to mirror sip messages to homer, only sip messages relevant to calls, not anything else which might be processed by kamailio.
modules.inc:loadmodule "siptrace.so" modules.inc:modparam("siptrace", "trace_flag", 22); modules.inc:modparam("siptrace", "trace_on", 1) modules.inc:modparam("siptrace", "trace_mode", 1) modules.inc:modparam("siptrace", "hep_mode_on", 1) modules.inc:modparam("siptrace", "hep_version", 3) modules.inc:modparam("siptrace", "hep_capture_id", HEP_CAP_AGENT) modules.inc:modparam("siptrace", "duplicate_uri", HOMERSIPURI)
I also use the xhttp interface for jsonrpc and a custom API.
For this I have kamailio also listen to TCP port 8080 to have those API xhttp requests clearly separated from call traffic.
But, as I understand, xhttp requests are initially handled as if they were sip requests and get processed request_route{}
So my request route starts with:
request_route {
# Handle DMQ requests route(DMQ_CAPTURE); # Make sure we operate on the correct port (not on the xhttp one) if ($Rp != 5060 && $Rp != 5061) { xlog("L_ERROR", "REQUEST_ROUTE $rm to wrong port $Rp\n"); exit; }
so all SIP method requests to port 8080 are being dropped.
I process xhttp traffic with the appropriate event route and of course reject http requests to sip ports with the appropriate http error message.
event_route[xhttp:request] { if ($avp(debug) > 0) { xlog("L_INFO", "$cfg(route): XHTTP Request to URI: $hu Port: $Rp BODY: $rb\n"); } if ($Rp != 8080) { # We got a HTTP Request on a sip port. Reject! xhttp_reply("418", "I'm a teapot", "text/html", "<html><body>I'm not a Web-Server!</body></html>"); exit; } if ($hu =~ "^/RPC") { ### KAMAILIO JSONRCP pass-through jsonrpc_dispatch(); } else if ($hu =~ "^/API") { ### IMPROWARE API
[...]
What I observe is the siptrace module being triggered right at the start of request_route. This makes sense, I want to mirror every sip message.
But his also causes mirroring of the xhttp requests and replies to port 8080.
Is there a way to prevent this?
siptrace has an event route capable of filtering, as I understand it is only possible to filter on the SIP request method, not anything else:
event_route[siptrace:msg] { if(is_method("KDMQ")) { drop(); } }
Do I miss something? How can I prevent/filter xhttp requests to be mirrored by the siptrace module?
Mit freundlichen Grüssen
-Benoît Panizzon-
I m p r o W a r e A G - Leiter Commerce Kunden ______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00 CH-4133 Pratteln Fax +41 61 826 93 01 Schweiz Web http://www.imp.ch ______________________________________________________ __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hi James
I used to have this problem, but I don't have it right now. I've never fixed the problem, but I'm on 5.6.1 now and it doesn't happen. What version have you got?
5.5 on production and 5.6 / 5.7 on development platform
Thank you for that hint. Checking if that also occurs on 5.6