res_fax: Fix FAXOPT(faxdetect) timeout option.

The fax detection timeout option did not work because basically the wrong
variable was checked in fax_detect_framehook().  As a result, the timer
would timeout immediately and disable fax detection.

* Fixed ignoring negative timeout values.  We'd complain and then go right
on using the negative value.

* Fixed destroy_faxdetect() in the off-nominal case of an incomplete
object creation.

* Added more range checking to FAXOPT(gateway) timeout parameter.

ASTERISK-26214 #close
Reported by: Richard Mudgett

Change-Id: Idc5e698dfe33572de9840bc68cd9fc043cbad976
This commit is contained in:
Richard Mudgett
2016-07-12 17:24:54 -05:00
parent c03e27c1c8
commit c3462adeb8
2 changed files with 27 additions and 15 deletions

View File

@@ -179,11 +179,11 @@ struct ast_fax_session_details {
unsigned int t38timeout;
/*! the id of the t.38 gateway framehook for this channel */
int gateway_id;
/*! the timeout for this gateway in seconds */
/*! The timeout for this gateway in ms */
int gateway_timeout;
/*! the id of the faxdetect framehook for this channel */
int faxdetect_id;
/*! The timeout for this fax detect in seconds */
/*! The timeout for this fax detect in ms */
int faxdetect_timeout;
/*! flags used for fax detection */
int faxdetect_flags;