]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pbx_builtins: Corrects SayNumber warning
authorNaveen Albert <asterisk@phreaknet.org>
Thu, 10 Jun 2021 14:34:53 +0000 (10:34 -0400)
committerJoshua Colp <jcolp@sangoma.com>
Tue, 15 Jun 2021 14:05:44 +0000 (09:05 -0500)
Previously, SayNumber always emitted a warning if the caller hung up
during execution. Usually this isn't correct, so check if the channel
hung up and, if so, don't emit a warning.

ASTERISK-29475

Change-Id: Ieea4a67301c6ea83bbc7690c1d4808d79a704594

main/pbx_builtins.c

index 7f76b9776567c6b6f16712b19d84dcab2abc48dc..e3703382f7825414f2c6095806302169ea0d0e7a 100644 (file)
@@ -1299,7 +1299,7 @@ static int pbx_builtin_saynumber(struct ast_channel *chan, const char *data)
 
        res = ast_say_number(chan, number_val, interrupt ? AST_DIGIT_ANY : "", ast_channel_language(chan), options);
 
-       if (res < 0) {
+       if (res < 0 && !ast_check_hangup_locked(chan)) {
                ast_log(LOG_WARNING, "We were unable to say the number %s, is it too large?\n", tmp);
        }