[asterisk-dev] [Code Review] Properly route responses according to the Via headers in the request
Olle E. Johansson
oej at edvina.net
Thu Dec 30 09:52:07 UTC 2010
30 dec 2010 kl. 09.56 skrev Alex Hermann:
> 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.
I just added a comment about that, good catch. We need to separate via processing
from retrieval of header.
> 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.
get_header has a support function called find_alias it use to find compact versions of the headers.
Thanks for the feedback.
More information about the asterisk-dev