Hello,
This is based on the topic
http://lists.sip-router.org/pipermail/sr-users/2011-March/067702.html
Long story short, re-SUBSCRIBEs are considered coming from a strict-router proxy (because of RURI which is the same as initial SUBSCRIBE) and this messes up everything.
As Klaus Darilion suggested, one way would be to check if the RURI does contain the lr parameter. The lack of it would mean that the request didn't came from a strict router, but instead from another entity (either CPE or loose-router). The following patch achieves this.
I have tested it and it works as expected giving the scenario. If anyone is against this, please tell me now as I will probably push it to upstream in the following days.
Cheers Marius