Refactor RTCP events over to Stasis; associate with channels

This patch does the following:

* It merges Jaco Kroon's patch from ASTERISK-20754, which provides channel
  information in the RTCP events. Because Stasis provides a cache, Jaco's
  patch was modified to pass the channel uniqueid to the RTP layer as
  opposed to a pointer to the channel. This has the following benefits:
  (1) It keeps the RTP engine 'clean' of references back to channels
  (2) It prevents circular dependencies and other potential ref counting issues
* The RTP engine now allows any RTP implementation to raise RTCP messages.
  Potentially, other implementations (such as res_rtp_multicast) could also
  raise RTCP information. The engine provides structs to represent RTCP headers
  and RTCP SR/RR reports.
* Some general refactoring in res_rtp_asterisk was done to try and tame the
  RTCP code. It isn't perfect - that's *way* beyond the scope of this work -
  but it does feel marginally better.
* A few random bugs were fixed in the RTCP statistics. (Example: performing an
  assignment of a = a is probably not correct)
* We now raise RTCP events for each SR/RR sent/received. Previously we wouldn't
  raise an event when we sent a RR report.

Note that this work will be of use to others who want to monitor call quality
or build modules that report call quality statistics. Since the events are now
moving across the Stasis message bus, this is far easier to accomplish. It is
also a first step (though by no means the last step) towards getting Olle's
pinefrog work incorporated.

Again: note that the patch by Jaco Kroon was modified slightly for this work;
however, he did all of the hard work in finding the right places to set the
channel in the RTP engine across the channel drivers. Much thanks goes to Jaco
for his hard work here.

Review: https://reviewboard.asterisk.org/r/2603/

(closes issue ASTERISK-20574)
Reported by: Jaco Kroon
patches:
  asterisk-rtcp-channel.patch uploaded by jkroon (License 5671)

(closes issue ASTERISK-21471)
Reported by: Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2013-07-05 17:33:33 +00:00
parent d789681eaf
commit d0a55fa52d
19 changed files with 1072 additions and 428 deletions

View File

@@ -214,6 +214,20 @@ int ast_json_integer_set(struct ast_json *integer, intmax_t value)
return json_integer_set((json_t *)integer, value);
}
struct ast_json *ast_json_real_create(double value)
{
return (struct ast_json *)json_real(value);
}
double ast_json_real_get(const struct ast_json *real)
{
return json_real_value((json_t *)real);
}
int ast_json_real_set(struct ast_json *real, double value)
{
return json_real_set((json_t *)real, value);
}
int ast_json_equal(const struct ast_json *lhs, const struct ast_json *rhs)
{