[asterisk-dev] [Code Review] Properly route responses according to the Via headers in the request
alex at speakup.nl
Thu Dec 30 08:56:48 UTC 2010
On Wednesday 29 December 2010 20:06:34 Matthew Nicholson wrote:
> In the latest patch, responses are routed to the address they were received
> from except if maddr is set in the via header.
Some comments about the latest patch (sorry, i have no reviewboard account, so
i do this per email).
1) get_header returns the full header line of the first Via it finds. This can
be a comma separated list of Via's. When you check for maddr, it is very
possible to find the maddr of the second or more via entry in that header.
Somewhere, the header returned by get_header must be limited to the first via,
ie up to the first comma.
2) get_header does not automatically find the first via if the first via is in
compact form. If the incoming request has 2 via header, of which the first is
in compact form (v:) and the second in standard form (Via:), get_header will
return the second Via header instead of the first, breaking your logic.
More information about the asterisk-dev