Hi Anca,<div><br></div><div>That sounds bad... :-(</div><div>Is there any other way to achieve what I'm trying to do?</div><div>Basically, as long as normal load balancing goes, I also need to select specific destinations for certain numbers.</div>
<div>Moreover, the list is quite big. Moreover, the list is changing. Moreover, destinations for certain numbers are changing also. :-)</div><div>Right now I have an ugly long if-elseif sheet... And the worst thing is that I have to restart opensips to chenge something. :-(</div>
<div><br></div><div>Regards,</div><div>Alexandr</div><div><br><div class="gmail_quote">2010/10/22 Anca Vamanu <span dir="ltr"><<a href="mailto:anca@opensips.org">anca@opensips.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Alexandr,<br>
<br>
The second parameter of load_balance() function can not be a<br>
pseudovariable, but only string.<br>
<br>
Regards,<br>
<br>
--<br>
Anca Vamanu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
On 10/22/2010 03:53 PM, Alexandr A. Alexandrov wrote:<br>
> Hi!<br>
><br>
> I have a strange problem with trying to use avps in load_balance function.<br>
><br>
> I'm trying to do balancing like this:<br>
><br>
> avp_db_query("select phone, resource from phone_resource where<br>
> phone like '%$fU%'", "$avp(i:111);$avp(i:112)");<br>
> avp_print();<br>
> xlog("L_INFO","$fu = $avp(i:111)");<br>
> if ($fu=~$avp(i:111)) {<br>
> xlog("L_INFO", "AAA detected!\n");<br>
> load_balance("1", "$avp(i:112)");<br>
><br>
> Here is what I get in logs:<br>
><br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:<br>
> INFO:avpops:ops_print_avp: #011#011#011id=<112><br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:<br>
> INFO:avpops:ops_print_avp: #011#011#011val_str=<aaa / 3><br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:<br>
> INFO:avpops:ops_print_avp: p=0x7f73f6b251e8, flags=0x0002<br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:<br>
> INFO:avpops:ops_print_avp: #011#011#011id=<111><br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:<br>
> INFO:avpops:ops_print_avp: #011#011#011val_str=<1234565677 / 10><br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:<br>
> sip:1234565677@xx.xxx.xxx.xxx;user=phone = 1234565677<br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]: AAA detected!<br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:<br>
> ERROR:load_balancer:do_load_balance: unknown resource in input string<br>
> Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:<br>
> DBG:core:comp_scriptvar: int 26 : -1 / 0<br>
><br>
> If I write the resource directly, like<br>
> load_balance("1", "aaa");<br>
> everything works fine.<br>
> In the above log you can see that $avp(i:112) contains exactly the same<br>
> resource string.<br>
> What is the correct way to do this, or is there a way to debug how load<br>
> balancer searches for resources defined in database?<br>
><br>
> Thanks in advance,<br>
> Alexandr A. Alexandrov<br>
><br>
<br>
</div></div>_______________________________________________<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>
</blockquote></div><br><br clear="all"><br>-- <br>С уважением, ААА.<br>
</div>