<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>Hi Alain,<br>
<br>
So the resource is dynamically determined - do you have an xlog
before the lb_start() to print the value of the variable, to see
which is the actual requested resource ?<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2018
<a class="moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2018/">http://opensips.org/training/OpenSIPS_Bootcamp_2018/</a>
</pre>
<div class="moz-cite-prefix">On 10/24/2018 10:08 AM, Alain Bieuzent
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:AFB5AD52-B40B-489E-BA65-EEE0B0699E37@free.fr">
<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:"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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 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";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:Consolas;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;}
span.shorttext
{mso-style-name:short_text;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">Hi
Bogdan,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">The
second parameter is a variable I extracts from a sip Header.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">#
detect resources and store in an AVP<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
if (is_present_hf("X-Provider"))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
xlog("L_WARN","Header X-Provider exist for call to : $rU");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
$avp(lb_res) = $hdr(X-Provider);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
} else {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
send_reply("403","Forbidden");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
xlog("L_WARN","Header X-Provider missing for call to :
$rU");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">…….<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
if ( !lb_start("1","$avp(lb_res)") ) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
send_reply("503","Service full");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
xlog("L_WARM","Route 1 : No resource or full 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" lang="EN-US">
exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">
}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">Regards</span><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">Bogdan-Andrei Iancu
<a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org"><bogdan@opensips.org></a><br>
<b>Date : </b>mardi 23 octobre 2018 à 19:22<br>
<b>À : </b>OpenSIPS users mailling list
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a>, Alain Bieuzent
<a class="moz-txt-link-rfc2396E" href="mailto:alain.bieuzent@free.fr"><alain.bieuzent@free.fr></a><br>
<b>Objet : </b>Re: [OpenSIPS-Users] Load_balancer
migrating from 2.1 to 2.4</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">Hi Alain,<br>
<br>
What are the resources you require via the lb_start() - the
second parameter ?<br>
<br>
Best regards,<br>
<br>
<o:p></o:p></p>
<pre>Bogdan-Andrei Iancu<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>OpenSIPS Founder and Developer<o:p></o:p></pre>
<pre> <a href="http://www.opensips-solutions.com" moz-do-not-send="true">http://www.opensips-solutions.com</a><o:p></o:p></pre>
<pre>OpenSIPS Bootcamp 2018<o:p></o:p></pre>
<pre> <a href="http://opensips.org/training/OpenSIPS_Bootcamp_2018/" moz-do-not-send="true">http://opensips.org/training/OpenSIPS_Bootcamp_2018/</a><o:p></o:p></pre>
<div>
<p class="MsoNormal">On 10/23/2018 06:28 PM, 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"
lang="EN-US">Hi all,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"
lang="EN-US">I’m trying to migrate from 2.1.5 to 2.4.2, i
modify my script to use the new lb_start() function, but
now i received a lot of CRITICAL and WARNING message in my
logs.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"
lang="EN-US">Oct 23 14:29:13 ded-lb-out-slave
opensips[3592]: 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"
lang="EN-US">Oct 23 14:29:13 ded-lb-out-slave
opensips[3592]: WARNING:load_balancer:lb_route: initial
call of LB - skipping destination 168 <a
href="sip:31.169.63.1:5060" moz-do-not-send="true"><sip:31.169.63.1:5060></a>
- unable to calculate free resources</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"
lang="EN-US">Oct 23 14:29:13 ded-lb-out-slave
opensips[3592]: 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"
lang="EN-US">Oct 23 14:29:13 ded-lb-out-slave
opensips[3592]: WARNING:load_balancer:lb_route: initial
call of LB - skipping destination 169 <a
href="sip:31.169.63.2:5060" moz-do-not-send="true"><sip:31.169.63.2:5060></a>
- unable to calculate free resources</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US">in the past I had already tried to migrate
from 2.1.5 to 2.3 with the same error message.</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US">I do not use the module to limit the number
of calls (the resources are set to 10000), I’m using it
only to load balance traffic between these 3 trunks. If a
call is dropped, I don’t use lb_next to retry to another.</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal">id,group_id,dst_uri,resources,probe_mode,description<o:p></o:p></p>
<p class="MsoNormal">172,1,<a
href="sip:X.Y.Z.107:5060,WTF=10000,2"
moz-do-not-send="true">sip:X.Y.Z.107:5060,WTF=10000,2</a>,"WTF
Trunk 1"<o:p></o:p></p>
<p class="MsoNormal">173,1,<a
href="sip:X.Y.Z.108:5060,WTF=10000,2"
moz-do-not-send="true">sip:X.Y.Z.108:5060,WTF=10000,2</a>,"WTF
Trunk 2"<o:p></o:p></p>
<p class="MsoNormal">174,1,<a
href="sip:W.Y.Z.109:5060,WTF=10000,2"
moz-do-not-send="true">sip:W.Y.Z.109:5060,WTF=10000,2</a>,"WTF
Trunk 3"<o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US">Any idea to why i received this error message
(which does not seem to have any impact on the calls)</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US">Thanks </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"
lang="EN-US">Alain</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;mso-fareast-language:FR"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Users mailing list<o:p></o:p></pre>
<pre><a href="mailto:Users@lists.opensips.org" moz-do-not-send="true">Users@lists.opensips.org</a><o:p></o:p></pre>
<pre><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" moz-do-not-send="true">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>
<br>
<o:p></o:p></span></p>
</div>
</blockquote>
<br>
</body>
</html>