]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_fax: check_modem_rate() returned incorrect rate for V.27
authorKevin Harwell <kharwell@digium.com>
Thu, 16 Jan 2014 18:57:43 +0000 (18:57 +0000)
committerKevin Harwell <kharwell@digium.com>
Thu, 16 Jan 2014 18:57:43 +0000 (18:57 +0000)
According to the new standard for V.27 and V.32 they are able to transmit
at a bit rate of 4,800 or 9,600.  The check_mode_rate function needed to be
updated to reflect this.  Also, because of this change the default 'minrate'
value was updated to be 4800.

(closes issue ASTERISK-22790)
Reported by: Paolo Compagnini
Patches:
     res_fax.txt uploaded by looserouting (license 6548)
........

Merged revisions 405656 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@405693 65c4cc65-6c06-0410-ace0-fbb531ad65f3

UPGRADE.txt
configs/res_fax.conf.sample
res/res_fax.c

index e331e92c72d856beadac1bf72d4b4fbb59407ef0..9410d501ff9c43c948dbabdd60cec485b5919975 100644 (file)
 === UPGRADE-10.txt -- Upgrade info for 1.8 to 10
 ===
 ===========================================================
+from 11.8 to 11.9
+* res_fax now returns the correct rates for V.27ter (4800 or 9600 bit/s).
+  Because of this the default settings would not load, so the minrate (minimum
+  transmission rate) option was changed to default to 4800 since that is the
+  minimum rate for v.27 which is included in the default modem options.
 
 From 11.7 to 11.8:
 * The per console verbose level feature as previously implemented caused a
index 19933e39d196b7a63b53f286059abeba37c12907..47ea35e04453578577f4a4e3b0094cf7cb5dcc78 100644 (file)
@@ -8,8 +8,8 @@ maxrate=14400
 
 ; Minimum Transmission Rate
 ; Possible values are { 2400 | 4800 | 7200 | 9600 | 12000 | 14400 }
-; Set this value to the minimum desired transfer rate.  Default: 2400
-minrate=2400
+; Set this value to the minimum desired transfer rate.  Default: 4800
+minrate=4800
 
 ; Send Progress/Status events to manager session
 ; Manager events with 'call' class permissions will receive events indicating the
index 073777a904d89838856917f25192a297871d5a91..853bfb4653d6233d32c44f7312598f1b4d730130 100644 (file)
@@ -323,7 +323,7 @@ struct fax_module {
 };
 static AST_RWLIST_HEAD_STATIC(faxmodules, fax_module);
 
-#define RES_FAX_MINRATE 2400
+#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)
@@ -704,7 +704,7 @@ static int check_modem_rate(enum ast_fax_modems modems, unsigned int rate)
 {
        switch (rate) {
        case 2400:
-               if (!(modems & (AST_FAX_MODEM_V27 | AST_FAX_MODEM_V34))) {
+               if (!(modems & (AST_FAX_MODEM_V34))) {
                        return 1;
                }
                break;
@@ -714,11 +714,15 @@ static int check_modem_rate(enum ast_fax_modems modems, unsigned int rate)
                }
                break;
        case 7200:
-       case 9600:
                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))) {
+                       return 1;
+               }
+               break;
        case 12000:
        case 14400:
                if (!(modems & (AST_FAX_MODEM_V17 | AST_FAX_MODEM_V34))) {