Hello,
Hello,
Based on kamailio-basic-kemi.cfg and kamailio-basic-kemi-lua.lua,I’m trying to get a simple test to go through using SIPp built-in UAC and UAS scenarios, using LUA config:
Commented out all the registration blocks and trying to run a simple proxy for now, but I can’t seem able to change the URI.
SIPp UAC: 192.168.1.12:5060SIPp UAS: 192.168.1.12:5062Kamailio 5.5.2: 192.168.15.:5060
Part of the Kamailio.lua config:
-- wrapper around tm relay functionfunction ksr_route_relay()-- enable additional event routes for forwarded requests-- - serial forking, RTP relaying handling, a.s.o.if KSR.is_method_in("IBSU") thenif KSR.tm.t_is_set("branch_route")<0 thenKSR.dbg("EP: ksr_route_relay Set for branch_route\n");KSR.tm.t_on_branch("ksr_branch_manage");endendif KSR.is_method_in("ISU") thenif KSR.tm.t_is_set("onreply_route")<0 thenKSR.dbg("EP: ksr_route_relay Set for onreply_route\n");KSR.tm.t_on_reply("ksr_onreply_manage");endendif KSR.is_INVITE() thenif KSR.tm.t_is_set("failure_route")<0 thenKSR.dbg("EP: ksr_route_relay Set for failure\n");KSR.tm.t_on_failure("ksr_failure_manage");endendif KSR.tm.t_relay()<0 thenKSR.dbg("EP: ksr_route_relay Set for reply_error\n");KSR.sl.sl_reply_error();end-- EP: Base routeKSR.dbg("EP: ksr_route_relay Check for Base Route\n");if KSR.is_INVITE() thenKSR.dbg("EP: ksr_route_relay Base Route (DU)\n");--KSR.sl.send_reply("503", "Debug");KSR.setdsturi("sip:192.168.1.12:5062");endKSR.dbg("EP: ksr_route_relay exit\n");KSR.x.exit();end
What’s happening here is that instead of forwarding the INVITE to the SIPp UAC, it creates a loop. Tried KSR.setdsturi() only (KSR.pv.sets commented out) and it’s still the same.If I comment out the 503 reply, then that’s what the UAC gets back.
You have to set dst uri before KSR.tm.relay(), because that's the function that sends to the next hop. If you set it after it, then it is not used.
Cheers,
Daniel
-- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - Online Nov 08-11, 2021 (Europe Timezone) - Nov 22-25, 2021 (America Timezone) * https://www.asipto.com/sw/kamailio-advanced-training-online/