Hi Razvan!<div><br></div><div>Looks like it is working as expected, thank you so much!</div><div>I did not have a chance to perform extensive testing, though - will give more feedback later.</div><div><br></div><div>Regards,</div>
<div>Alexandr A. Alexandrov<br><br><div class="gmail_quote">2010/10/25 Razvan Crainea <span dir="ltr"><<a href="mailto:razvancrainea@opensips.org">razvancrainea@opensips.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I have just committed a patch that allows load_balance to receive a<br>
pseudo-variable resource argument. Please update from trunk and try this<br>
out.<br>
<br>
Regards,<br>
Razvan<br>
<div><div></div><div class="h5"><br>
On 10/25/2010 01:47 PM, Bogdan-Andrei Iancu wrote:<br>
> See<br>
> <a href="http://sourceforge.net/tracker/?func=detail&aid=2999345&group_id=232389&atid=1086413" target="_blank">http://sourceforge.net/tracker/?func=detail&aid=2999345&group_id=232389&atid=1086413</a><br>
><br>
> Regards,<br>
> Bogdan<br>
><br>
><br>
> Alexandr A. Alexandrov wrote:<br>
>> Hi Bogdan!<br>
>><br>
>> That sounds really great!<br>
>> Does that request have any link/traking number so I could check its<br>
>> state from time to time? :-)<br>
>> I would use it immediately when it is available.<br>
>> Too bad I'm not a C programmer and can't help here...<br>
>><br>
>> Regards,<br>
>> Alexandr A. Alexandrov<br>
>><br>
>><br>
>> 25.10.2010 14:24, Bogdan-Andrei Iancu:<br>
>><br>
>>> Hi Alexandr,<br>
>>><br>
>>> We have a feature request for adding variable support there - it will be<br>
>>> added in the next weeks.<br>
>>><br>
>>> Regards,<br>
>>> Bogdan<br>
>>><br>
>>> Саша Александров wrote:<br>
>>><br>
>>><br>
>>>> Hi Anca,<br>
>>>><br>
>>>> That sounds bad... :-(<br>
>>>> Is there any other way to achieve what I'm trying to do?<br>
>>>> Basically, as long as normal load balancing goes, I also need to<br>
>>>> select specific destinations for certain numbers.<br>
>>>> Moreover, the list is quite big. Moreover, the list is changing.<br>
>>>> Moreover, destinations for certain numbers are changing also. :-)<br>
>>>> Right now I have an ugly long if-elseif sheet... And the worst thing<br>
>>>> is that I have to restart opensips to chenge something. :-(<br>
>>>><br>
>>>> Regards,<br>
>>>> Alexandr<br>
>>>><br>
>>>> 2010/10/22 Anca Vamanu<<a href="mailto:anca@opensips.org">anca@opensips.org</a><mailto:<a href="mailto:anca@opensips.org">anca@opensips.org</a>>><br>
>>>><br>
>>>> 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><<a href="http://www.voice-system.ro" target="_blank">http://www.voice-system.ro</a>><br>
>>>><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<br>
>>>> 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<br>
>>>> 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<br>
>>>> the same<br>
>>>> > resource string.<br>
>>>> > What is the correct way to do this, or is there a way to debug<br>
>>>> how load<br>
>>>> > balancer searches for resources defined in database?<br>
>>>> ><br>
>>>> > Thanks in advance,<br>
>>>> > Alexandr A. Alexandrov<br>
>>>> ><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> Users mailing list<br>
>>>> <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>
>>>> <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>
>>>> С уважением, ААА.<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>
>>><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>
--<br>
</div></div><font color="#888888">Razvan Crainea<br>
</font><div><div></div><div class="h5"><a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>С уважением, ААА.<br>
</div>