<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Titre content=""><meta name="Mots clés" content=""><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Courier New";
panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"Préformaté HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New",serif;}
tt
{mso-style-priority:99;
font-family:"Courier New",serif;}
span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:"Courier",serif;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.msoIns
{mso-style-type:export-only;
mso-style-name:"";
text-decoration:underline;
color:teal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:595.0pt 842.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body bgcolor=white lang=FR link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt'>Razvan, I’m trying to modify my code but without succes, please tell me what i’m wrong :<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>if (is_present_hf("X-Provider"))<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> $avp(lb_res) = $hdr(X-Provider);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> } else {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> send_reply("403","Forbidden");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> exit;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> if ( !lb_start("1","$avp(lb_res)") ) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> send_reply("503","Service full");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> exit;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> xlog("L_INFO","Sending Call to Provider $avp(lb_res), Gateway is : $du\n");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # arm a failure route for be able to catch a failure event and to do<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # failover to the next available destination<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> t_on_failure("LB_failed");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # send it out<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> $rd = $dd ;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> if (!t_relay()) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> sl_reply_error();<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>failure_route[LB_failed]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>{<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # skip if call was canceled<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> if (t_was_cancelled()) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> exit;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # was a destination failure ? (we do not want to do failover<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # if it was a call setup failure, so we look for 500 and 600<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # class replied and for local timeouts)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> if ( t_check_status("[56][0][03]") ||<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> (t_check_status("408") && t_local_replied("all") ) ) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # this is a case for failover<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> xlog("L_INFO","Gateway for provider $avp(lb_res) failed with code $T_reply_code for call to $rU");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> # try to re-route to next available destination<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> if ( !lb_start_or_next("1","$avp(lb_res)") ) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> send_reply("503","Service full");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> xlog("L_INFO","Route 2 : No resource for provider $avp(lb_res) for call to : $rU");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> exit;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> xlog("L_INFO","Re-routing call for Provider $avp(lb_res) to $du \n");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> t_relay();<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>xlog("L_INFO","Gateway for provider $avp(lb_res) failed with code $T_reply_code for call to $rU");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>I sent you my database ressources offlist, because there is some confidential data.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Thaks<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='color:black'>De : </span></b><span style='color:black'>Users <users-bounces@lists.opensips.org> au nom de Alain Bieuzent <alain.bieuzent@free.fr><br><b>Répondre à : </b>OpenSIPS users mailling list <users@lists.opensips.org><br><b>Date : </b>mercredi 30 août 2017 à 11:30<br><b>À : </b>OpenSIPS users mailling list <users@lists.opensips.org><br><b>Objet : </b>Re: [OpenSIPS-Users] Migrating from opensips 2.1.5 to 2.2.5</span><span style='color:black;mso-fareast-language:FR'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt'>Hi Razvan, </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>No i don’t modify my script, will check this new functions before continuing to bother you.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Many thanks</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='color:black'>De : </span></b><span style='color:black'>Users <users-bounces@lists.opensips.org> au nom de Răzvan Crainea <razvan@opensips.org><br><b>Répondre à : </b>OpenSIPS users mailling list <users@lists.opensips.org><br><b>Date : </b>mercredi 30 août 2017 à 11:01<br><b>À : </b><users@lists.opensips.org><br><b>Objet : </b>Re: [OpenSIPS-Users] Migrating from opensips 2.1.5 to 2.2.5</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p></div><p class=MsoNormal><tt><span style='font-size:10.0pt'>Hi, Alain!</span></tt><span style='font-size:10.0pt;font-family:"Courier New",serif'><br><br><tt>Did you also migrate your script functions from load_balancer() to lb_start() and lb_next()?</tt><br><tt>Can you post your database resources and the way you are using load_balancer in the script?</tt><br><br><tt>Best regards,</tt><br><br><br></span><o:p></o:p></p><pre>Răzvan Crainea<o:p></o:p></pre><pre>OpenSIPS Solutions<o:p></o:p></pre><pre><a href="http://www.opensips-solutions.com">www.opensips-solutions.com</a><o:p></o:p></pre><div><p class=MsoNormal>On 08/30/2017 11:40 AM, Alain Bieuzent wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='font-size:11.0pt'>Hi all,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>I’m trying to migrate my proxy from 2.1.5 to 2.2.5, since i migrate, i found a lot of log about load_balancer module (of course in 2.1.5 i don’t have this error logs). </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>For me this message have not impact on the call flow, but i think it’s not normal …..</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Someone can help me ?</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7719]: CRITICAL:load_balancer:get_dst_load: bug - cannot find request resource in dst</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7719]: WARNING:load_balancer:lb_route: initial call of LB - skipping destination 112 <sip:X.X.X.X:5060> - unable to calculate free resources</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7722]: CRITICAL:load_balancer:get_dst_load: bug - cannot find request resource in dst</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7722]: WARNING:load_balancer:lb_route: initial call of LB - skipping destination 112 <sip:X.X.X.X:5060> - unable to calculate free resources</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7720]: CRITICAL:load_balancer:get_dst_load: bug - cannot find request resource in dst</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7720]: WARNING:load_balancer:lb_route: initial call of LB - skipping destination 101 <sip:Y.Y.Y.Y:5060> - unable to calculate free resources</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7720]: CRITICAL:load_balancer:get_dst_load: bug - cannot find request resource in dst</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7720]: WARNING:load_balancer:lb_route: initial call of LB - skipping destination 102 <sip:Z.Z.Z.Z:5060> - unable to calculate free resources</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7721]: CRITICAL:load_balancer:get_dst_load: bug - cannot find request resource in dst</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7721]: WARNING:load_balancer:lb_route: initial call of LB - skipping destination 101 <sip:Y.Y.Y.Y:5060> - unable to calculate free resources</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7718]: CRITICAL:load_balancer:get_dst_load: bug - cannot find request resource in dst</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7718]: WARNING:load_balancer:lb_route: initial call of LB - skipping destination 101 <sip:Y.Y.Y.Y:5060> - unable to calculate free resources</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7723]: CRITICAL:load_balancer:get_dst_load: bug - cannot find request resource in dst</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Aug 30 10:30:27 ded-lb-out-master opensips[7723]: WARNING:load_balancer:lb_route: initial call of LB - skipping destination 101 <sip:Y.Y.Y.Y:5060> - unable to calculate free resources</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>Regards, Alain</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;mso-fareast-language:FR'><br><br><br><br></span><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>Users mailing list<o:p></o:p></pre><pre><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><o:p></o:p></pre><pre><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre></blockquote><p class=MsoNormal><span style='font-size:11.0pt;mso-fareast-language:FR'><br>_______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;mso-fareast-language:FR'>_______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users <o:p></o:p></span></p></div></body></html>