[Asterisk-code-review] res fax: Fix a tight race condition causing fax to crash in ... (asterisk[11])

Torrey Searle asteriskteam at digium.com
Thu Sep 29 13:09:28 CDT 2016


Torrey Searle has uploaded a new change for review.

  https://gerrit.asterisk.org/4001

Change subject: res_fax: Fix a tight race condition causing fax to crash in audio fallback
......................................................................

res_fax: Fix a tight race condition causing fax to crash in audio fallback

Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
---
M res/res_fax.c
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/01/4001/1

diff --git a/res/res_fax.c b/res/res_fax.c
index 833a3c8..38d8d8a 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -1344,6 +1344,15 @@
 	ast_format_clear(&orig_read_format);
 	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 */
 	if (!(fax = fax_session_new(details, chan, reserved, token))) {
 		ast_log(LOG_ERROR, "Can't create a FAX session, FAX attempt failed.\n");

-- 
To view, visit https://gerrit.asterisk.org/4001
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>



More information about the asterisk-code-review mailing list