<div dir="ltr">Hello all,<div><br></div><div>Just started using v5.4.0 on our system and I noticed a change in behavior when doing the append_branch, t_load_contacts, and t_next_contacts combo.  Previously using v5.3.4 and it appears to be fine.</div><div><br></div><div>Here's the call scenario: Kamailio receives a call to sip:1001@carrierB.  Kamailio sees carrierB and appends 2 contacts: <a href="http://gateway1.carrierB.com">gateway1.carrierB.com</a>;q=0.3 and <a href="http://gateway2.carrierB.com">gateway2.carrierB.com</a>;q=0.2.  After t_load_branches(0), I expect to see $rd to be changed to <a href="http://gateway1.carrierB.com">gateway1.carrierB.com</a>, but it's not.</div><div><br></div><div>This is the piece of config I'm trying to debug:</div><div>        <font face="monospace">xlog ("=== branch 0: $(branch(uri)[0]), $(branch(q)[0])\n");<br>    xlog ("=== branch 1: $(branch(uri)[1]), $(branch(q)[1])\n");<br>    t_load_contacts(0);<br>    while (t_next_contacts()) {<br>        xlog ("=== rd = $rd\n");<br>    }</font><br></div><div><br></div><div>This is the log I get.  It appears to use the backup contact first.</div><div><font face="monospace">ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: === branch 0: <a href="mailto:sip%3A1001@gateway2.carrierB.com">sip:1001@gateway2.carrierB.com</a>;transport=udp, 200<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: === branch 1: <a href="mailto:sip%3A1001@gateway1.carrierB.com">sip:1001@gateway1.carrierB.com</a>;transport=tcp, 300<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: tm [t_serial.c:522]: t_load_contacts(): load_contact mode selected: 0<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: tm [t_serial.c:340]: ki_t_load_contacts_mode(): nr_branches is 2<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: <core> [core/xavp.c:539]: xavp_destroy_list(): destroying xavp list 0x7f983cb66608<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: tm [t_serial.c:890]: ki_t_next_contacts(): Appending branch <a href="mailto:uri-%27sip%3A1001@gateway1.carrierB.com">uri-'sip:1001@gateway1.carrierB.com</a>;transport=tcp' dst-'' path-'' inst-'' ruid-'' location_ua-''<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: <core> [core/xavp.c:539]: xavp_destroy_list(): destroying xavp list 0x7f983cb66350<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: === rd = carrierB<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: <core> [core/xavp.c:539]: xavp_destroy_list(): destroying xavp list 0x7f983cb66078<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: === rd = <a href="http://gateway2.carrierB.com">gateway2.carrierB.com</a><br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818053427-1-23@172.18.1.21">sipp-ci1-20200818053427-1-23@172.18.1.21</a>: tm [t_serial.c:627]: ki_t_next_contacts(): no contacts in contacts_avp - we are done!</font><br></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">t_load_contacts(1) works a little better.  But we don't need the probability feature.</font></div><div><font face="monospace">ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: === branch 0: <a href="mailto:sip%3A1001@gateway2.carrierB.com">sip:1001@gateway2.carrierB.com</a>;transport=udp, 200<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: === branch 1: <a href="mailto:sip%3A1001@gateway1.carrierB.com">sip:1001@gateway1.carrierB.com</a>;transport=tcp, 300<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: tm [t_serial.c:522]: t_load_contacts(): load_contact mode selected: 1<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: tm [t_serial.c:340]: ki_t_load_contacts_mode(): nr_branches is 2<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: tm [t_serial.c:280]: t_load_contacts_proportional(): proportionally selected contact with uri: <a href="mailto:sip%3A1001@gateway1.carrierB.com">sip:1001@gateway1.carrierB.com</a>;transport=tcp (q: 300, random: 287, q_index: 500, q_total: 500)<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: tm [t_serial.c:280]: t_load_contacts_proportional(): proportionally selected contact with uri: <a href="mailto:sip%3A1001@gateway2.carrierB.com">sip:1001@gateway2.carrierB.com</a>;transport=udp (q: 200, random: 157, q_index: 200, q_total: 200)<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: tm [t_serial.c:303]: t_load_contacts_proportional(): proportionally added backup contact with uri: sip:1001@carrierB SIP/2.0#015#012Via: SIP/2.0/UDP 172.18.1.21:5060;branch=z9hG4bK-21-1-0 blah blah blah (q: -1)<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: <core> [core/xavp.c:539]: xavp_destroy_list(): destroying xavp list 0x7f6e457ec078<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: === rd = <a href="http://gateway1.carrierB.com">gateway1.carrierB.com</a><br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: <core> [core/xavp.c:539]: xavp_destroy_list(): destroying xavp list 0x7f6e457ec350<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: === rd = <a href="http://gateway2.carrierB.com">gateway2.carrierB.com</a><br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: <core> [core/xavp.c:539]: xavp_destroy_list(): destroying xavp list 0x7f6e457ec608<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: === rd = carrierB<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818054736-1-21@172.18.1.21">sipp-ci1-20200818054736-1-21@172.18.1.21</a>: tm [t_serial.c:627]: ki_t_next_contacts(): no contacts in contacts_avp - we are done!</font><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">As a comparison, this is what we've been getting in 5.3.4</font></div><div><font face="monospace">ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: === branch 0: <a href="mailto:sip%3A1001@gateway2.carrierB.com">sip:1001@gateway2.carrierB.com</a>;transport=udp, 200<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: === branch 1: <a href="mailto:sip%3A1001@gateway1.carrierB.com">sip:1001@gateway1.carrierB.com</a>;transport=tcp, 300<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: tm [t_serial.c:191]: ki_t_load_contacts(): nr_branches is 2<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: <core> [core/xavp.c:529]: xavp_destroy_list(): destroying xavp list 0x7fe13146a680<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: === rd = <a href="http://gateway1.carrierB.com">gateway1.carrierB.com</a><br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: <core> [core/xavp.c:529]: xavp_destroy_list(): destroying xavp list 0x7fe13146a3a8<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: === rd = <a href="http://gateway2.carrierB.com">gateway2.carrierB.com</a><br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: <core> [core/xavp.c:529]: xavp_destroy_list(): destroying xavp list 0x7fe13146a0d0<br>ERROR: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: === rd = carrierB<br>DEBUG: IBG_LOG: <a href="mailto:sipp-ci1-20200818055736-1-21@172.18.1.21">sipp-ci1-20200818055736-1-21@172.18.1.21</a>: tm [t_serial.c:460]: ki_t_next_contacts(): no contacts in contacts_avp - we are done!</font><font face="arial, sans-serif"><br></font></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">Is there anything else that's been changed in branch building that we should pay attention to?  Thanks.</span><br></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">Cindy</span></div><div><font face="arial, sans-serif"><br></font></div></div>