From: Naveen Albert Date: Wed, 27 Sep 2023 12:28:50 +0000 (-0400) Subject: app_voicemail: Disable ADSI if unavailable. X-Git-Tag: 18.21.0-rc1~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d6143068e8ee1ef8df96c9419e7488528f87f3d;p=thirdparty%2Fasterisk.git 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 c4d9e950bd00f92978e97f8efd3c273970f2f294) --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 277d22c393..0e69973146 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -7451,8 +7451,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");