mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-20 12:20:12 +00:00
res_fax: Fix a tight race condition causing fax to crash in audio fallback
When T.38 gets rejected and G711 failback occurs there is a period of time where neither AST_FAX_TECH_T38 nor AST_FAX_TECH_AUDIO is set, leading to a crash. Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
This commit is contained in:
committed by
Joshua Colp
parent
1ca148cae8
commit
20c3dba39e
@@ -1600,6 +1600,13 @@ static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_det
|
|||||||
|
|
||||||
chancount = 1;
|
chancount = 1;
|
||||||
|
|
||||||
|
/* Make sure one or the other is set to avoid race condition */
|
||||||
|
if (t38negotiated) {
|
||||||
|
details->caps |= AST_FAX_TECH_T38;
|
||||||
|
} else {
|
||||||
|
details->caps |= AST_FAX_TECH_AUDIO;
|
||||||
|
}
|
||||||
|
|
||||||
/* create the FAX session */
|
/* create the FAX session */
|
||||||
if (!(fax = fax_session_new(details, chan, reserved, token))) {
|
if (!(fax = fax_session_new(details, chan, reserved, token))) {
|
||||||
ast_log(LOG_ERROR, "Can't create a FAX session, FAX attempt failed.\n");
|
ast_log(LOG_ERROR, "Can't create a FAX session, FAX attempt failed.\n");
|
||||||
|
Reference in New Issue
Block a user