Re: [OpenSIPS-Users] Load balancer retcode question on OpenSIPS 1.6.2
Thanks for your recommendation it work great :). -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Load-balancer-retcode-question-on-OpenSIPS-1-6-2-tp5346088p5441869.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Load balancer retcode question on OpenSIPS 1.6.2
Hi, your code is not correct as the $retcode returns the ret code of the last executed instruction, including the if statement - to have a correct code, you need to save the $retcode value immediately after the call of load_balance() function Most probably the 1 val you see is the true return code of the if code. Try: if ( uri=~sip:92[1-9][0-...@.* ) { load_balance(27,white); $var(x) = $retcode; } else if ( uri=~sip:3392[1-9][0-...@.* ) { load_balance(27,grey); # $var(x) = $retcode; } if ( $var(x) 0 ) { sl_send_reply(500,Service full); exit; } Regards, Bogdan k1028 wrote: I figured it out. This work all the time if ( uri=~sip:92[1-9][0-...@.* ) { load_balance(27,white); } else if ( uri=~sip:3392[1-9][0-...@.* ) { load_balance(27,grey); # } if ( $retcode 0 ) { sl_send_reply(500,Service full); exit; } This work sometime if ( uri=~sip:92[1-9][0-...@.* ) { load_balance(27,white); } if ( uri=~sip:3392[1-9][0-...@.* ) { load_balance(27,grey); # } if ( $retcode 0 ) { sl_send_reply(500,Service full); exit; } -- Bogdan-Andrei Iancu OpenSIPS Bootcamp 20 - 24 September 2010, Frankfurt, Germany www.voice-system.ro ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Load balancer retcode question on OpenSIPS 1.6.2
I am using OpenSIPS 1.6.2 and followed the tutorial http://www.opensips.org/Resources/DocsTutLoadbalancing to use the load balancer module. The Tutorial use $retcode0 for Service Full reply. I get $rectcode = 1 instead of 0. What is the correct retcode load_balance(id,resource) when resource is full? This work for me if ( $retcode=1 ) { sl_send_reply(500,Service full); exit; } -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Load-balancer-retcode-question-on-OpenSIPS-1-6-2-tp5346088p5346088.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Load balancer retcode question on OpenSIPS 1.6.2
I figured it out. This work all the time if ( uri=~sip:92[1-9][0-...@.* ) { load_balance(27,white); } else if ( uri=~sip:3392[1-9][0-...@.* ) { load_balance(27,grey); # } if ( $retcode 0 ) { sl_send_reply(500,Service full); exit; } This work sometime if ( uri=~sip:92[1-9][0-...@.* ) { load_balance(27,white); } if ( uri=~sip:3392[1-9][0-...@.* ) { load_balance(27,grey); # } if ( $retcode 0 ) { sl_send_reply(500,Service full); exit; } -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Load-balancer-retcode-question-on-OpenSIPS-1-6-2-tp5346088p5346201.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users