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/branches/1.4@59207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-03-26 17:45:55 +00:00
parent 19e8d3fdcb
commit fa97f6c381
3 changed files with 120 additions and 7 deletions

View File

@@ -2024,7 +2024,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
@@ -2035,8 +2035,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;