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

Joshua Colp asteriskteam at digium.com
Wed Oct 12 06:53:55 CDT 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/4076

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

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
---
M res/res_fax.c
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/76/4076/1

diff --git a/res/res_fax.c b/res/res_fax.c
index e37091b..ab0945a 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -1600,6 +1600,13 @@
 
 	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/4076
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Torrey Searle <tsearle at gmail.com>



More information about the asterisk-code-review mailing list