[asterisk-commits] file: branch file/t38improvements r203107 - in /team/file/t38improvements: ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 24 20:54:04 CDT 2009


Author: file
Date: Wed Jun 24 20:54:00 2009
New Revision: 203107

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=203107
Log:
Add support for exchanging the max datagram in the T.38 parameters control frame.

Modified:
    team/file/t38improvements/channels/chan_sip.c
    team/file/t38improvements/include/asterisk/frame.h

Modified: team/file/t38improvements/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/file/t38improvements/channels/chan_sip.c?view=diff&rev=203107&r1=203106&r2=203107
==============================================================================
--- team/file/t38improvements/channels/chan_sip.c (original)
+++ team/file/t38improvements/channels/chan_sip.c Wed Jun 24 20:54:00 2009
@@ -4888,7 +4888,7 @@
 }
 
 /*! \brief Helper function which interprets T.38 capabilities and fills a parameters structure in */
-static void fill_t38_parameters(int capabilities, struct ast_control_t38_parameters *parameters)
+static void fill_t38_parameters(int capabilities, struct ast_control_t38_parameters *parameters, struct sip_pvt *p)
 {
 	if (capabilities & T38FAX_VERSION_0) {
 		parameters->version = 0;
@@ -4927,6 +4927,8 @@
 	if (capabilities & T38FAX_TRANSCODING_JBIG) {
 		parameters->transcoding_jbig = 1;
 	}
+
+	parameters->max_datagram = ast_udptl_get_far_max_datagram(p->udptl);
 }
 
 /*! \brief Change the T38 state on a SIP dialog */
@@ -4955,10 +4957,10 @@
 	/* Given the state requested and old state determine what control frame we want to queue up */
 	if (state == T38_PEER_REINVITE) {
 		message = parameters.request_response = AST_T38_REQUEST_NEGOTIATE;
-		fill_t38_parameters(p->t38.peercapability, &parameters);
+		fill_t38_parameters(p->t38.peercapability, &parameters, p);
 	} else if (state == T38_ENABLED) {
 		message = parameters.request_response = AST_T38_NEGOTIATED;
-		fill_t38_parameters(p->t38.jointcapability, &parameters);
+		fill_t38_parameters(p->t38.jointcapability, &parameters, p);
 	} else if (state == T38_DISABLED && old == T38_ENABLED)
 		message = parameters.request_response = AST_T38_TERMINATED;
 	else if (state == T38_DISABLED && old == T38_LOCAL_REINVITE)
@@ -6473,7 +6475,7 @@
 		}
 
 		if (p->udptl && request_response == AST_T38_REQUEST_NEGOTIATE) {
-			ast_udptl_set_local_max_datagram(p->udptl, 1000);
+			ast_udptl_set_local_max_datagram(p->udptl, parameters->max_datagram ? parameters->max_datagram : 400);
 		}
 	}
 
@@ -8562,7 +8564,9 @@
 				found = 1;
 				ast_debug(3, "FaxMaxDatagram: %d\n", x);
 				ast_udptl_set_far_max_datagram(p->udptl, x);
-				ast_udptl_set_local_max_datagram(p->udptl, x);
+				if (!ast_udptl_get_local_max_datagram(p->udptl)) {
+					ast_udptl_set_local_max_datagram(p->udptl, x);
+				}
 			} else if ((strncmp(a, "T38FaxFillBitRemoval", 20) == 0)) {
 				found = 1;
 				if(sscanf(a, "T38FaxFillBitRemoval:%d", &x) == 1) {

Modified: team/file/t38improvements/include/asterisk/frame.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/file/t38improvements/include/asterisk/frame.h?view=diff&rev=203107&r1=203106&r2=203107
==============================================================================
--- team/file/t38improvements/include/asterisk/frame.h (original)
+++ team/file/t38improvements/include/asterisk/frame.h Wed Jun 24 20:54:00 2009
@@ -352,6 +352,7 @@
 struct ast_control_t38_parameters {
 	enum ast_control_t38 request_response;                /*!< Request or response of the T38 control frame */
 	unsigned int version;                                 /*!< Supported T.38 version */
+	unsigned int max_datagram;                            /*!< Maximum datagram size supported */
 	enum ast_control_t38_rate rate;                       /*!< Maximum fax rate supported */
 	enum ast_control_t38_rate_management rate_management; /*!< Rate management setting */
 	unsigned int fill_bit_removal:1;                      /*!< Set if fill bit removal should be used */




More information about the asterisk-commits mailing list