From c73b17515c7f59aadb8c37c283f903788db76dd9 Mon Sep 17 00:00:00 2001 From: Olle Johansson Date: Thu, 3 Sep 2009 12:24:30 +0000 Subject: [PATCH] Fix bad reports in "sip show channelstats". Not directly mergeable in svn trunk, needs more tests, therefore committed directly to 1.6.2. (closes issue #15819) Reported by: klaus3000 Patches: asterisk-1.6.2-beta4-sipshowchannelstats-patch-0.2.txt uploaded by klaus3000 (license 65) Tested by: klaus3000, oej git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@215887 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 4 ++-- main/rtp.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 3236f9da2f..c5d08d4ad0 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -15366,12 +15366,12 @@ static int show_chanstats_cb(void *__cur, void *__arg, int flags) rxcount > (unsigned int) 100000 ? (unsigned int) (rxcount)/(unsigned int) 1000 : rxcount, rxcount > (unsigned int) 100000 ? "K":" ", ast_rtp_get_qosvalue(cur->rtp, AST_RTP_RXPLOSS), - rxcount > ast_rtp_get_qosvalue(cur->rtp, AST_RTP_RXPLOSS) ? (unsigned int) (ast_rtp_get_qosvalue(cur->rtp, AST_RTP_RXPLOSS) / rxcount * 100) : 0, + rxcount > ast_rtp_get_qosvalue(cur->rtp, AST_RTP_RXPLOSS) ? (unsigned int) ((double) ast_rtp_get_qosvalue(cur->rtp, AST_RTP_RXPLOSS) / (ast_rtp_get_qosvalue(cur->rtp, AST_RTP_RXPLOSS) + rxcount) * 100) : 0, ast_rtp_get_qosvalue(cur->rtp, AST_RTP_RXJITTER), txcount > (unsigned int) 100000 ? (unsigned int) (txcount)/(unsigned int) 1000 : txcount, txcount > (unsigned int) 100000 ? "K":" ", ast_rtp_get_qosvalue(cur->rtp, AST_RTP_TXPLOSS), - txcount > ast_rtp_get_qosvalue(cur->rtp, AST_RTP_TXPLOSS) ? (unsigned int) (ast_rtp_get_qosvalue(cur->rtp, AST_RTP_TXPLOSS)/ txcount * 100) : 0, + txcount > ast_rtp_get_qosvalue(cur->rtp, AST_RTP_TXPLOSS) ? (unsigned int) ((double) ast_rtp_get_qosvalue(cur->rtp, AST_RTP_TXPLOSS)/ txcount * 100) : 0, ast_rtp_get_qosvalue(cur->rtp, AST_RTP_TXJITTER) ); arg->numchans++; diff --git a/main/rtp.c b/main/rtp.c index 1ae21bab5d..2acdb718c0 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -2768,7 +2768,7 @@ unsigned int ast_rtp_get_qosvalue(struct ast_rtp *rtp, enum ast_rtp_qos_vars val case AST_RTP_RXCOUNT: return (unsigned int) rtp->rxcount; case AST_RTP_TXJITTER: - return (unsigned int) (rtp->rxjitter * 100.0); + return (unsigned int) (rtp->rxjitter * 1000.0); case AST_RTP_RXJITTER: return (unsigned int) (rtp->rtcp ? (rtp->rtcp->reported_jitter / (unsigned int) 65536.0) : 0); case AST_RTP_RXPLOSS: