Kamailio version: 5.1.6 (x86_64/linux)
cfgtrace reports strange call route flow going back and forward from the parent route. For example, if the cfg file looks like the following:
############################################### loadmodule "cfgt.so" modparam("cfgt", "mask", 30) modparam("cfgt", "basedir", "/tmp/cfgtest/") loadmodule "debugger.so" modparam("debugger", "cfgtrace", 1) modparam("debugger", "mod_level_mode", 1) modparam("debugger", "mod_hash_size", 4) modparam("debugger", "mod_level", "core=3") modparam("debugger", "cfgtest", 1)
request_route { route(ENTRY); route(TEST_1); } route[ENTRY] { xlog("L_NOTICE", "New request\n"); } route[TEST_2] { xlog("L_NOTICE", "End\n"); } route[TEST_1] { xlog("L_NOTICE", "I'm here\n"); if(is_method("BYE")) { xlog("L_NOTICE", "I'm here, again\n"); route(TEST_2); } xlog("L_NOTICE", "I'm still here\n"); return; } ###############################################
If I send an INVITE message, I get the following cfgtrace:
DEBUG: <core> [core/parser/msg_parser.c:89]: get_hdr_field(): found end of header ERROR: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/etc/kamailio/proxy/kamailio.cfg] l=472 a=5 n=route ERROR: *** cfgtrace:request_route=[ENTRY] c=[/etc/kamailio/proxy/kamailio.cfg] l=479 a=26 n=xlog NOTICE: <script>: New request ERROR: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/etc/kamailio/proxy/kamailio.cfg] l=474 a=5 n=route ERROR: *** cfgtrace:request_route=[TEST_1] c=[/etc/kamailio/proxy/kamailio.cfg] l=489 a=26 n=xlog NOTICE: <script>: I'm here ERROR: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/etc/kamailio/proxy/kamailio.cfg] l=497 a=16 n=if ERROR: *** cfgtrace:request_route=[TEST_1] c=[/etc/kamailio/proxy/kamailio.cfg] l=491 a=25 n=is_method ERROR: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/etc/kamailio/proxy/kamailio.cfg] l=497 a=26 n=xlog NOTICE: <script>: I'm still here ERROR: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/etc/kamailio/proxy/kamailio.cfg] l=499 a=2 n=return DEBUG: <core> [core/receive.c:298]: receive_msg(): request-route executed in: 395 usec
As you see some actions are assigned to route "DEFAULT_ROUTE" even if they are in TEST_1.
The issue completely disappear if I remove "route(TEST_2);" line inside the IF.