Metaswitch/sprout — pull request #49 by kswmsw (2013-05-29 11:52:22+00:00)
Title: Handle mmtel in chain

Hi Mike - please can you review? Depends on reeval-ifcs, so please merge that first.

Handle MMTEL correctly in the middle of a chain. Once we have reeval-ifcs done, this comes down to a couple of things (see commit log for details):

* Always look at the current `pjsip_tx_data* _req` (was `tdata`) to work out what to do next, rather than at `pjsip_rx_data* rdata` the original incoming request. That means if MMTEL modifies `_req`, we spot it.
* Give the MMTEL AS (in terminating mode) an equivalent of the ODI token, so it can redirect properly.

In the process, I

* Added a bunch of UTs to test behaviour.
* Refactored the core of the message handling (esp. for ISC) into a separate method `handle_non_cancel`, which encapsulates incoming, originating, terminating, and outgoing processing.