Metaswitch/sprout — pull request #698 by rkd-msw (2014-08-05 13:13:55+00:00)
Title: [Reviewer: Alex] Add AS name to iFC-related SAS logs; reduce number of iFCs sent to SAS

As part of my assault on https://github.com/Metaswitch/sprout/issues/538, I've added the AS's URI to the SAS logs.

While doing this, I noticed:
* the processing for the "invalid iFC" SAS log could be trivially simplified
* malformed IFCs both an "invalid IFC" and an "IFC does not match" log, which seemed redundant
* we logged the body of the IFC when we started processing, when we noticed it was invalid, and when it doesn't match, which seems like a pointless amount of load on SAS - I've reduced it to just log the IFC when we start processing it

One thing I didn't implement (but might be quite nice) is a diagram of how iFC logic decisions happen, something like:

```
Group 1: AND true, false, true -> false
Group 2: AND true -> true
Overall: OR false, true -> true
```

I think this would be quite useful in understanding/debugging why iFCs are matching/not matching when it's not expected - what do you think?

Not tested - pass back to me with any comments and I'll test it all before merging. I propose to test by:
* creating an IFC that should match (e.g. the default MMTEL IFC with an INVITE) and checking that the logs are correct and the IFC is only logged once
* creating an IFC that shouldn't match (e.g. the default MMTEL IFC with a REGISTER) and checking that the logs are correct and the IFC is only logged once
* creating an IFC that's invalid (e.g. by loading one with an invalid regex directly into Homestead) and checking that the logs are correct and the IFC is only logged once