<div><div dir="auto">Mike,</div></div><div dir="auto"><br></div><div dir="auto">    Your likely running into an issue where your changes are not actually applied.  Check out msg_apply_changes() or something of the such.</div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 12, 2018 at 6:52 AM Mike Montgomery <<a href="mailto:mmontgomery@trust-tek.com">mmontgomery@trust-tek.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">We have a situation where we get a redirect from a carrier with a list of carriers to send the transaction to in the contact header. None of the carriers in the contact header have q values assigned. <div><br></div><div>We have implemented our redirect handling logic using the UAC_REDIRECT module (get_redirects()) with help from TM module (t-load_contacts(), t_next_contact()). (failure_route code is at bottom of this note)</div><div><br></div><div>We find that when we receive a contact header with q values, we can launch requests serially using t_next_contact() and individually work through the contact list until we get a positive response. When we get a redirect with no q values in the contact header we find that all contacts get loaded and launched in parallel.</div><div><br></div><div>Although not stated in the documentation, it appears that in order to implement serial contact redirect handling, q values must be present in the contact header. Based on this assumption, and knowing that the redirecting carrier cannot include q values, we have attempted to modify the contact header and find that we are unable to add q values to the contact header.</div><div><br></div><div>We have attempted without success to use remove_hf("Contact”) followed by append_hf("Contact: $(avp(contact)) \r\n”); where $(avp(contact)) is the avp where we have rewritten the contact header to include q values.</div><div><br></div><div>Any guidance on how to handle this issue is appreciated.</div><div><br></div><div>_________________________________________________________-</div><div><br></div><div>Our failure route code:</div><div><div>        if (t_check_status("3[0-9][0-9]")) {</div><div>                xlog("L_INFO", "----> REDIRECT Contact Header --> $T_rpl($ct) --- Method $rm --- From $T_req($fu) --- To $T_req($tu) --- Destination $T_req($du) \n");</div><div>                get_redirects("*:*");</div><div><br></div><div>                if (!t_load_contacts()) {</div><div>                        xlog("L_INFO", "-t_load_contacts() FAILED /n");</div><div>                };</div><div><br></div><div>                        xlog("L_INFO", "####->LOAD CONTACT LIST $xavp(tm_contacts[0]=>uri) \n");</div><div><br></div><div>                if (t_next_contacts()) {</div><div>                        xlog("L_INFO", "-t_next_contact() loaded successfully /n");</div><div>                        xlog("L_INFO", "####-> NEXT CONTACT LIST $xavp(tm_contacts[0]=>uri) \n");</div><div>                };</div><div>                t_on_failure("serial");</div><div><br></div><div>                if(t_relay()){</div><div>                    xlog("L_INFO","----->Relayed in MANAGE_FAILURE --- Method $rm --- Contact Header $ct \n");</div><div>                 };</div><div>                exit;</div><div>        } else {</div><div>                xlog("L_INFO","-----> NO REDIRECT --- Method $rm --- Contact Header $ct \n");</div><div>                exit;</div><div>        }</div><div><br></div><div><div>failure_route["serial"] {</div><div>        xlog ("L_INFO", "Entered failure_route(serial) /n");</div><div>        if (t_check_status("3[0-9][0-9]")) {</div><div>                xlog("L_INFO", "----> DOUBLE REDIRECT Contact Header --> $T_rpl($ct) --- Method $rm --- From $T_req($fu) --- To $T_req($tu) --- Destination $T_req($du) \n");</div><div>                $xavp(tm_contacts[*]) = $null;</div><div>                xlog("L_INFO", "XXX-> tm_contacts reset to Null $xavp(tm_contacts[0]=>uri)\n");</div><div><br></div><div>                get_redirects("*:*");</div><div><br></div><div>                if (!t_load_contacts()) {</div><div>                        xlog("L_INFO", "-t_load_contacts() FAILED /n");</div><div>                };</div><div><br></div><div>                        xlog("L_INFO", "####-> LOAD 2 CONTACT LIST $xavp(tm_contacts[0]=>uri) \n");</div><div><br></div><div>        }</div><div>        if (!t_next_contacts()) {</div><div>                exit;</div><div>        }</div><div><br></div><div>        xlog("L_INFO", "-t_next_contact() loaded successfully /n");</div><div>        xlog("L_INFO", "####-> NEXT CONTACT LIST $xavp(tm_contacts[0]=>uri) \n");</div><div><br></div><div>        t_on_failure("serial");</div><div>        if(t_relay()){</div><div>            xlog("L_INFO","----->Relayed in failure_route(serial) --- Method $rm --- Contact Header $ct \n");</div><div>        };</div><div>}</div></div><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><br>Best Regards,<br><br> Mike Montgomery<br> Principal, Trusted Technical Services, Inc.</div></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"> o - 919 924 4703  x3000</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"> m - 919 539 6133</div><br class="m_8913723025578634258Apple-interchange-newline"><span><img src="cid:16709e73578e6843be11" style="width:264px;max-width:100%"></span>
</div>
<br></div></div>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Sent from Gmail Mobile</div>