[asterisk-commits] res fax: Fix a tight race condition causing fax to crash in ... (asterisk[14])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 12 09:48:06 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

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(-)

Approvals:
  George Joseph: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/res/res_fax.c b/res/res_fax.c
index a2e1793..b97f3eb 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/4077
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Torrey Searle <tsearle at gmail.com>



More information about the asterisk-commits mailing list