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