[asterisk-commits] kpfleming: trunk r205696 - in /trunk: apps/ channels/ include/asterisk/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jul 9 16:20:32 CDT 2009
Author: kpfleming
Date: Thu Jul 9 16:20:23 2009
New Revision: 205696
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205696
Log:
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:
trunk/apps/app_fax.c
trunk/channels/chan_sip.c
trunk/include/asterisk/frame.h
Modified: trunk/apps/app_fax.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_fax.c?view=diff&rev=205696&r1=205695&r2=205696
==============================================================================
--- trunk/apps/app_fax.c (original)
+++ trunk/apps/app_fax.c Thu Jul 9 16:20:23 2009
@@ -459,7 +459,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,
};
@@ -476,7 +476,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");
@@ -497,6 +496,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: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=205696&r1=205695&r2=205696
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Jul 9 16:20:23 2009
@@ -1545,7 +1545,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*/
@@ -4913,8 +4913,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;
}
@@ -5009,7 +5009,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;
}
}
@@ -6447,8 +6447,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;
}
@@ -8600,7 +8600,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: trunk/include/asterisk/frame.h
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/include/asterisk/frame.h?view=diff&rev=205696&r1=205695&r2=205696
==============================================================================
--- trunk/include/asterisk/frame.h (original)
+++ trunk/include/asterisk/frame.h Thu Jul 9 16:20:23 2009
@@ -345,7 +345,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