mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Improve handling of values supplied to FAXOPT(ecm).
Previously, values that began with whitespace were silently treated as 'no', and all non-'yes' values were also treated as 'no'. Now the supplied value is specifically checked for a 'yes' or 'no' (or equivalent) value, after skipping leading whitespace. If the value is not valid, then a warning message is generated. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1775,7 +1775,14 @@ static int acf_faxopt_write(struct ast_channel *chan, const char *cmd, char *dat
|
||||
ast_debug(3, "channel '%s' setting FAXOPT(%s) to '%s'\n", chan->name, data, value);
|
||||
|
||||
if (!strcasecmp(data, "ecm")) {
|
||||
details->option.ecm = ast_true(value) ? 1 : 0;
|
||||
const char *val = ast_skip_blanks(value);
|
||||
if (ast_true(val)) {
|
||||
details->option.ecm = AST_FAX_OPTFLAG_TRUE;
|
||||
} else if (ast_false(val)) {
|
||||
details->option.ecm = AST_FAX_OPTFLAG_FALSE;
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(ecm).\n", value);
|
||||
}
|
||||
} else if (!strcasecmp(data, "headerinfo")) {
|
||||
ast_string_field_set(details, headerinfo, value);
|
||||
} else if (!strcasecmp(data, "localstationid")) {
|
||||
|
Reference in New Issue
Block a user