[asterisk-commits] res fax: allow 2400 transmission rate according to v.27ter s... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 29 16:42:25 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: res_fax: allow 2400 transmission rate according to v.27ter standard
......................................................................


res_fax: allow 2400 transmission rate according to v.27ter standard

A previous set of patches (see: ASTERISK-22790 & ASTERISK-23231) made it so
a v.27 modem was not allowed to have a minimum transmission rate of 2400 bits
per second. This reverts all or some of those patches since according to the
v.27ter standard a rate of 2400 bits per second is also supported.

One of the original patches also added 9600 bits per second support for v.27.
This patch also removes that since v.27ter only supports 2400/4800 bits per
second.

Also, since Asterisk specifically supports v.27ter the enum was renamed to
better reflect this.

ASTERISK-24955 #close
Reported by: Matt Jordan

Change-Id: I4b9dfb6bf7eff08463ab47ee1a74224f27cae733
---
M include/asterisk/res_fax.h
M res/res_fax.c
M res/res_fax_spandsp.c
3 files changed, 8 insertions(+), 16 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Matt Jordan: Looks good to me, approved; Verified



diff --git a/include/asterisk/res_fax.h b/include/asterisk/res_fax.h
index 746518b..2304da7 100644
--- a/include/asterisk/res_fax.h
+++ b/include/asterisk/res_fax.h
@@ -53,8 +53,8 @@
 enum ast_fax_modems {
 	/*! V.17 */
 	AST_FAX_MODEM_V17 = (1 << 0),
-	/*! V.27 */
-	AST_FAX_MODEM_V27 = (1 << 1),
+	/*! V.27ter */
+	AST_FAX_MODEM_V27TER = (1 << 1),
 	/*! V.29 */
 	AST_FAX_MODEM_V29 = (1 << 2),
 	/*! V.34 */
diff --git a/res/res_fax.c b/res/res_fax.c
index f0679bc..e947c91 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -523,7 +523,7 @@
 #define RES_FAX_MINRATE 4800
 #define RES_FAX_MAXRATE 14400
 #define RES_FAX_STATUSEVENTS 0
-#define RES_FAX_MODEM (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V27 | AST_FAX_MODEM_V29)
+#define RES_FAX_MODEM (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V27TER | AST_FAX_MODEM_V29)
 #define RES_FAX_T38TIMEOUT 5000
 
 struct fax_options {
@@ -828,7 +828,7 @@
 		if (!strcasecmp(m[j], "v17")) {
 			*bits |= AST_FAX_MODEM_V17;
 		} else if (!strcasecmp(m[j], "v27")) {
-			*bits |= AST_FAX_MODEM_V27;
+			*bits |= AST_FAX_MODEM_V27TER;
 		} else if (!strcasecmp(m[j], "v29")) {
 			*bits |= AST_FAX_MODEM_V29;
 		} else if (!strcasecmp(m[j], "v34")) {
@@ -907,7 +907,7 @@
 		strcat(tbuf, "V17");
 		count++;
 	}
-	if (bits & AST_FAX_MODEM_V27) {
+	if (bits & AST_FAX_MODEM_V27TER) {
 		if (count) {
 			strcat(tbuf, ",");
 		}
@@ -936,22 +936,14 @@
 {
 	switch (rate) {
 	case 2400:
-		if (!(modems & (AST_FAX_MODEM_V34))) {
-			return 1;
-		}
-		break;
 	case 4800:
-		if (!(modems & (AST_FAX_MODEM_V27 | AST_FAX_MODEM_V34))) {
+		if (!(modems & (AST_FAX_MODEM_V27TER | AST_FAX_MODEM_V34))) {
 			return 1;
 		}
 		break;
 	case 7200:
-		if (!(modems & (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V29 | AST_FAX_MODEM_V34))) {
-			return 1;
-		}
-		break;
 	case 9600:
-		if (!(modems & (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V27 | AST_FAX_MODEM_V29 | AST_FAX_MODEM_V34))) {
+		if (!(modems & (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V29 | AST_FAX_MODEM_V34))) {
 			return 1;
 		}
 		break;
diff --git a/res/res_fax_spandsp.c b/res/res_fax_spandsp.c
index 914b732..0152b00 100644
--- a/res/res_fax_spandsp.c
+++ b/res/res_fax_spandsp.c
@@ -502,7 +502,7 @@
 	if (AST_FAX_MODEM_V17 & details->modems) {
 		modems |= T30_SUPPORT_V17;
 	}
-	if (AST_FAX_MODEM_V27 & details->modems) {
+	if (AST_FAX_MODEM_V27TER & details->modems) {
 		modems |= T30_SUPPORT_V27TER;
 	}
 	if (AST_FAX_MODEM_V29 & details->modems) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b9dfb6bf7eff08463ab47ee1a74224f27cae733
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list