Hi,
Looks like behavior of drop has changed in Kamailio 3.0. Before, I was able to drop() a specific branch in branch_route depending on various checks. http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#drop still says this is possible, http://kamailio.org/docs/modules/3.0.x/modules/tm.html#t_on_branch says it's not possible.
So calling drop() in branch_route has no effect, and I have no idea how to mark a branch in branch_route to be dropped in onsend_route, because checking a bflag doesn't work there, and neither does checking $rU.
Any ideas on how to accomplish dropping a specific branch?
Andreas
I too would be interested in the answer to this question. Thank you for posting it, Andreas.
On 04/08/2010 08:27 AM, Andreas Granig wrote:
Hi,
Looks like behavior of drop has changed in Kamailio 3.0. Before, I was able to drop() a specific branch in branch_route depending on various checks. http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#drop still says this is possible, http://kamailio.org/docs/modules/3.0.x/modules/tm.html#t_on_branch says it's not possible.
So calling drop() in branch_route has no effect, and I have no idea how to mark a branch in branch_route to be dropped in onsend_route, because checking a bflag doesn't work there, and neither does checking $rU.
Any ideas on how to accomplish dropping a specific branch?
Andreas
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
2010/4/8 Andreas Granig agranig@sipwise.com:
Hi,
Looks like behavior of drop has changed in Kamailio 3.0. Before, I was able to drop() a specific branch in branch_route depending on various checks. http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#drop still says this is possible, http://kamailio.org/docs/modules/3.0.x/modules/tm.html#t_on_branch says it's not possible.
So calling drop() in branch_route has no effect, and I have no idea how to mark a branch in branch_route to be dropped in onsend_route, because checking a bflag doesn't work there, and neither does checking $rU.
Neither checking $rU? do you mean that checking $rU in branch_route is not valid in 3.0?
Any ideas on how to accomplish dropping a specific branch?
If you use it to drop requests going to "unsafe" destinations (like when a REGISTER contains a spoofed "Contact" URI pointing to a gw or the proxy itself) then I recommend using blcklist for this purpose. This is, you set the list of IP's for gateways and proxies (forbidden addresses into a registration Contact) and enable such blacklist after doing lookup. If a branch tries to go to one of these addresses it will be dropped by t_relay (and will return certain code I don't remember now). I use it and works well.
El Thu, 8 Apr 2010 14:52:15 +0200 Iñaki Baz Castillo ibc@aliax.net escribió:
So calling drop() in branch_route has no effect, and I have no idea how to mark a branch in branch_route to be dropped in onsend_route, because checking a bflag doesn't work there, and neither does checking $rU.
Neither checking $rU? do you mean that checking $rU in branch_route is not valid in 3.0?
No. He says in "onsend_route"
El Thu, 8 Apr 2010 14:52:15 +0200 Iñaki Baz Castillo ibc@aliax.net escribió:
Any ideas on how to accomplish dropping a specific branch?
If you use it to drop requests going to "unsafe" destinations (like when a REGISTER contains a spoofed "Contact" URI pointing to a gw or the proxy itself) then I recommend using blcklist for this purpose. This is, you set the list of IP's for gateways and proxies (forbidden addresses into a registration Contact) and enable such blacklist after doing lookup. If a branch tries to go to one of these addresses it will be dropped by t_relay (and will return certain code I don't remember now). I use it and works well.
This is not the case. It's for dropping some local branches. :(
Hi,
seems this part was forgotten during the integration process. I attached a patch that should fix it, please test it (i didn't at all) and let me know the results.
If all ok I will double check with Andrei to see if breaks something in the new TM architecture and then push it to git either under #!KAMAILIO compat mode or enabled all time if everyone agrees.
Thanks, Daniel
On 4/8/10 3:15 PM, Jon Bonilla (Manwe) wrote:
El Thu, 8 Apr 2010 14:52:15 +0200 Iñaki Baz Castilloibc@aliax.net escribió:
Any ideas on how to accomplish dropping a specific branch?
If you use it to drop requests going to "unsafe" destinations (like when a REGISTER contains a spoofed "Contact" URI pointing to a gw or the proxy itself) then I recommend using blcklist for this purpose. This is, you set the list of IP's for gateways and proxies (forbidden addresses into a registration Contact) and enable such blacklist after doing lookup. If a branch tries to go to one of these addresses it will be dropped by t_relay (and will return certain code I don't remember now). I use it and works well.
This is not the case. It's for dropping some local branches. :(
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
Hi Daniel,
Daniel-Constantin Mierla wrote:
seems this part was forgotten during the integration process. I attached a patch that should fix it, please test it (i didn't at all) and let me know the results.
If all ok I will double check with Andrei to see if breaks something in the new TM architecture and then push it to git either under #!KAMAILIO compat mode or enabled all time if everyone agrees.
Thanks for your fast response. Your patch looks fine, a quick test shows that drop in branch_route works for me now.
Many thanks, Andreas
In addition, it would be convenient to update this phrase
..."It is not possible to drop a message or generate a reply."
http://kamailio.org/docs/modules/3.0.x/modules/tm.html#t_on_branch
as it may indicate that drop does not work in branch_route