]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_fax.c: lower FAXOPT read warning to debug level
authorphoneben <3232963@gmail.com>
Thu, 2 Oct 2025 21:25:01 +0000 (00:25 +0300)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 14 Oct 2025 21:35:12 +0000 (21:35 +0000)
Reading ${FAXOPT()} before a fax session is common in dialplans to check fax state.
Currently this logs an error even when no fax datastore exists, creating excessive noise.
Change these messages to ast_debug(3, …) so they appear only with debug enabled.

Resolves: #1509

res/res_fax.c

index 94657b090bce545a06aac8cfae4e3d137c493552..0324e5659882fdcda561409c2907a906dad7940b 100644 (file)
@@ -4631,7 +4631,7 @@ static int acf_faxopt_read(struct ast_channel *chan, const char *cmd, char *data
        char *filenames;
 
        if (!details) {
-               ast_log(LOG_ERROR, "channel '%s' can't read FAXOPT(%s) because it has never been written.\n", ast_channel_name(chan), data);
+               ast_debug(3, "channel '%s' can't read FAXOPT(%s) because it has never been written.\n", ast_channel_name(chan), data);
                return -1;
        }
        if (!strcasecmp(data, "ecm")) {
@@ -4645,14 +4645,14 @@ static int acf_faxopt_read(struct ast_channel *chan, const char *cmd, char *data
                ast_copy_string(buf, details->error, len);
        } else if (!strcasecmp(data, "filename")) {
                if (AST_LIST_EMPTY(&details->documents)) {
-                       ast_log(LOG_ERROR, "channel '%s' can't read FAXOPT(%s) because it has never been written.\n", ast_channel_name(chan), data);
+                       ast_debug(3, "channel '%s' can't read FAXOPT(%s) because it has never been written.\n", ast_channel_name(chan), data);
                        res = -1;
                } else {
                        ast_copy_string(buf, AST_LIST_FIRST(&details->documents)->filename, len);
                }
        } else if (!strcasecmp(data, "filenames")) {
                if (AST_LIST_EMPTY(&details->documents)) {
-                       ast_log(LOG_ERROR, "channel '%s' can't read FAXOPT(%s) because it has never been written.\n", ast_channel_name(chan), data);
+                       ast_debug(3, "channel '%s' can't read FAXOPT(%s) because it has never been written.\n", ast_channel_name(chan), data);
                        res = -1;
                } else if ((filenames = generate_filenames_string(details, "", ","))) {
                        ast_copy_string(buf, filenames, len);