Hi Bogdan,<br><br>I deleted other destinations to re-produce this case. It behaves in the same way when there are 10 destinations per group_id and all of them are busy, etc.<br><br>And I have priorities between destinations. This is why I can not add all of them into the same group_id. First, I&#39;m trying to balance the load in the destinations with higher priority (with group_id 8080), if I can not I&#39;m trying to use a group_id with lower priority (9090).<br>
<br>Anyway, thanks for your help,<br>Taner<br><br><div class="gmail_quote">On Wed, Dec 9, 2009 at 7:25 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Taner,<br>
<br>
Why do you have only one record per group in the LB table ? there is no<br>
LB if you have only one destination ;). It simply makes no sense.<br>
<br>
Better put both destinations in the same group and LB over them both,<br>
with failover too:<br>
<div class="im"><br>
+----+----------+-----------------------+-----------+------------+-------------+<br>
| id | group_id | dst_uri               | resources | probe_mode |<br>
description |<br>
+----+----------+-----------------------+-----------+------------+-------------+<br>
</div>| 1  |  8080    | <a href="mailto:sip%3Aservice@host1.net">sip:service@host1.net</a> &lt;mailto:<a href="mailto:sip%253Aservice@host1.net">sip%3Aservice@host1.net</a>&gt;<br>
| sip=1     |          2 |             |<br>
| 2  |  8080    | <a href="mailto:sip%3Aservice@host2.net">sip:service@host2.net</a> &lt;mailto:<a href="mailto:sip%253Aservice@host2.net">sip%3Aservice@host2.net</a>&gt;<br>
| sip=1     |          2 |             |<br>
+----+----------+-----------------------+-----------+------------+-------------+<br>
<div class="im"><br>
route[3] {<br>
        if (is_method(&quot;INVITE&quot;)) {<br>
<br>
            load_balance(&quot;8080&quot;, &quot;sip&quot;);<br>
            if ($retcode &lt; 0) {<br>
                xlog(&quot;L_INFO&quot;, &quot;load_balancer: Insufficient resource to<br>
</div>balance request from $fu to $tu !\n&quot;);<br>
                send_reply(&quot;500&quot;,&quot;no resources available&quot;);<br>
<div class="im">                exit;<br>
            }<br>
            t_on_failure(&quot;2&quot;);<br>
        }<br>
<br>
<br>
        # send request<br>
        if (!t_relay()) {<br>
                sl_reply_error();<br>
        }<br>
        exit;<br>
}<br>
<br>
failure_route[2] {<br>
        if (t_was_cancelled()) {<br>
                exit;<br>
        }<br>
<br>
        if (t_check_status(&quot;486|408&quot;)) {<br>
            xlog(&quot;L_INFO&quot;, &quot;load_balancer: Request from $fu to $tu<br>
</div>failed. Re-balancing!\n&quot;);<br>
<div class="im">            lb_disable();<br>
            load_balance(&quot;8080&quot;, &quot;sip&quot;);<br>
<br>
            if ($retcode &lt; 0) {<br>
                xlog(&quot;L_INFO&quot;, &quot;load_balancer: Insufficient resource to<br>
</div>balance request from $fu to $tu \n&quot;);<br>
                send_reply(&quot;500&quot;,&quot;no resources available&quot;);<br>
<div class="im">                exit;<br>
            }<br>
            t_on_failure(&quot;2&quot;);<br>
</div>            t_relay();<br>
<div class="im">        }<br>
}<br>
<br>
<br>
<br>
Regards,<br>
Bogdan<br>
<br>
<br>
Taner Sener wrote:<br>
</div><div class="im">&gt; Hi Bogdan,<br>
&gt;<br>
&gt; I used your approach and defined the same resource name &quot;sip&quot; for both<br>
&gt; definitions. It is working now as expected but another requirement<br>
&gt; raised for my scenario.<br>
&gt;<br>
&gt; When all destinations for a specific group id are busy I want to re<br>
&gt; load-balance the request to a different group id. I expect this to run<br>
&gt; with the following configuration but it is not possible to re<br>
&gt; load_balance the request. I hope you can help me to find a solution.<br>
&gt;<br>
&gt; I&#39;m testing this the following configuration. I&#39;m making a call to<br>
</div>&gt; 8080. If <a href="mailto:service@host1.net">service@host1.net</a> &lt;mailto:<a href="mailto:service@host1.net">service@host1.net</a>&gt; is busy or if it<br>
<div class="im">&gt; receives timeout I expect call to be re load-balanced to a destination<br>
&gt; from group id 9090. But it is not.<br>
&gt;<br>
&gt; load_balancer<br>
&gt; +----+----------+-----------------------+-----------+------------+-------------+<br>
&gt; | id | group_id | dst_uri               | resources | probe_mode |<br>
&gt; description |<br>
&gt; +----+----------+-----------------------+-----------+------------+-------------+<br>
&gt; | 1 |  8080 |  <a href="mailto:sip%3Aservice@host1.net">sip:service@host1.net</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253Aservice@host1.net">sip%3Aservice@host1.net</a>&gt;   | sip=1     |          2<br>
<div class="im">&gt; |             |<br>
&gt; | 2 |  9090 |  <a href="mailto:sip%3Aservice@host2.net">sip:service@host2.net</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253Aservice@host2.net">sip%3Aservice@host2.net</a>&gt;   | sip=1     |          2<br>
<div><div></div><div class="h5">&gt; |             |<br>
&gt; +----+----------+-----------------------+-----------+------------+-------------+<br>
&gt;<br>
&gt; opensips.cfg<br>
&gt; ....<br>
&gt; route {<br>
&gt;         ...<br>
&gt;         route(3);<br>
&gt; }<br>
&gt;<br>
&gt; route[3] {<br>
&gt;         if (is_method(&quot;INVITE&quot;)) {<br>
&gt;<br>
&gt;             load_balance(&quot;8080&quot;, &quot;sip&quot;);<br>
&gt;             if ($retcode &lt; 0) {<br>
&gt;                 xlog(&quot;L_INFO&quot;, &quot;load_balancer: Insufficient resource<br>
&gt; to balance request from $fu to $tu . Re-balancing to route 4!\n&quot;);<br>
&gt;                 route(4);<br>
&gt;             }<br>
&gt;         }<br>
&gt;<br>
&gt;         t_on_failure(&quot;2&quot;);<br>
&gt;<br>
&gt;         # send request<br>
&gt;         if (!t_relay()) {<br>
&gt;                 sl_reply_error();<br>
&gt;         }<br>
&gt;         exit;<br>
&gt; }<br>
&gt;<br>
&gt; route[4] {<br>
&gt;         if (is_method(&quot;INVITE&quot;)) {<br>
&gt;<br>
&gt;             load_balance(&quot;9090&quot;, &quot;sip&quot;);<br>
&gt;             if ($retcode &lt; 0) {<br>
&gt;                 xlog(&quot;L_INFO&quot;, &quot;load_balancer: Insufficient resource<br>
&gt; to balance request from $fu to $tu . Sending error!\n&quot;);<br>
&gt;                 sl_send_reply(&quot;500&quot;, &quot;Service full&quot;);<br>
&gt;                 exit;<br>
&gt;             }<br>
&gt;         }<br>
&gt;<br>
&gt;         t_on_failure(&quot;2&quot;);<br>
&gt;<br>
&gt;         # send request<br>
&gt;         if (!t_relay()) {<br>
&gt;                 sl_reply_error();<br>
&gt;         }<br>
&gt;         exit;<br>
&gt; }<br>
&gt;<br>
&gt; failure_route[2] {<br>
&gt;         if (t_was_cancelled()) {<br>
&gt;                 exit;<br>
&gt;         }<br>
&gt;<br>
&gt;         if (t_check_status(&quot;486|408&quot;)) {<br>
&gt;             xlog(&quot;L_INFO&quot;, &quot;load_balancer: Request from $fu to $tu<br>
&gt; failed. Re-balancing to 8080!\n&quot;);<br>
&gt;             lb_disable();<br>
&gt;             load_balance(&quot;8080&quot;, &quot;sip&quot;);<br>
&gt;<br>
&gt;             if ($retcode &lt; 0) {<br>
&gt;                 xlog(&quot;L_INFO&quot;, &quot;load_balancer: Insufficient resource<br>
&gt; to balance request from $fu to $tu . Re-balancing to route 4!\n&quot;);<br>
&gt;                 route(4);<br>
&gt;             }<br>
&gt;             t_on_failure(&quot;2&quot;);<br>
&gt;             t_relay();<br>
&gt;         }<br>
&gt; }<br>
&gt;<br>
&gt; opensips.log<br>
&gt; ...<br>
&gt; Dec  8 10:56:57 sipproxy /sbin/opensips[11299]: load_balancer: Request<br>
</div></div>&gt; from <a href="mailto:sip%3Atest@10.10.5.10">sip:test@10.10.5.10</a> &lt;mailto:<a href="mailto:sip%253Atest@10.10.5.10">sip%3Atest@10.10.5.10</a>&gt; to<br>
&gt; <a href="http://sip:8080@10.10.6.6:5060" target="_blank">sip:8080@10.10.6.6:5060</a> &lt;<a href="http://sip:8080@10.10.6.6:5060" target="_blank">http://sip:8080@10.10.6.6:5060</a>&gt; failed.<br>
<div class="im">&gt; Re-balancing to 8080!<br>
&gt; Dec  8 10:56:57 sipproxy /sbin/opensips[11299]: load_balancer:<br>
&gt; Insufficient resource to balance request from <a href="mailto:sip%3Atest@10.10.5.10">sip:test@10.10.5.10</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253Atest@10.10.5.10">sip%3Atest@10.10.5.10</a>&gt; to <a href="http://sip:8080@10.10.6.6:5060" target="_blank">sip:8080@10.10.6.6:5060</a><br>
&gt; &lt;<a href="http://sip:8080@10.10.6.6:5060" target="_blank">http://sip:8080@10.10.6.6:5060</a>&gt; . Re-balancing to route 4!<br>
<div class="im">&gt; Dec  8 10:56:57 sipproxy /sbin/opensips[11299]: load_balancer:<br>
&gt; Insufficient resource to balance request from <a href="mailto:sip%3Atest@10.10.5.10">sip:test@10.10.5.10</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253Atest@10.10.5.10">sip%3Atest@10.10.5.10</a>&gt; to <a href="http://sip:8080@10.10.6.6:5060" target="_blank">sip:8080@10.10.6.6:5060</a><br>
&gt; &lt;<a href="http://sip:8080@10.10.6.6:5060" target="_blank">http://sip:8080@10.10.6.6:5060</a>&gt; . Sending error!<br>
<div class="im">&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Taner<br>
&gt;<br>
&gt;<br>
&gt; On Sun, Nov 15, 2009 at 10:12 PM, Bogdan-Andrei Iancu<br>
</div><div class="im">&gt; &lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a> &lt;mailto:<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Hi Taner,<br>
&gt;<br>
&gt;     I would suggest a different approach - as from LB point of view you do<br>
&gt;     not care too much if it VM or CONF - what is important is that each of<br>
&gt;     your box has only on channel, so I would define a resource the<br>
&gt;     number of<br>
&gt;     channels each box can handle .<br>
&gt;<br>
&gt;     +----+----------+------------------------+---------------------------------+<br>
&gt;     | id | group_id | dst_uri                | resources<br>
&gt;             |<br>
&gt;     +----+----------+------------------------+---------------------------------+<br>
&gt;<br>
&gt;     |  1 |      555 |  <a href="mailto:sip%3Aservice@host1.net">sip:service@host1.net</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:sip%253Aservice@host1.net">sip%3Aservice@host1.net</a>&gt; &lt;mailto:<a href="mailto:sip%253Aservice@host1.net">sip%3Aservice@host1.net</a><br>
&gt;     &lt;mailto:<a href="mailto:sip%25253Aservice@host1.net">sip%253Aservice@host1.net</a>&gt;&gt; | channel=1<br>
<div class="im">&gt;         |<br>
&gt;     |  2 |      555 |  <a href="mailto:sip%3Aservice@host2.net">sip:service@host2.net</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:sip%253Aservice@host2.net">sip%3Aservice@host2.net</a>&gt; &lt;mailto:<a href="mailto:sip%253Aservice@host2.net">sip%3Aservice@host2.net</a><br>
&gt;     &lt;mailto:<a href="mailto:sip%25253Aservice@host2.net">sip%253Aservice@host2.net</a>&gt;&gt; | channel=1<br>
<div class="im">&gt;         |<br>
&gt;<br>
&gt;     +----+----------+------------------------+---------------------------------+<br>
&gt;<br>
&gt;<br>
&gt;     and do (when routing a VM or conference call) :<br>
&gt;        &#39;load_balance(.., &quot;channel&quot;);&#39;<br>
&gt;<br>
&gt;     Regards,<br>
&gt;     Bogdan<br>
&gt;<br>
&gt;<br>
&gt;     Taner Sener wrote:<br>
&gt;     &gt; Hi,<br>
&gt;     &gt;<br>
&gt;     &gt; I&#39;m using load balancer module on 1.6.0-notls (i386/linux) to<br>
&gt;     balance<br>
&gt;     &gt; incoming sip calls to sip clients. The case is; my sip clients are<br>
&gt;     &gt; capable of serving multiple types of calls. But not in the same time<br>
&gt;     &gt; like in the definition &quot;vm=1;conf=1&quot;. Only one of them is<br>
&gt;     available at<br>
&gt;     &gt; that moment. They can process either a vm call, either a conf call;<br>
&gt;     &gt; not one vm call and one conf call. Is there a way to define it?<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     +----+----------+------------------------+---------------------------------+<br>
&gt;     &gt; | id | group_id | dst_uri                | resources<br>
&gt;               |<br>
&gt;     &gt;<br>
&gt;     +----+----------+------------------------+---------------------------------+<br>
&gt;     &gt;<br>
&gt;     &gt; |  1 |      555 |  <a href="mailto:sip%3Aservice@host1.net">sip:service@host1.net</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:sip%253Aservice@host1.net">sip%3Aservice@host1.net</a>&gt; &lt;mailto:<a href="mailto:sip%253Aservice@host1.net">sip%3Aservice@host1.net</a><br>
&gt;     &lt;mailto:<a href="mailto:sip%25253Aservice@host1.net">sip%253Aservice@host1.net</a>&gt;&gt; | vm=1; conf=1<br>
<div class="im">&gt;        |<br>
&gt;     &gt; |  2 |      555 |  <a href="mailto:sip%3Aservice@host2.net">sip:service@host2.net</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:sip%253Aservice@host2.net">sip%3Aservice@host2.net</a>&gt; &lt;mailto:<a href="mailto:sip%253Aservice@host2.net">sip%3Aservice@host2.net</a><br>
&gt;     &lt;mailto:<a href="mailto:sip%25253Aservice@host2.net">sip%253Aservice@host2.net</a>&gt;&gt; | vm=1; conf=1<br>
<div class="im">&gt;        |<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     +----+----------+------------------------+---------------------------------+<br>
&gt;     &gt;<br>
&gt;     &gt; Current &#39;resources&#39; field of load_balancer table ANDs resource types<br>
&gt;     &gt; given with semi-colon and I when I invoke<br>
&gt;     &gt;<br>
&gt;     &gt; &#39;load_balance(.., &quot;vm&quot;)&#39;<br>
&gt;     &gt;<br>
&gt;     &gt; and<br>
&gt;     &gt;<br>
&gt;     &gt; &#39;load_balance(.., &quot;conf&quot;)&#39;<br>
&gt;     &gt;<br>
&gt;     &gt; second load balanced call receives busy and balancing fails there<br>
&gt;     &gt; because that client is serving to vm call. How can I configure<br>
&gt;     &gt; load_balanced module to select it right?<br>
&gt;     &gt;<br>
&gt;     &gt; Thanks,<br>
&gt;     &gt; Taner<br>
&gt;     &gt;<br>
&gt;     ------------------------------------------------------------------------<br>
&gt;     &gt;<br>
&gt;     &gt; _______________________________________________<br>
&gt;     &gt; Users mailing list<br>
</div>&gt;     &gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> &lt;mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&gt;<br>
<div class="im">&gt;     &gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;     &gt;<br>
&gt;<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     Users mailing list<br>
</div>&gt;     <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> &lt;mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&gt;<br>
<div class="im">&gt;     <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
&gt;<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
<br>
<br>
</div><font color="#888888">--<br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>