Hi Bogdan,<br><br>I used your approach and defined the same resource name "sip" for both definitions. It is working now as expected but another requirement raised for my scenario.<br><br>When all destinations for a specific group id are busy I want to re load-balance the request to a different group id. I expect this to run with the following configuration but it is not possible to re 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 8080. If <a href="mailto:service@host1.net">service@host1.net</a> is busy or if it receives timeout I expect call to be re load-balanced to a destination from group id 9090. But it is not. <br>
<br>load_balancer<br>+----+----------+-----------------------+-----------+------------+-------------+<br>
| id | group_id | dst_uri | resources | probe_mode | description |<br>+----+----------+-----------------------+-----------+------------+-------------+<br>| 1 | 8080 | <a href="mailto:sip%3Aservice@host1.net" target="_blank">sip:service@host1.net</a> | sip=1 | 2 | | <br>
| 2 | 9090 | <a href="mailto:sip%3Aservice@host2.net" target="_blank">sip:service@host2.net</a> | sip=1 | 2 | | <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 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 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 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 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
from <a href="mailto:sip%3Atest@10.10.5.10">sip:test@10.10.5.10</a> to <a href="http://sip:8080@10.10.6.6:5060">sip:8080@10.10.6.6:5060</a> failed.
Re-balancing to 8080! <br>
Dec 8 10:56:57 sipproxy /sbin/opensips[11299]: load_balancer:
Insufficient resource to balance request from <a href="mailto:sip%3Atest@10.10.5.10">sip:test@10.10.5.10</a> to <a href="http://sip:8080@10.10.6.6:5060">sip:8080@10.10.6.6:5060</a> .
Re-balancing to route 4! <br>
Dec 8 10:56:57 sipproxy /sbin/opensips[11299]: load_balancer:
Insufficient resource to balance request from <a href="mailto:sip%3Atest@10.10.5.10">sip:test@10.10.5.10</a> to <a href="http://sip:8080@10.10.6.6:5060">sip:8080@10.10.6.6:5060</a> . Sending
error!<br><br><br>Thanks,<br>Taner<br><br><br><div class="gmail_quote">On Sun, Nov 15, 2009 at 10:12 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro" target="_blank">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>
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 number of<br>
channels each box can handle .<br>
<div><br>
+----+----------+------------------------+---------------------------------+<br>
| id | group_id | dst_uri | resources |<br>
+----+----------+------------------------+---------------------------------+<br>
<br>
</div>| 1 | 555 | <a href="mailto:sip%3Aservice@host1.net" target="_blank">sip:service@host1.net</a> <mailto:<a href="mailto:sip%253Aservice@host1.net" target="_blank">sip%3Aservice@host1.net</a>> | channel=1 |<br>
| 2 | 555 | <a href="mailto:sip%3Aservice@host2.net" target="_blank">sip:service@host2.net</a> <mailto:<a href="mailto:sip%253Aservice@host2.net" target="_blank">sip%3Aservice@host2.net</a>> | channel=1 |<br>
<br>
+----+----------+------------------------+---------------------------------+<br>
<br>
<br>
and do (when routing a VM or conference call) :<br>
'load_balance(.., "channel");'<br>
<br>
Regards,<br>
Bogdan<br>
<div><br>
<br>
Taner Sener wrote:<br>
> Hi,<br>
><br>
> I'm using load balancer module on 1.6.0-notls (i386/linux) to 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 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>
> | id | group_id | dst_uri | resources |<br>
> +----+----------+------------------------+---------------------------------+<br>
><br>
</div>> | 1 | 555 | <a href="mailto:sip%3Aservice@host1.net" target="_blank">sip:service@host1.net</a> <mailto:<a href="mailto:sip%253Aservice@host1.net" target="_blank">sip%3Aservice@host1.net</a>> | vm=1; conf=1 |<br>
> | 2 | 555 | <a href="mailto:sip%3Aservice@host2.net" target="_blank">sip:service@host2.net</a> <mailto:<a href="mailto:sip%253Aservice@host2.net" target="_blank">sip%3Aservice@host2.net</a>> | vm=1; conf=1 |<br>
<div>><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>
</div>> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org" target="_blank">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>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">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>
</blockquote></div><br>