Hello,
yes, the tm:local-reponse should be executed for every locally generated reply. I could also reproduce this with kamailio-devel. After some time, the log messages appear again. So, it seems like an interesting condition that it only works some of the time.
There seems to be also a bug open for that from last year: https://github.com/kamailio/kamailio/issues/3064
5(5634) INFO: <script>: [OPTIONS 1805508309@116.203.XXX.XX-1mailto:1805508309@116.203.183.57-1] Src:[127.0.0.1:52784] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:sipsak@116.203.XXX.XX:22625sip:sipsak@116.203.183.57:22625] 4(5633) INFO: <script>: [OPTIONS 1901775789@116.203.XXX.XX-1mailto:1901775789@116.203.183.57-1] Src:[127.0.0.1:39363] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:sipsak@116.203.XXX.XX:53534sip:sipsak@116.203.183.57:53534] 8(5637) INFO: <script>: [OPTIONS 1849285454@116.203.XXX.XX-1mailto:1849285454@116.203.183.57-1] Src:[127.0.0.1:32090] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:sipsak@116.203.XXX.XX:9877sip:sipsak@116.203.183.57:9877] 29(5658) INFO: <script>: [OPTIONS 1193289168@116.203.XXX.XX-1mailto:1193289168@116.203.183.57-1] Src:[135.125.190.71:56243] RURI:[sip:kam01.tst.xxx.xxxxxx.xxx] To:[sip:kam01.tst.xxx.xxxxxx.xxx] From:[sip:sipsak@116.203.XXX.XX:56243sip:sipsak@116.203.183.57:56243] 29(5658) CRITICAL: <script>: [OPTIONS 1193289168@116.203.XXX.XX-1mailto:1193289168@116.203.183.57-1] tm:local-response replied locally 29(5658) INFO: <script>: [OPTIONS 1193289168@116.203.XXX.XX-2mailto:1193289168@116.203.183.57-2] Src:[135.125.190.71:56243] RURI:[sip:kam01.tst.xxx.xxxxxx.xxx] To:[sip:kam01.tst.xxx.xxxxxx.xxx] From:[sip:sipsak@116.203.XXX.XX:56243sip:sipsak@116.203.183.57:56243] 29(5658) INFO: <script>: [OPTIONS 1193289168@116.203.XXX.XX-3mailto:1193289168@116.203.183.57-3] Src:[135.125.190.71:56243] RURI:[sip:kam01.tst.xxx.xxxxxx.xxx] To:[sip:kam01.tst.xxx.xxxxxx.xxx] From:[sip:sipsak@116.203.XXX.XX:56243sip:sipsak@116.203.183.57:56243] 3(5632) INFO: <script>: [OPTIONS 854771556@116.203.XXX.XX-1mailto:854771556@116.203.183.57-1] Src:[127.0.0.1:3782] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:sipsak@116.203.XXX.XX:31297sip:sipsak@116.203.183.57:31297] 2(5631) INFO: <script>: [OPTIONS 1852254840@116.203.XXX.XX-1mailto:1852254840@116.203.183.57-1] Src:[127.0.0.1:30019] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:sipsak@116.203.XXX.XX:19102sip:sipsak@116.203.183.57:19102] 1(5630) INFO: <script>: [OPTIONS 2036725432@116.203.XXX.XX-1mailto:2036725432@116.203.183.57-1] Src:[127.0.0.1:19999] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:sipsak@116.203.XXX.XX:39149sip:sipsak@116.203.183.57:39149]
Cheers,
Henning
-- Henning Westerholt - https://skalatan.de/blog/ Kamailio services - https://gilawa.comhttps://gilawa.com/
From: Kaufman bkaufman@bcmone.com Sent: Freitag, 7. Juli 2023 15:46 To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: [SR-Users] Re: event_route[tm:local-response] only executes a few times
Following up here. Shouldn't event_route[tm:local-response] be executed for every locally generated request, not just the first few after Kamailio start?
Kaufman
From: Kaufman <bkaufman@bcmone.commailto:bkaufman@bcmone.com> Sent: Wednesday, July 5, 2023 11:14 AM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Subject: [SR-Users] event_route[tm:local-response] only executes a few times
CAUTION: This email originated from outside the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hello,
I'm writing a 302 redirect server and wanting to capture some events on all replies, so I'm trying to do this in event_route[tm:local-response], but I noticed that the event route is only called a few times for the first few requests, and then never gets executed again. This is the simplest case in which I can reproduce the issue:
#!KAMAILIO
loadmodule "pv" loadmodule "tm" loadmodule "xlog"
route { xinfo("[$rm $ci-$cs] Src:[$si:$sp] RURI:[$ru] To:[$tu] From:[$fu]\n");
t_send_reply("404", "Not Found"); exit; }
event_route[tm:local-response] { xcrit("[$rm $ci-$cs] tm:local-response replied locally\n"); } If I start Kamailio with kamailio -ddDDeE it has 8 children. If I use sipp to send 10 requests, this is what I see in the kamailio logs. The critical line in the event route is only printed four times. This is tested on 5.7.0 and 5.6.4 9(66) INFO: <script>: [INVITE 1-14@172.26.0.3-1mailto:1-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 9(66) CRITICAL: <script>: [INVITE 1-14@172.26.0.3-1mailto:1-14@172.26.0.3-1] tm:local-response replied locally 10(67) INFO: <script>: [ACK 1-14@172.26.0.3-1mailto:1-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 11(68) INFO: <script>: [INVITE 2-14@172.26.0.3-1mailto:2-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 11(68) CRITICAL: <script>: [INVITE 2-14@172.26.0.3-1mailto:2-14@172.26.0.3-1] tm:local-response replied locally 12(69) INFO: <script>: [ACK 2-14@172.26.0.3-1mailto:2-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 13(70) INFO: <script>: [INVITE 3-14@172.26.0.3-1mailto:3-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 13(70) CRITICAL: <script>: [INVITE 3-14@172.26.0.3-1mailto:3-14@172.26.0.3-1] tm:local-response replied locally 14(71) INFO: <script>: [ACK 3-14@172.26.0.3-1mailto:3-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 15(72) INFO: <script>: [INVITE 4-14@172.26.0.3-1mailto:4-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 15(72) CRITICAL: <script>: [INVITE 4-14@172.26.0.3-1mailto:4-14@172.26.0.3-1] tm:local-response replied locally 16(73) INFO: <script>: [ACK 4-14@172.26.0.3-1mailto:4-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 9(66) INFO: <script>: [INVITE 5-14@172.26.0.3-1mailto:5-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 10(67) INFO: <script>: [ACK 5-14@172.26.0.3-1mailto:5-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 11(68) INFO: <script>: [INVITE 6-14@172.26.0.3-1mailto:6-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 12(69) INFO: <script>: [ACK 6-14@172.26.0.3-1mailto:6-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 13(70) INFO: <script>: [INVITE 7-14@172.26.0.3-1mailto:7-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 14(71) INFO: <script>: [ACK 7-14@172.26.0.3-1mailto:7-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 15(72) INFO: <script>: [INVITE 8-14@172.26.0.3-1mailto:8-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 16(73) INFO: <script>: [ACK 8-14@172.26.0.3-1mailto:8-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 9(66) INFO: <script>: [INVITE 9-14@172.26.0.3-1mailto:9-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 10(67) INFO: <script>: [ACK 9-14@172.26.0.3-1mailto:9-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 11(68) INFO: <script>: [INVITE 10-14@172.26.0.3-1mailto:10-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060] 12(69) INFO: <script>: [ACK 10-14@172.26.0.3-1mailto:10-14@172.26.0.3-1] Src:[172.26.0.3:5060] RURI:[sip:service@172.26.0.2:5060] To:[sip:service@172.26.0.2:5060] From:[sip:sipp@172.26.0.3:5060]
Kaufman