[asterisk-commits] kpfleming: branch 1.6.1 r205698 - in /branches/1.6.1: ./ apps/ channels/ incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 9 16:27:25 CDT 2009


Author: kpfleming
Date: Thu Jul  9 16:27:18 2009
New Revision: 205698

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205698
Log:
Merged revisions 205696 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r205696 | kpfleming | 2009-07-09 16:20:23 -0500 (Thu, 09 Jul 2009) | 16 lines
  
  Repair ability of SendFAX/ReceiveFAX to respond to T.38 switchover.
  
  Recent changes in T.38 negotiation in Asterisk caused these applications to
  not respond when the other endpoint initiated a switchover to T.38; this
  resulted in the T.38 switchover failing, and the FAX attempt to be made
  using an audio connection, instead of T.38 (which would usually cause the
  FAX to fail completely).
  
  This patch corrects this problem, and the applications will now correctly
  respond to the T.38 switchover request. In addition, the response will include
  the appopriate T.38 session parameters based on what the other end offered
  and what our end is capable of.
  
  (closes issue #14849)
  Reported by: afosorio
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/apps/app_fax.c
    branches/1.6.1/channels/chan_sip.c
    branches/1.6.1/include/asterisk/frame.h

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/apps/app_fax.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/apps/app_fax.c?view=diff&rev=205698&r1=205697&r2=205698
==============================================================================
--- branches/1.6.1/apps/app_fax.c (original)
+++ branches/1.6.1/apps/app_fax.c Thu Jul  9 16:27:18 2009
@@ -414,7 +414,7 @@
 										 .version = 0,
 										 .max_datagram = 400,
 										 .rate = AST_T38_RATE_9600,
-										 .rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERED_TCF,
+										 .rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF,
 										 .fill_bit_removal = 1,
 										 .transcoding_mmr = 1,
 				};
@@ -431,7 +431,6 @@
 		   that a frame in old format was already queued before we set chanel format
 		   to slinear so it will still be received by ast_read */
 		if (inf->frametype == AST_FRAME_VOICE && inf->subclass == AST_FORMAT_SLINEAR) {
-
 			if (fax_rx(&fax, inf->data.ptr, inf->samples) < 0) {
 				/* I know fax_rx never returns errors. The check here is for good style only */
 				ast_log(LOG_WARNING, "fax_rx returned error\n");
@@ -452,6 +451,24 @@
 				ast_debug(1, "T38 negotiated, finishing audio loop\n");
 				res = 1;
 				break;
+			} else if (parameters->request_response == AST_T38_REQUEST_NEGOTIATE) {
+				if (parameters->version > 0) {
+					/* Only T.38 Version 0 is supported at this time */
+					parameters->version = 0;
+				}
+				if (parameters->max_datagram > 400) {
+					/* Limit incoming datagram size to our default */
+					/* TODO: this need to come from the udptl stack, not be hardcoded */
+					parameters->max_datagram = 400;
+				}
+				/* we only support bit rates up to 9.6kbps */
+				parameters->rate = AST_T38_RATE_9600;
+				ast_indicate_data(s->chan, AST_CONTROL_T38_PARAMETERS, parameters, sizeof(*parameters));
+				/* T38 switchover completed */
+				s->t38parameters = *parameters;
+				ast_debug(1, "T38 negotiated, finishing audio loop\n");
+				res = 1;
+				break;
 			}
 		}
 

Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=205698&r1=205697&r2=205698
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Thu Jul  9 16:27:18 2009
@@ -1100,7 +1100,7 @@
 #define T38FAX_TRANSCODING_MMR			(1 << 1)	/*!< Default: 0 (unset)*/
 #define T38FAX_TRANSCODING_JBIG			(1 << 2)	/*!< Default: 0 (unset)*/
 /* Rate management */
-#define T38FAX_RATE_MANAGEMENT_TRANSFERED_TCF	(0 << 3)
+#define T38FAX_RATE_MANAGEMENT_TRANSFERRED_TCF	(0 << 3)
 #define T38FAX_RATE_MANAGEMENT_LOCAL_TCF	(1 << 3)	/*!< Unset for transferredTCF (UDPTL), set for localTCF (TPKT) */
 /* UDP Error correction */
 #define T38FAX_UDP_EC_NONE			(0 << 4)	/*!< two bits, if unset NO t38UDPEC field in T38 SDP*/
@@ -4331,8 +4331,8 @@
 		parameters->rate = AST_T38_RATE_2400;
 	}
 
-	if (capabilities & T38FAX_RATE_MANAGEMENT_TRANSFERED_TCF) {
-		parameters->rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERED_TCF;
+	if (capabilities & T38FAX_RATE_MANAGEMENT_TRANSFERRED_TCF) {
+		parameters->rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF;
 	} else if (capabilities & T38FAX_RATE_MANAGEMENT_LOCAL_TCF) {
 		parameters->rate_management = AST_T38_RATE_MANAGEMENT_LOCAL_TCF;
 	}
@@ -4405,7 +4405,7 @@
 			ast_udptl_set_error_correction_scheme(p->udptl, UDPTL_ERROR_CORRECTION_NONE);
 			p->t38.capability |= T38FAX_UDP_EC_NONE;
 		}
-		p->t38.capability |= T38FAX_RATE_MANAGEMENT_TRANSFERED_TCF;
+		p->t38.capability |= T38FAX_RATE_MANAGEMENT_TRANSFERRED_TCF;
 	}
 }
 
@@ -5748,8 +5748,8 @@
 			p->t38.capability = p->t38.jointcapability |= T38FAX_RATE_2400;
 		}
 
-		if (parameters->rate_management == AST_T38_RATE_MANAGEMENT_TRANSFERED_TCF) {
-			p->t38.capability = p->t38.jointcapability |= T38FAX_RATE_MANAGEMENT_TRANSFERED_TCF;
+		if (parameters->rate_management == AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF) {
+			p->t38.capability = p->t38.jointcapability |= T38FAX_RATE_MANAGEMENT_TRANSFERRED_TCF;
 		} else if (parameters->rate_management == AST_T38_RATE_MANAGEMENT_LOCAL_TCF) {
 			p->t38.capability = p->t38.jointcapability |= T38FAX_RATE_MANAGEMENT_LOCAL_TCF;
 		}
@@ -7724,7 +7724,7 @@
 				if (!strcasecmp(s, "localTCF"))
 					peert38capability |= T38FAX_RATE_MANAGEMENT_LOCAL_TCF;
 				else if (!strcasecmp(s, "transferredTCF"))
-					peert38capability |= T38FAX_RATE_MANAGEMENT_TRANSFERED_TCF;
+					peert38capability |= T38FAX_RATE_MANAGEMENT_TRANSFERRED_TCF;
 			} else if ((sscanf(a, "T38FaxUdpEC:%255s", s) == 1)) {
 				found = 1;
 				ast_debug(3, "UDP EC: %s\n", s);

Modified: branches/1.6.1/include/asterisk/frame.h
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/include/asterisk/frame.h?view=diff&rev=205698&r1=205697&r2=205698
==============================================================================
--- branches/1.6.1/include/asterisk/frame.h (original)
+++ branches/1.6.1/include/asterisk/frame.h Thu Jul  9 16:27:18 2009
@@ -338,7 +338,7 @@
 };
 
 enum ast_control_t38_rate_management {
-	AST_T38_RATE_MANAGEMENT_TRANSFERED_TCF = 0,
+	AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF = 0,
 	AST_T38_RATE_MANAGEMENT_LOCAL_TCF,
 };
 




More information about the asterisk-commits mailing list