Metaswitch/sprout — pull request #742 by mike-evans (2014-08-28 11:44:29+00:00)
Title: [Reviewer Andy] Fixes #329 - Add support for storing Service-Route from REGISTER responses and adding to incoming requests

Andy

Can you review my fix to issue 329, which is basically adding support to Bono for storing the Service-Route for each public user identity on a REGISTER response, and filling in a Route header on subsequent incoming requests. To avoid a few pieces of feedback ...

- TS 24.229 says that the P-CSCF should check the Route in subsequent incoming requests and only replace it if it is wrong - I decided it was simpler to always write the stored Route in, ignoring what the client supplied and I defy any outside observer to tell the difference
- TS 24.229 also says the Service-Route could have multiple hops in it, but I've only implemented support for one hop as that is all we currently need
- TS 24.229 also says the particular Service-Route should be chosen based on the served user determined from the incoming request, which is precisely what I have implemented.

I also found and fixed some bugs while testing this, in particular

- we didn't have a custom header parser for Service-Route headers, so the I-CSCF was mangling them as they were passed through
- I found that the print function for our identity headers was incorrectly stripping port and transport parameters (in general they wouldn't ever be set for an identity header, but they are allowed in the ABNF).

I've tested by running the live tests and the UTs, and reinstating the SUBSCRIBE-NOTIFY live test that was broken.

Mike