From a11885989c03fd2f933f037bc031aa7a203e9f3c Mon Sep 17 00:00:00 2001 From: Naveen Albert Date: Wed, 27 Sep 2023 08:28:50 -0400 Subject: [PATCH] app_voicemail: Disable ADSI if unavailable. If ADSI is available on a channel, app_voicemail will repeatedly try to use ADSI, even if there is no CPE that supports it. This leads to many unnecessary delays during the session. If ADSI is available but ADSI setup fails, we now disable it to prevent further attempts to use ADSI during the session. Resolves: #354 (cherry picked from commit 75620616f46d054aa6a7bbff1753b05c7abc642a) --- apps/app_voicemail.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 7faf188247..513ba9d855 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -7422,8 +7422,11 @@ static void adsi_begin(struct ast_channel *chan, int *useadsi) if (!ast_adsi_available(chan)) return; x = ast_adsi_load_session(chan, adsifdn, adsiver, 1); - if (x < 0) + if (x < 0) { + *useadsi = 0; + ast_channel_adsicpe_set(chan, AST_ADSI_UNAVAILABLE); return; + } if (!x) { if (adsi_load_vmail(chan, useadsi)) { ast_log(AST_LOG_WARNING, "Unable to upload voicemail scripts\n"); -- 2.47.2