aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-09 21:27:36 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-09 21:27:36 +0000
commit7da0f0ca254d29662a3b85569c820a361d07389b (patch)
tree48ab3dcd8ffbd4674f76dd752225847c270f3f46 /apps
parent2ef57b7b89d9ca3d5a384f89460d63c1197fb46f (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.2@205699 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 fffcf8cd5..54928791a 100644
--- a/apps/app_fax.c
+++ b/apps/app_fax.c
@@ -459,7 +459,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,
};
@@ -476,7 +476,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");
@@ -497,6 +496,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;
}
}