From eac2c3b91a136c1d96b97d2650b777b242fd43f5 Mon Sep 17 00:00:00 2001
From: Matthew Jordan <mjordan@digium.com>
Date: Wed, 21 Aug 2013 15:12:57 +0000
Subject: [PATCH] Set 14400 as the default max bit rate if T38MaxBitRate is not
 specified

If an endpoint fails to include the T38MaxBitRate attribute during negotiation,
Asterisk will negotiate a bit rate of 2400 instead of the ITU recommended
bit rate of 14400. This patch fixes this by making AST_T38_RATE_14400 the
'default' value of the enum by assigning it a value of 0, such that if an
endpoint fails to include the attribute, the default will be 14400.

Note that Walter Doekes included the nice comment in frame.h about why we are
purposefully assigning AST_T38_RATE_14400 a value of 0.

(closes issue ASTERISK-22275)
Reported by: Andreas Steinmetz
patches:
  fax-fix.patch uploaded by anstein (License 6523)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@397257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 include/asterisk/frame.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index 01aa27b616..77c766711a 100644
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -296,12 +296,16 @@ enum ast_control_t38 {
 };
 
 enum ast_control_t38_rate {
-	AST_T38_RATE_2400 = 0,
+	AST_T38_RATE_2400 = 1,
 	AST_T38_RATE_4800,
 	AST_T38_RATE_7200,
 	AST_T38_RATE_9600,
 	AST_T38_RATE_12000,
-	AST_T38_RATE_14400,
+	/* Set to 0 so it's taken as default when unspecified.
+	 * See ITU-T T.38 Implementors' Guide (11 May 2012),
+	 * Table H.2: if the T38MaxBitRate attribute is omitted
+	 * it should use a default of 14400. */
+	AST_T38_RATE_14400 = 0,
 };
 
 enum ast_control_t38_rate_management {
-- 
GitLab