|
|
@ -811,9 +811,8 @@ static void set_channel_variables(struct ast_channel *chan, struct ast_fax_sessi
|
|
|
|
pbx_builtin_setvar_helper(chan, "FAXPAGES", buf);
|
|
|
|
pbx_builtin_setvar_helper(chan, "FAXPAGES", buf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#define GENERIC_FAX_EXEC_ERROR(fax, chan, errorstr, reason) \
|
|
|
|
#define GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason) \
|
|
|
|
do { \
|
|
|
|
do { \
|
|
|
|
ast_log(LOG_ERROR, "channel '%s' FAX session '%d' failure, reason: '%s' (%s)\n", chan->name, fax->id, reason, errorstr); \
|
|
|
|
|
|
|
|
ast_string_field_set(fax->details, result, S_OR(fax->details->result, "FAILED")); \
|
|
|
|
ast_string_field_set(fax->details, result, S_OR(fax->details->result, "FAILED")); \
|
|
|
|
ast_string_field_set(fax->details, resultstr, S_OR(fax->details->resultstr, reason)); \
|
|
|
|
ast_string_field_set(fax->details, resultstr, S_OR(fax->details->resultstr, reason)); \
|
|
|
|
ast_string_field_set(fax->details, error, S_OR(fax->details->error, errorstr)); \
|
|
|
|
ast_string_field_set(fax->details, error, S_OR(fax->details->error, errorstr)); \
|
|
|
@ -821,6 +820,12 @@ static void set_channel_variables(struct ast_channel *chan, struct ast_fax_sessi
|
|
|
|
res = ms = -1; \
|
|
|
|
res = ms = -1; \
|
|
|
|
} while (0)
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GENERIC_FAX_EXEC_ERROR(fax, chan, errorstr, reason) \
|
|
|
|
|
|
|
|
do { \
|
|
|
|
|
|
|
|
ast_log(LOG_ERROR, "channel '%s' FAX session '%d' failure, reason: '%s' (%s)\n", chan->name, fax->id, reason, errorstr); \
|
|
|
|
|
|
|
|
GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason); \
|
|
|
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
|
|
static void t38_parameters_ast_to_fax(struct ast_fax_t38_parameters *dst, const struct ast_control_t38_parameters *src)
|
|
|
|
static void t38_parameters_ast_to_fax(struct ast_fax_t38_parameters *dst, const struct ast_control_t38_parameters *src)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dst->version = src->version;
|
|
|
|
dst->version = src->version;
|
|
|
@ -1048,7 +1053,7 @@ static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_det
|
|
|
|
* send the FAX stack silence so the modems can finish their session without
|
|
|
|
* send the FAX stack silence so the modems can finish their session without
|
|
|
|
* any problems */
|
|
|
|
* any problems */
|
|
|
|
ast_log(LOG_NOTICE, "Channel '%s' did not return a frame; probably hung up.\n", chan->name);
|
|
|
|
ast_log(LOG_NOTICE, "Channel '%s' did not return a frame; probably hung up.\n", chan->name);
|
|
|
|
GENERIC_FAX_EXEC_ERROR(fax, chan, "HANGUP", "remote end hungup");
|
|
|
|
GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, "HANGUP", "remote end hungup");
|
|
|
|
c = NULL;
|
|
|
|
c = NULL;
|
|
|
|
chancount = 0;
|
|
|
|
chancount = 0;
|
|
|
|
timeout -= (1000 - ms);
|
|
|
|
timeout -= (1000 - ms);
|
|
|
|