aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-09 21:27:18 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-09 21:27:18 +0000
commit2b28768a9027fd6316efc5554de70ef93c608554 (patch)
tree6d63bf7dca6ab68e5a8f4d5b6392d6a041cdf7bb /apps
parent31913276ebf966903dc0fd8a18e7f93a31f56c48 (diff)
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 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@205698 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_fax.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/app_fax.c b/apps/app_fax.c
index 00811211b..98f0625b1 100644
--- a/apps/app_fax.c
+++ b/apps/app_fax.c
@@ -414,7 +414,7 @@ static int transmit_audio(fax_session *s)
.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 @@ static int transmit_audio(fax_session *s)
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 @@ static int transmit_audio(fax_session *s)
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;
}
}