]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_fax: allow 2400 transmission rate according to v.27ter standard 94/294/2
authorKevin Harwell <kharwell@digium.com>
Wed, 29 Apr 2015 18:19:58 +0000 (13:19 -0500)
committerKevin Harwell <kharwell@digium.com>
Wed, 29 Apr 2015 20:31:40 +0000 (15:31 -0500)
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

include/asterisk/res_fax.h
res/res_fax.c
res/res_fax_spandsp.c

index 5bff3ffa0b62e778dbfaa395b02eac7cd8b92963..802dcd9d76bca22b2b88203a7ef60815fe98e4fd 100644 (file)
@@ -52,8 +52,8 @@ enum ast_fax_capabilities {
 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 */
index 2b2c2fb1303eea1780be8c6fc74a62ce143836bd..16a3d5871860ae843150c4214e5f777e1ce79f14 100644 (file)
@@ -329,7 +329,7 @@ static AST_RWLIST_HEAD_STATIC(faxmodules, fax_module);
 #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 {
@@ -604,7 +604,7 @@ static int update_modem_bits(enum ast_fax_modems *bits, const char *value)
                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")) {
@@ -682,7 +682,7 @@ static int ast_fax_modem_to_str(enum ast_fax_modems bits, char *tbuf, size_t buf
                strcat(tbuf, "V17");
                count++;
        }
-       if (bits & AST_FAX_MODEM_V27) {
+       if (bits & AST_FAX_MODEM_V27TER) {
                if (count) {
                        strcat(tbuf, ",");
                }
@@ -711,22 +711,14 @@ static int check_modem_rate(enum ast_fax_modems modems, unsigned int rate)
 {
        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;
@@ -3921,13 +3913,6 @@ static int set_config(int reload)
                goto end;
        }
 
-       if (options.minrate == 2400 && (options.modems & AST_FAX_MODEM_V27) && !(options.modems & (AST_FAX_MODEM_V34))) {
-               ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
-               ast_log(LOG_WARNING, "'modems' setting '%s' is no longer accepted with 'minrate' setting %u\n", modems, options.minrate);
-               ast_log(LOG_WARNING, "'minrate' has been reset to 4800, please update res_fax.conf.\n");
-               options.minrate = 4800;
-       }
-
        if (check_modem_rate(options.modems, options.minrate)) {
                ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
                ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %u\n", modems, options.minrate);
index bc3b810adb2c9342556436ad2bb1c5c495c3008e..30525ee048940440642c4ca4aa0a600722b2ac0e 100644 (file)
@@ -498,7 +498,7 @@ static int spandsp_modems(struct ast_fax_session_details *details)
        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) {