[OpenSIPS-Devel] [ opensips-Bugs-3603587 ] load_balance does not return next gateway

2013-02-22 Thread SourceForge . net
Bugs item #3603587, was opened at 2013-02-06 09:14
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3603587group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.9.x
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Matt Williams (hmmhesays)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: load_balance does not return next gateway

Initial Comment:
Calling load_balance() twice in request route does not return the next gateway 
in the set. 

route[2] {

load_balance($avp(778),pstn,1);
xlog(L_DEBUG, \n===DESTINATION IS $du===\n);
load_balance($avp(778),pstn,1);
xlog(L_DEBUG, \n===DESTINATION IS $du===\n);

if ($retcode0) {
 sl_send_reply(503,Service Unavailable - NO GATEWAYS);
 exit;
}

xlog(L_DEBUG,\n===CHECKING RATE LIMIT FOR $du===\n);

if(!rl_check(lb_$du, 0, TAILDROP)) {
rl_dec_count(lb_$du);
route(2);
exit;

}

xlog(L_DEBUG, Selected destination is: $du\n);

# send it out
if (!t_relay()) {
sl_reply_error();
}

exit;



}


Feb  6 12:05:23 [620844] DBG:load_balancer:do_load_balance: found requested (0) 
resource pstn
Feb  6 12:05:23 [620844] DBG:core:parse_to_param: tag=1KppB6yttgg8N
Feb  6 12:05:23 [620844] DBG:core:parse_to: end of header reached, state=29
Feb  6 12:05:23 [620844] DBG:core:parse_to: display={Datacomm, Tech Support}, 
ruri={sip:7015410525@192.168.0.195}
Feb  6 12:05:23 [620844] DBG:dialog:build_new_dlg: new dialog 0x2b0792991880 
(c=3c67be3a-eb22-1230-0184-0014227c3253,f=sip:7015410525@192.168.0.195,t=sip:17011231234@64.135.116.168:5062,ft=1KppB6yttgg8N)
 on hash 17929
Feb  6 12:05:23 [620844] DBG:core:parse_headers: flags=
Feb  6 12:05:23 [620844] DBG:dialog:init_leg_info: route_set , contact 
sip:mod_sofia@192.168.0.195:5080, cseq 39749097 and bind_addr 
udp:64.135.116.168:5062
Feb  6 12:05:23 [620844] DBG:dialog:dlg_add_leg_info: set leg 0 for 
0x2b0792991880: tag=1KppB6yttgg8N rcseq=0
Feb  6 12:05:23 [620844] DBG:dialog:link_dlg: ref dlg 0x2b0792991880 with 3 - 3
Feb  6 12:05:23 [620844] DBG:load_balancer:do_load_balance: destination 
sip:192.168.0.172 selected for LB set with free=0 (max=0)
Feb  6 12:05:23 [620844] DBG:load_balancer:do_load_balance: destination 
sip:192.168.0.170 selected for LB set with free=100 (max=100)
Feb  6 12:05:23 [620844] DBG:dialog:link_dlg_profile: Entered here with hash = 1

===DESTINATION IS sip:192.168.0.170===
Feb  6 12:05:23 [620844] DBG:load_balancer:do_load_balance: found requested (0) 
resource pstn
Feb  6 12:05:23 [620844] DBG:load_balancer:do_load_balance: destination 
sip:192.168.0.172 selected for LB set with free=0 (max=0)
Feb  6 12:05:23 [620844] DBG:load_balancer:do_load_balance: destination 
sip:192.168.0.170 selected for LB set with free=96 (max=96)
Feb  6 12:05:23 [620844] DBG:dialog:link_dlg_profile: Entered here with hash = 1

===DESTINATION IS sip:192.168.0.170===
Feb  6 12:05:23 [620844] DBG:core:comp_scriptvar: int 26 : -5 / 0
Feb  6 12:05:23 [620844] DBG:core:parse_headers: flags=
Feb  6 12:05:23 [620844] DBG:dialog:next_state_dlg: unref dlg 0x2b0792991880 
with 1 - 2
Feb  6 12:05:23 [620844] DBG:dialog:next_state_dlg: dialog 0x2b0792991880 
changed from state 1 to state 5, due event 1
Feb  6 12:05:23 [620844] DBG:dialog:dlg_onreply: dialog 0x2b0792991880 failed 
(negative reply)
Feb  6 12:05:23 [620844] DBG:dialog:unref_dlg: unref dlg 0x2b0792991880 with 1 
- 1
Feb  6 12:05:23 [620844] DBG:dialog:unref_dlg: unref dlg 0x2b0792991880 with 1 
- 0
Feb  6 12:05:23 [620844] DBG:dialog:unref_dlg: ref =0 for dialog 0x2b0792991880
Feb  6 12:05:23 [620844] DBG:dialog:destroy_dlg: destroing dialog 0x2b0792991880
Feb  6 12:05:23 [620844] DBG:dialog:destroy_dlg: dlg expired or not in list - 
dlg 0x2b0792991880 [17929:2071505611] with clid 
'3c67be3a-eb22-1230-0184-0014227c3253' and tags '1KppB6yttgg8N' 'NULL'


--

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2013-02-17 00:44

Message:
Hi Matt,

This bug is similar to 3604147 , which I just fixed. The marking of the
used destination (during the failover) was bogus if the destination ID was
higher than 8.

SVN is updated trunk, 1.9, 1.8, 1.7 , so please do not use the patch I
sent, update from SVN and try again, it should work now.

Regards,
Bogdan

--

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2013-02-16 01:22

Message:
Hi, I tried your snip , but not able to reproduce what you reported. I
tested with 2 destination, here are 

[OpenSIPS-Devel] [ opensips-Bugs-3604147 ] load_balance in failure_route

2013-02-22 Thread SourceForge . net
Bugs item #3604147, was opened at 2013-02-11 11:12
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3604147group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.9.x
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Seth Schultz (sethschultz)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: load_balance in failure_route

Initial Comment:
Hello,

I call load_balance in my failure_route for sip_codes (408)|[56][0-9]{2}.  
This works, however, once all of the destinations have been exhausted, it 
continually tries to load balance the call to the last address, instead of 
returning false.  Please see the snippet below.

failure_route[1]
{
...
if (t_was_cancelled())
{
exit;
}

if (is_method(INVITE)  $tt == NULL  
t_check_status((403)|(404)|(408)|([56][0-9]{2})))
{
if(load_balance(1, pstn, 1))
{
...  #this code gets continually called with the last address in the pool 
instead of hitting the else condition below
}
else
{
send_reply($rs,$rr);
exit;
}
}
...
}

--

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2013-02-17 00:42

Message:
Hi Seth,

Thanks to your help, I found and fix the bug - the marking of the used
destination (during the failover) was bogus if the destination ID was
higher than 8.

SVN is updated trunk, 1.9, 1.8, 1.7 , so please remove the patch I sent,
update from SVN and try again, it should work now.

Regards,
Bogdan

--

Comment By: Seth Schultz (sethschultz)
Date: 2013-02-16 14:32

Message:
Bogdan,

My script is nearly identical to yours (I am re-arming the failure route
and then relaying).  I do, however, set the $rd variable after a successful
load_balance call, I am not sure if this makes a difference.  Notice that
in my output, the used set never grows to be bigger than 1.

Here is the output I get for the load_balance group which contains a set of
3 addresses all of which have resource pstn=100:

sip:aaa.aaa.aaa.aaa:5060
sip:bbb.bbb.bbb.bbb:5060
sip:ccc.ccc.ccc.ccc:5060

Log Output:

DBG:load_balancer:do_load_balance: found requested (0) resource pstn
DBG:load_balancer:do_load_balance: destination sip:ccc.ccc.ccc.ccc:5060
selected for LB set with free=100 (max=100)
DBG:load_balancer:do_load_balance: destination sip:bbb.bbb.bbb.bbb:5060
selected for LB set with free=100 (max=100)
DBG:load_balancer:do_load_balance: destination sip:aaa.aaa.aaa.aaa:5060
selected for LB set with free=100 (max=100)
DBG:load_balancer:do_load_balance: winning destination
sip:bbb.bbb.bbb.bbb:5060 selected for LB set with free=100

...

DBG:load_balancer:do_load_balance: sequential call of LB - previous
selected dst is 7
DBG:load_balancer:do_load_balance: found requested (0) resource pstn
DBG:load_balancer:do_load_balance: skipping destination
sip:bbb.bbb.bbb.bbb:5060 (used=1 , disabled=0)
DBG:load_balancer:do_load_balance: destination sip:aaa.aaa.aaa.aaa:5060
selected for LB set with free=100 (max=100)
DBG:load_balancer:do_load_balance: destination sip:ccc.ccc.ccc.ccc:5060
selected for LB set with free=100 (max=100)
DBG:load_balancer:do_load_balance: winning destination
sip:ccc.ccc.ccc.ccc:5060 selected for LB set with free=100

...

DBG:load_balancer:do_load_balance: sequential call of LB - previous
selected dst is 15
DBG:load_balancer:do_load_balance: found requested (0) resource pstn
DBG:load_balancer:do_load_balance: skipping destination
sip:bbb.bbb.bbb.bbb:5060 (used=1 , disabled=0)
DBG:load_balancer:do_load_balance: destination sip:ccc.ccc.ccc.ccc:5060
selected for LB set with free=99 (max=99)
DBG:load_balancer:do_load_balance: destination sip:aaa.aaa.aaa.aaa:5060
selected for LB set with free=100 (max=100)
DBG:load_balancer:do_load_balance: winning destination
sip:aaa.aaa.aaa.aaa:5060 selected for LB set with free=100

...

DBG:load_balancer:do_load_balance: found requested (0) resource pstn
DBG:load_balancer:do_load_balance: sequential call of LB - previous
selected dst is 19
DBG:load_balancer:do_load_balance: skipping destination
sip:bbb.bbb.bbb.bbb:5060 (used=1 , disabled=0)
DBG:load_balancer:do_load_balance: destination sip:ccc.ccc.ccc.ccc:5060
selected for LB set with free=100 (max=100)
DBG:load_balancer:do_load_balance: destination sip:aaa.aaa.aaa.aaa:5060
selected for LB set with free=99 (max=100)
DBG:load_balancer:do_load_balance: winning destination
sip:ccc.ccc.ccc.ccc:5060 selected for LB set with free=100

...

DBG:load_balancer:do_load_balance: sequential call of LB - previous
selected dst is 15
DBG:load_balancer:do_load_balance: found requested (0) resource pstn
DBG:load_balancer:do_load_balance: destination sip:ccc.ccc.ccc.ccc:5060
selected for LB set 

[OpenSIPS-Devel] [ opensips-Bugs-3605435 ] DROUTING: route_to_carrier()

2013-02-22 Thread SourceForge . net
Bugs item #3605435, was opened at 2013-02-20 07:46
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3605435group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.9.x
Status: Open
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Nick Altmann (nikbyte)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: DROUTING: route_to_carrier()

Initial Comment:
When I'd like to set constant in route_to_carrier() like 
route_to_carrier(test), it tries to fix constant as variable:
Feb 20 19:42:47 panda-opensips-1 opensips[25101]: ERROR:core:fixup_pvar: 
parsing of pseudo variable test failed!
Feb 20 19:42:47 panda-opensips-1 opensips[25101]: ERROR:core:fix_actions: 
fixing failed (code=-1) at cfg line 353

--

Comment By: Nick Altmann (nikbyte)
Date: 2013-02-20 08:27

Message:
route_to_gw() has the same problem.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3605435group_id=232389

___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [ opensips-Bugs-3605439 ] DROUTING: shouldn't ignore destinations when no rules

2013-02-22 Thread SourceForge . net
Bugs item #3605439, was opened at 2013-02-20 08:13
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3605439group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.9.x
Status: Open
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Nick Altmann (nikbyte)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: DROUTING: shouldn't ignore destinations when no rules

Initial Comment:
I think this:

opensips[25985]: WARNING:drouting:dr_load_routing_info: table dr_rules is 
empty
opensips[25985]: WARNING:drouting:dr_load_routing_info: no valid routing rules 
- discarding all destinations

is not correct.
We need rules not always. For example, sometimes we use only route_to_carrier() 
without rules.
But if no rules in db, it also doesn't work.


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3605439group_id=232389

___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [ opensips-Bugs-3605435 ] DROUTING: route_to_carrier()

2013-02-22 Thread SourceForge . net
Bugs item #3605435, was opened at 2013-02-20 07:46
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3605435group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.9.x
Status: Open
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Nick Altmann (nikbyte)
Assigned to: Liviu Chircu (liviuchircu)
Summary: DROUTING: route_to_carrier()

Initial Comment:
When I'd like to set constant in route_to_carrier() like 
route_to_carrier(test), it tries to fix constant as variable:
Feb 20 19:42:47 panda-opensips-1 opensips[25101]: ERROR:core:fixup_pvar: 
parsing of pseudo variable test failed!
Feb 20 19:42:47 panda-opensips-1 opensips[25101]: ERROR:core:fix_actions: 
fixing failed (code=-1) at cfg line 353

--

Comment By: Nick Altmann (nikbyte)
Date: 2013-02-20 08:27

Message:
route_to_gw() has the same problem.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3605435group_id=232389

___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] SF.net SVN: opensips:[9812] trunk/modules/drouting/drouting.c

2013-02-22 Thread Liviu Chircu
Revision: 9812
  http://opensips.svn.sourceforge.net/opensips/?rev=9812view=rev
Author:   liviuchircu
Date: 2013-02-22 17:37:27 + (Fri, 22 Feb 2013)
Log Message:
---
route_to_carrier() and route_to_gw() must accept both pvars and strings as 
parameters

Modified Paths:
--
trunk/modules/drouting/drouting.c

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] SF.net SVN: opensips:[9813] trunk/modules/drouting/dr_load.c

2013-02-22 Thread Bogdan-Andrei Iancu
Revision: 9813
  http://opensips.svn.sourceforge.net/opensips/?rev=9813view=rev
Author:   bogdan_iancu
Date: 2013-02-22 17:38:09 + (Fri, 22 Feb 2013)
Log Message:
---
- fixed loading data from db - do not discard GW/Carriers if no rules - we can 
do routing directly to a carrier (route_to_carrrier() )
  Reported by Nick Altmann
  Closes bug #3605439

Modified Paths:
--
trunk/modules/drouting/dr_load.c

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] SF.net SVN: opensips:[9814] branches/1.9/modules/drouting/drouting.c

2013-02-22 Thread Liviu Chircu
Revision: 9814
  http://opensips.svn.sourceforge.net/opensips/?rev=9814view=rev
Author:   liviuchircu
Date: 2013-02-22 17:38:31 + (Fri, 22 Feb 2013)
Log Message:
---
backport from trunk (rev #9812):
route_to_carrier() and route_to_gw() must accept both pvars and strings as 
parameters

Revision Links:
--
http://opensips.svn.sourceforge.net/opensips/?rev=9812view=rev

Modified Paths:
--
branches/1.9/modules/drouting/drouting.c

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] SF.net SVN: opensips:[9815] branches/1.9/modules/drouting/dr_load.c

2013-02-22 Thread Bogdan-Andrei Iancu
Revision: 9815
  http://opensips.svn.sourceforge.net/opensips/?rev=9815view=rev
Author:   bogdan_iancu
Date: 2013-02-22 17:39:00 + (Fri, 22 Feb 2013)
Log Message:
---
backport from trunk (rev #9813):
- fixed loading data from db - do not discard GW/Carriers if no rules - we can 
do routing directly to a carrier (route_to_carrrier() )
  Reported by Nick Altmann
Closes bug #3605439

Revision Links:
--
http://opensips.svn.sourceforge.net/opensips/?rev=9813view=rev

Modified Paths:
--
branches/1.9/modules/drouting/dr_load.c

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [ opensips-Bugs-3605439 ] DROUTING: shouldn't ignore destinations when no rules

2013-02-22 Thread SourceForge . net
Bugs item #3605439, was opened at 2013-02-20 08:13
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3605439group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.9.x
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nick Altmann (nikbyte)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: DROUTING: shouldn't ignore destinations when no rules

Initial Comment:
I think this:

opensips[25985]: WARNING:drouting:dr_load_routing_info: table dr_rules is 
empty
opensips[25985]: WARNING:drouting:dr_load_routing_info: no valid routing rules 
- discarding all destinations

is not correct.
We need rules not always. For example, sometimes we use only route_to_carrier() 
without rules.
But if no rules in db, it also doesn't work.


--

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2013-02-22 09:39

Message:
Fixed, thank you for report!

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=3605439group_id=232389

___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] SF.net SVN: opensips:[9817] branches/1.8/modules/drouting/drouting.c

2013-02-22 Thread Liviu Chircu
Revision: 9817
  http://opensips.svn.sourceforge.net/opensips/?rev=9817view=rev
Author:   liviuchircu
Date: 2013-02-22 17:41:28 + (Fri, 22 Feb 2013)
Log Message:
---
backport from trunk (rev #9812):
route_to_carrier() and route_to_gw() must accept both pvars and strings as 
parameters

Revision Links:
--
http://opensips.svn.sourceforge.net/opensips/?rev=9812view=rev

Modified Paths:
--
branches/1.8/modules/drouting/drouting.c

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel