From 049933cc516d7cd6105e13b7ac5a61c8c2aed55f Mon Sep 17 00:00:00 2001
From: Grzegorz Sluja <grzegorz.sluja@iopsys.eu>
Date: Thu, 2 Mar 2023 11:06:18 +0000
Subject: [PATCH] Fix for congestion tone not played

The congestion tone was ignored for FXS by voicemngr hence it was not played.
Also added initialization for RTP stats to avoid random values populated to asterisk if the
it fails to retrieve the stats from DSP.
---
 line.c | 2 ++
 ubus.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/line.c b/line.c
index cd4a09e..7545ad6 100644
--- a/line.c
+++ b/line.c
@@ -227,6 +227,8 @@ int line_signal(int line, const char *signame, const char *data, struct voice_ub
 		case VOICE_SIG_NETBUSY:
 			if (lines[line].type == VOICE_LINE_DECT) {
 				send_dect_event_to_asterisk(line, dect_event_map[DECT_EVT_RELEASE]);
+			} else {
+				res = voice_line_signal(line, -1, sig->signal, atoi(data), NULL);
 			}
 			break;
 
diff --git a/ubus.c b/ubus.c
index 4b2c988..2962fa2 100644
--- a/ubus.c
+++ b/ubus.c
@@ -685,7 +685,7 @@ static int ubus_request_rtp_stats(struct ubus_context *uctx, struct ubus_object
 	struct blob_attr *keys[__RTP_STATS_MAX];
 	int line, reset, conIdx;
 	struct blob_buf blob;
-	struct rtp_stats_t rtp_stats;
+	struct rtp_stats_t rtp_stats = {0};
 
 	if(blobmsg_parse(request_rtp_stats_policy, __RTP_STATS_MAX, keys, blob_data(msg), blob_len(msg))) {
 		return UBUS_STATUS_INVALID_ARGUMENT;
-- 
GitLab