Can you explain where the problem actually happens? Because the patch does not seem right, being in the URI parser, making host shorter (skipping [ ]), but that is not correct, and can have other side effects. If routing is not working, then the fix has to be done in the routing part, not in the SIP uri host parsing.