]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
include accumulated stats from rtcp into vars
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 10 Sep 2010 16:59:47 +0000 (11:59 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 10 Sep 2010 16:59:47 +0000 (11:59 -0500)
src/include/switch_types.h
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_rtp.c

index 5a88cd575178908ede79ad451aeba8d2929d7bcd..c3b649cb68880713ceb9087c92b6f52ee3a9b542 100644 (file)
@@ -479,9 +479,16 @@ typedef struct {
        switch_size_t flush_packet_count;
 } switch_rtp_numbers_t;
 
+
+typedef struct {
+       uint32_t packet_count;
+       uint32_t octet_count;
+} switch_rtcp_numbers_t;
+
 typedef struct {
        switch_rtp_numbers_t inbound;
        switch_rtp_numbers_t outbound;
+       switch_rtcp_numbers_t rtcp;
 } switch_rtp_stats_t;
 
 typedef enum {
index 473dfb9aca5e36a3fa59fb8a21784612d05cbacd..8054c8df73f06b56412d72d09bfc0a1ff3096df3 100644 (file)
@@ -2238,6 +2238,9 @@ static void set_stats(switch_rtp_t *rtp_session, private_object_t *tech_pvt, con
                add_stat(stats->outbound.dtmf_packet_count, "out_dtmf_packet_count");
                add_stat(stats->outbound.cng_packet_count, "out_cng_packet_count");
 
+               add_stat(stats->rtcp.packet_count, "rtcp_packet_count");
+               add_stat(stats->rtcp.octet_count, "rtcp_octet_count");
+
        }
 }
 
index c9f9bfa3cf6a896238a6a56ef43b5af0dea47c37..710415afdb9b61a62d13412e75a547e215b0bdd6 100644 (file)
@@ -2191,6 +2191,9 @@ static switch_status_t read_rtcp_packet(switch_rtp_t *rtp_session, switch_size_t
 
                                rtp_session->rtcp_fresh_frame = 1;
 
+                               rtp_session->stats.rtcp.packet_count += sr->pc;
+                               rtp_session->stats.rtcp.octet_count += sr->oc;
+
                                /* sender report */
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10,"Received a SR with %d report blocks, " \
                                                                  "length in words = %d, " \