Added presence federation algorithm.

This patch relies on received_time being unchanged when a publish is
refreshed.

The aggregation merges the different presence states so that the last
published one is considered as the correct presence status. A primary
presence source can be defined. Call events are also considered as
primary. PUA fake presence generation is considered as secondary.

This is particularly useful with most hardware phones as they are not
able to handle several aggregated presence states.

SNOM phones being buggy, they send a body with a PUBLISH refresh
despite the RFC states it MUST NOT happen. We added a workaround for that.

The current short presence status is written in CacheDB. This allows presence-based routing.

If accepted, please credit Damien Sandras from Be IP s.a. @ http://www.beip.be