From 17574a88e4ad32dc812e42f453e4c719526d0a4f Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Thu, 11 Dec 2014 17:50:30 -0500 Subject: [PATCH] Add bert stats to mod_bert::lost_sync event The following values can be read from the event: sync_lost_percent - Error percentage within the analysis window sync_lost_count - How many times sync has been lost cng_count - Counter of confort noise packets err_samples - Number of samples that did not match the sequence --- src/mod/applications/mod_bert/mod_bert.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 72f4055e70..a1adb2dd9d 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -297,6 +297,10 @@ SWITCH_STANDARD_APP(bert_test_function) switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST, "true"); if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, BERT_EVENT_LOST_SYNC) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_basic_data(channel, event); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "sync_lost_percent", "%f", err); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "sync_lost_count", "%u", bert.stats_sync_lost_cnt); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "cng_count", "%u", bert.stats_cng_cnt); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "err_samples", "%u", bert.err_samples); switch_event_fire(&event); } if (bert.hangup_on_error) {