Metaswitch/sprout — pull request #298 by rkd-msw (2013-11-18 15:19:29+00:00)
Title: [Reviewer: Mike] Routing fixes

Mike,

This pull request fixes two bugs: firstly, that we didn't copy the "orig" parameter from the Route header sent by the P-CSCF onto the one we build and send to Sprout (covered by the TestPcscfOrig test and line 844 of stateful_proxy.cpp).

The other bug is that we did ENUM handling even for calls where we were the terminating side. I've re-ordered the logic in handle_non_cancel - it now:

* calls find_as_chain (the new better name for handle_incoming_non_cancel)
* does originating processing if we have the originating session case
* does an ENUM lookup once originating processing has finished
* sets up the terminating chain if we've finished (or not had to do any) originating processing, we're still in the req uri, and we don't have a terminating chain yet
* does terminating handling if we have a terminating chain

Fixes https://github.com/Metaswitch/sprout/issues/205 and https://github.com/Metaswitch/sprout/issues/204 as a side-effect.