[OpenSIPS-Users] load_balance debugging

Razvan Crainea razvancrainea at opensips.org
Mon Oct 25 16:31:08 CEST 2010


Hi,

I have just committed a patch that allows load_balance to receive a 
pseudo-variable resource argument. Please update from trunk and try this 
out.

Regards,
Razvan

On 10/25/2010 01:47 PM, Bogdan-Andrei Iancu wrote:
> See
> http://sourceforge.net/tracker/?func=detail&aid=2999345&group_id=232389&atid=1086413
>
> Regards,
> Bogdan
>
>
> Alexandr A. Alexandrov wrote:
>> Hi Bogdan!
>>
>> That sounds really great!
>> Does that request have any link/traking number so I could check its
>> state from time to time? :-)
>> I would use it immediately when it is available.
>> Too bad I'm not a C programmer and can't help here...
>>
>> Regards,
>> Alexandr A. Alexandrov
>>
>>
>> 25.10.2010 14:24, Bogdan-Andrei Iancu:
>>
>>> Hi Alexandr,
>>>
>>> We have a feature request for adding variable support there - it will be
>>> added in the next weeks.
>>>
>>> Regards,
>>> Bogdan
>>>
>>> Саша Александров wrote:
>>>
>>>
>>>> Hi Anca,
>>>>
>>>> That sounds bad... :-(
>>>> Is there any other way to achieve what I'm trying to do?
>>>> Basically, as long as normal load balancing goes, I also need to
>>>> select specific destinations for certain numbers.
>>>> Moreover, the list is quite big. Moreover, the list is changing.
>>>> Moreover, destinations for certain numbers are changing also. :-)
>>>> Right now I have an ugly long if-elseif sheet... And the worst thing
>>>> is that I have to restart opensips to chenge something. :-(
>>>>
>>>> Regards,
>>>> Alexandr
>>>>
>>>> 2010/10/22 Anca Vamanu<anca at opensips.org<mailto:anca at opensips.org>>
>>>>
>>>>       Hi Alexandr,
>>>>
>>>>       The second parameter of load_balance() function can not be a
>>>>       pseudovariable, but only string.
>>>>
>>>>       Regards,
>>>>
>>>>       --
>>>>       Anca Vamanu
>>>>       www.voice-system.ro<http://www.voice-system.ro>
>>>>
>>>>
>>>>
>>>>
>>>>       On 10/22/2010 03:53 PM, Alexandr A. Alexandrov wrote:
>>>>       >   Hi!
>>>>       >
>>>>       >   I have a strange problem with trying to use avps in load_balance
>>>>       function.
>>>>       >
>>>>       >   I'm trying to do balancing like this:
>>>>       >
>>>>       >   avp_db_query("select phone, resource from phone_resource where
>>>>       >   phone like '%$fU%'", "$avp(i:111);$avp(i:112)");
>>>>       >   avp_print();
>>>>       >   xlog("L_INFO","$fu = $avp(i:111)");
>>>>       >   if ($fu=~$avp(i:111)) {
>>>>       >   xlog("L_INFO", "AAA detected!\n");
>>>>       >   load_balance("1", "$avp(i:112)");
>>>>       >
>>>>       >   Here is what I get in logs:
>>>>       >
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>>       >   INFO:avpops:ops_print_avp: #011#011#011id=<112>
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>>       >   INFO:avpops:ops_print_avp: #011#011#011val_str=<aaa / 3>
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>>       >   INFO:avpops:ops_print_avp: p=0x7f73f6b251e8, flags=0x0002
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>>       >   INFO:avpops:ops_print_avp: #011#011#011id=<111>
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>>       >   INFO:avpops:ops_print_avp: #011#011#011val_str=<1234565677 / 10>
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>>       >   sip:1234565677 at xx.xxx.xxx.xxx;user=phone = 1234565677
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]: AAA detected!
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>>       >   ERROR:load_balancer:do_load_balance: unknown resource in input
>>>>       string
>>>>       >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>>       >   DBG:core:comp_scriptvar: int 26 : -1 / 0
>>>>       >
>>>>       >   If I write the resource directly, like
>>>>       >   load_balance("1", "aaa");
>>>>       >   everything works fine.
>>>>       >   In the above log you can see that $avp(i:112) contains exactly
>>>>       the same
>>>>       >   resource string.
>>>>       >   What is the correct way to do this, or is there a way to debug
>>>>       how load
>>>>       >   balancer searches for resources defined in database?
>>>>       >
>>>>       >   Thanks in advance,
>>>>       >   Alexandr A. Alexandrov
>>>>       >
>>>>
>>>>       _______________________________________________
>>>>       Users mailing list
>>>>       Users at lists.opensips.org<mailto:Users at lists.opensips.org>
>>>>       http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>> С уважением, ААА.
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>>
>>>
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>

-- 
Razvan Crainea
www.voice-system.ro




More information about the Users mailing list