]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_voicemail: Disable ADSI if unavailable.
authorNaveen Albert <asterisk@phreaknet.org>
Wed, 27 Sep 2023 12:28:50 +0000 (08:28 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Fri, 12 Jan 2024 18:29:18 +0000 (18:29 +0000)
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 c04923fcdace74cf4e0af3c6906a9f6761d39cdf)

apps/app_voicemail.c

index 277d22c3936c903f3963315f468bb731e1334ef7..0e69973146c2eb3744a1aa0f68ebfc50a750333f 100644 (file)
@@ -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");