[svn-commits] blanchet: branch blanchet/v6 r60526 - /team/blanchet/v6/main/rtp.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Apr 6 12:10:38 MST 2007


Author: blanchet
Date: Fri Apr  6 14:10:37 2007
New Revision: 60526

URL: http://svn.digium.com/view/asterisk?view=rev&rev=60526
Log:
put the added code to ast_rtp_get_quality to the ast_virtp_get_quality. this is an example of the drawback of the duplicate code approach. as soon as possible, would be great to have integrated code or a better approach. however, the good part still stands: other channels are not affected at all by ipv6, until they are touched.

Modified:
    team/blanchet/v6/main/rtp.c

Modified: team/blanchet/v6/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/blanchet/v6/main/rtp.c?view=diff&rev=60526&r1=60525&r2=60526
==============================================================================
--- team/blanchet/v6/main/rtp.c (original)
+++ team/blanchet/v6/main/rtp.c Fri Apr  6 14:10:37 2007
@@ -5373,7 +5373,7 @@
 	rtp->rxseqno = 0;
 }
 
-char *ast_virtp_get_quality(struct ast_virtp *rtp)
+char *ast_virtp_get_quality(struct ast_virtp *rtp, struct ast_rtp_quality *qual)
 {
 	/*
 	*ssrc          our ssrc
@@ -5385,7 +5385,17 @@
 	*txcount       transmitted packets
 	*rlp           remote lost packets
 	*/
-	
+        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;



More information about the svn-commits mailing list