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
This commit is contained in:
Russell Bryant
2007-03-26 17:51:27 +00:00
parent e4a7d1b35f
commit 08e3a9bdc8
3 changed files with 144 additions and 9 deletions

View File

@@ -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;