<div dir="ltr"><br><div>Hello</div><div>I have setup 2 gateways in my dr_rules: 5,6 - so the 2nd one is tried if the first fails.</div><div><br></div><div>The second one requires credentials.</div><div><br></div><div>When the first one fails: I execute the following code:</div><div><br></div><div>failure_route[ROUTEFAIL] {<br></div><div><br></div><div><div>        if ( t_check_status("[345][0-9][0-9]") or (t_branch_timeout() and !t_branch_replied() )) {</div><div>                t_on_failure("ROUTEFAIL");</div><div>                if (use_next_gw()) {</div><div>                        xlog("L_INFO","failure_route(ROUTEFAIL) @@ routing to: rd: $rd, ru:$ru, t_relay");</div><div>                        t_relay();</div><div>                        exit;</div><div>                }</div></div><div><br></div><div>then in the same ROUTEFAIL (before this code), I have</div><div><div><br></div><div>if (t_check_status("401|407")) {</div></div><div>xlog("L_INFO","failure_route(ROUTEFAIL) @@ call to uac_auth(),   $si rd: $rd\n");<br></div><div>.....</div><div><br></div><div>So, when the first gateway replies with a 404, it executes correctly the first block, finds the second gw and I see in the log that rd is set to its address. </div><div><br></div><div>Yet, when the 2nd gw replies with 401, rd is set to the very first gw. However, the pcap traces confirm it is indeed the second that replies this.</div><div><br></div><div>If this behaviour is correct, I cant seem to find the source IP of the gateway that replied to me, to retrieve credentials from the db.</div><div><br></div><div>version: kamailio 5.0.5 / 5.0.6 (tested on both)<br></div><div><br></div><div>Thank you for your help</div><div>J</div><div><br></div><div><br></div><div><br></div><div><br></div></div>