diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-03-26 17:51:27 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-03-26 17:51:27 +0000 |
commit | 08e3a9bdc82ec4bb2b9fc24c8a4887a03c085d71 (patch) | |
tree | bb9a4f8a98d5844711b2d23378a49d0921f3f588 /main/rtp.c | |
parent | e4a7d1b35f62943d28a738e8a0e21413216d01d9 (diff) |
Merged revisions 59207 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r59207 | russell | 2007-03-26 12:45:55 -0500 (Mon, 26 Mar 2007) | 7 lines
The AUDIORTPQOS and VIDEORTPQOS variables are not fully functional in some
because they get set in sip_hangup. So, there are common situations where
the variables will not be available in the dialplan at all. So, this patch
provides an alternate method for getting to this information by introducing
AUDIORTPQOS and VIDEORTPQOS dialplan functions.
(issue #9370, patch by Corydon76, with some testing by blitzrage)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp.c')
-rw-r--r-- | main/rtp.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/main/rtp.c b/main/rtp.c index 4c45c5b3e..486ff6189 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -2128,7 +2128,7 @@ void ast_rtp_reset(struct ast_rtp *rtp) rtp->rxseqno = 0; } -char *ast_rtp_get_quality(struct ast_rtp *rtp) +char *ast_rtp_get_quality(struct ast_rtp *rtp, struct ast_rtp_quality *qual) { /* *ssrc our ssrc @@ -2139,8 +2139,20 @@ char *ast_rtp_get_quality(struct ast_rtp *rtp) *txjitter reported jitter of the other end *txcount transmitted packets *rlp remote lost packets + *rtt round trip time */ - + + if (qual) { + qual->local_ssrc = rtp->ssrc; + qual->local_lostpackets = rtp->rtcp->expected_prior - rtp->rtcp->received_prior; + qual->local_jitter = rtp->rxjitter; + qual->local_count = rtp->rxcount; + qual->remote_ssrc = rtp->themssrc; + qual->remote_lostpackets = rtp->rtcp->reported_lost; + qual->remote_jitter = rtp->rtcp->reported_jitter / 65536.0; + qual->remote_count = rtp->txcount; + qual->rtt = rtp->rtcp->rtt; + } snprintf(rtp->rtcp->quality, sizeof(rtp->rtcp->quality), "ssrc=%u;themssrc=%u;lp=%u;rxjitter=%f;rxcount=%u;txjitter=%f;txcount=%u;rlp=%u;rtt=%f", rtp->ssrc, rtp->themssrc, rtp->rtcp->expected_prior - rtp->rtcp->received_prior, rtp->rxjitter, rtp->rxcount, (double)rtp->rtcp->reported_jitter/65536., rtp->txcount, rtp->rtcp->reported_lost, rtp->rtcp->rtt); return rtp->rtcp->quality; |