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 [email protected]<mailto:[email protected]>] Src:[127.0.0.1:52784] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:[email protected]:22625<sip:[email protected]:22625>] 4(5633) INFO: <script>: [OPTIONS [email protected]<mailto:[email protected]>] Src:[127.0.0.1:39363] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:[email protected]:53534<sip:[email protected]:53534>] 8(5637) INFO: <script>: [OPTIONS [email protected]<mailto:[email protected]>] Src:[127.0.0.1:32090] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:[email protected]:9877<sip:[email protected]:9877>] 29(5658) INFO: <script>: [OPTIONS [email protected]<mailto:[email protected]>] Src:[135.125.190.71:56243] RURI:[sip:kam01.tst.xxx.xxxxxx.xxx] To:[sip:kam01.tst.xxx.xxxxxx.xxx] From:[sip:[email protected]:56243<sip:[email protected]:56243>] 29(5658) CRITICAL: <script>: [OPTIONS [email protected]<mailto:[email protected]>] tm:local-response replied locally 29(5658) INFO: <script>: [OPTIONS [email protected]<mailto:[email protected]>] Src:[135.125.190.71:56243] RURI:[sip:kam01.tst.xxx.xxxxxx.xxx] To:[sip:kam01.tst.xxx.xxxxxx.xxx] From:[sip:[email protected]:56243<sip:[email protected]:56243>] 29(5658) INFO: <script>: [OPTIONS [email protected]<mailto:[email protected]>] Src:[135.125.190.71:56243] RURI:[sip:kam01.tst.xxx.xxxxxx.xxx] To:[sip:kam01.tst.xxx.xxxxxx.xxx] From:[sip:[email protected]:56243<sip:[email protected]:56243>] 3(5632) INFO: <script>: [OPTIONS [email protected]<mailto:[email protected]>] Src:[127.0.0.1:3782] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:[email protected]:31297<sip:[email protected]:31297>] 2(5631) INFO: <script>: [OPTIONS [email protected]<mailto:[email protected]>] Src:[127.0.0.1:30019] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:[email protected]:19102<sip:[email protected]:19102>] 1(5630) INFO: <script>: [OPTIONS [email protected]<mailto:[email protected]>] Src:[127.0.0.1:19999] RURI:[sip:foo@localhost] To:[sip:foo@localhost] From:[sip:[email protected]:39149<sip:[email protected]:39149>] Cheers, Henning -- Henning Westerholt - https://skalatan.de/blog/ Kamailio services - https://gilawa.com<https://gilawa.com/> From: Kaufman <[email protected]> Sent: Freitag, 7. Juli 2023 15:46 To: Kamailio (SER) - Users Mailing List <[email protected]> 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 <[email protected]<mailto:[email protected]>> Sent: Wednesday, July 5, 2023 11:14 AM To: Kamailio (SER) - Users Mailing List <[email protected]<mailto:[email protected]>> 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 [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 9(66) CRITICAL: <script>: [INVITE [email protected]<mailto:[email protected]>] tm:local-response replied locally 10(67) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 11(68) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 11(68) CRITICAL: <script>: [INVITE [email protected]<mailto:[email protected]>] tm:local-response replied locally 12(69) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 13(70) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 13(70) CRITICAL: <script>: [INVITE [email protected]<mailto:[email protected]>] tm:local-response replied locally 14(71) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 15(72) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 15(72) CRITICAL: <script>: [INVITE [email protected]<mailto:[email protected]>] tm:local-response replied locally 16(73) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 9(66) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 10(67) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 11(68) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 12(69) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 13(70) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 14(71) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 15(72) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 16(73) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 9(66) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 10(67) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 11(68) INFO: <script>: [INVITE [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] 12(69) INFO: <script>: [ACK [email protected]<mailto:[email protected]>] Src:[172.26.0.3:5060] RURI:[sip:[email protected]:5060] To:[sip:[email protected]:5060] From:[sip:[email protected]:5060] Kaufman
__________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
