diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 988d2da641..6664dc0653 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -489,6 +489,7 @@ typedef struct { switch_size_t dtmf_packet_count; switch_size_t cng_packet_count; switch_size_t flush_packet_count; + switch_size_t largest_jb_size; } switch_rtp_numbers_t; diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 74da94b2c4..ab37ecd7f7 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -2554,6 +2554,7 @@ static void set_stats(switch_rtp_t *rtp_session, private_object_t *tech_pvt, con add_stat(stats->inbound.dtmf_packet_count, "in_dtmf_packet_count"); add_stat(stats->inbound.cng_packet_count, "in_cng_packet_count"); add_stat(stats->inbound.flush_packet_count, "in_flush_packet_count"); + add_stat(stats->inbound.largest_jb_size, "in_largest_jb_size"); add_stat(stats->outbound.raw_bytes, "out_raw_bytes"); add_stat(stats->outbound.media_bytes, "out_media_bytes"); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 038401da19..2eeb7bfdb9 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -4138,6 +4138,10 @@ SWITCH_DECLARE(switch_rtp_stats_t *) switch_rtp_get_stats(switch_rtp_t *rtp_sess s = &rtp_session->stats; } + if (rtp_session->jb) { + s->inbound.largest_jb_size = stfu_n_get_most_qlen(rtp_session->jb); + } + return s; }