aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-26 17:45:55 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-26 17:45:55 +0000
commit96cdb024f43947eeb05c3c0f4cddb36c2b4c4a0d (patch)
tree50926d71aaf542b57e649218c4c7bf89a2342222 /main/rtp.c
parent447253fbc7b4ab5376f622c323ab2046248563c7 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@59207 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/main/rtp.c b/main/rtp.c
index a2a6a344b..42074146a 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -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;