[OpenSIPS-Users] load_balance debugging
Anca Vamanu
anca at opensips.org
Fri Oct 22 17:11:02 CEST 2010
Hi Alexandr,
The second parameter of load_balance() function can not be a
pseudovariable, but only string.
Regards,
--
Anca Vamanu
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
>
More information about the Users
mailing list