aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-05 19:53:18 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-05 19:53:18 +0000
commit95c96418356816b0ef2cb6688a44fb11bd61f0e5 (patch)
tree5866f1998bb2e313d43f54b045153a3fc4753986 /main
parent09d7057b16e908be12e95f85c7fa14eb355921f9 (diff)
Merged revisions 222110 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r222110 | kpfleming | 2009-10-05 14:45:00 -0500 (Mon, 05 Oct 2009) | 25 lines Allow non-compliant T.38 endpoints to be supportable via configuration option. Many T.38 endpoints incorrectly send the maximum IFP frame size they can accept as the T38FaxMaxDatagram value in their SDP, when in fact this value is supposed to be the maximum UDPTL payload size (datagram size) they can accept. If the value they supply is small enough (a commonly supplied value is '72'), T.38 UDPTL transmissions will likely fail completely because the UDPTL packets will not have enough room for a primary IFP frame and the redundancy used for error correction. If this occurs, the Asterisk UDPTL stack will emit log messages warning that data loss may occur, and that the value may need to be overridden. This patch extends the 't38pt_udptl' configuration option in sip.conf to allow the administrator to override the value supplied by the remote endpoint and supply a value that allows T.38 FAX transmissions to be successful with that endpoint. In addition, in any SIP call where the override takes effect, a debug message will be printed to that effect. This patch also removes the T38FaxMaxDatagram configuration option from udptl.conf.sample, since it has not actually had any effect for a number of releases. In addition, this patch cleans up the T.38 documentation in sip.conf.sample (which incorrectly documented that T.38 support was passthrough only). (issue #15586) Reported by: globalnetinc ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@222112 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/udptl.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/main/udptl.c b/main/udptl.c
index c5303e8fd..5124c8145 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -711,7 +711,7 @@ struct ast_frame *ast_udptl_read(struct ast_udptl *udptl)
static void calculate_local_max_datagram(struct ast_udptl *udptl)
{
- unsigned int new_max = 200;
+ unsigned int new_max = 0;
/* calculate the amount of space required to receive an IFP
* using the current error correction mode, and ensure that our
@@ -741,32 +741,28 @@ static void calculate_local_max_datagram(struct ast_udptl *udptl)
static void calculate_far_max_ifp(struct ast_udptl *udptl)
{
- unsigned new_max = 60;
+ unsigned new_max = 0;
/* calculate the maximum IFP the local endpoint should
* generate based on the far end's maximum datagram size
- * and the current error correction mode. some endpoints
- * bogus 'max datagram' values that would result in unusable
- * (too small) maximum IFP values, so we have a a reasonable
- * minimum value to ensure that we can actually construct
- * UDPTL packets.
+ * and the current error correction mode.
*/
switch (udptl->error_correction_scheme) {
case UDPTL_ERROR_CORRECTION_NONE:
/* only need room for sequence number and length indicators */
- new_max = MAX(new_max, udptl->far_max_datagram - 6);
+ new_max = udptl->far_max_datagram - 6;
break;
case UDPTL_ERROR_CORRECTION_REDUNDANCY:
/* need room for sequence number, length indicators and the
* configured number of redundant packets
*/
- new_max = MAX(new_max, (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1));
+ new_max = (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1);
break;
case UDPTL_ERROR_CORRECTION_FEC:
/* need room for sequence number, length indicators and a
* a single IFP of the maximum size expected
*/
- new_max = MAX(new_max, (udptl->far_max_datagram - 10) / 2);
+ new_max = (udptl->far_max_datagram - 10) / 2;
break;
}
/* subtract 25% of space for insurance */
@@ -998,7 +994,9 @@ int ast_udptl_write(struct ast_udptl *s, struct ast_frame *f)
}
if (f->datalen > s->far_max_ifp) {
- ast_log(LOG_WARNING, "UDPTL asked to send %d bytes of IFP when far end only prepared to accept %d bytes; data loss may occur.\n", f->datalen, s->far_max_ifp);
+ ast_log(LOG_WARNING,
+ "UDPTL asked to send %d bytes of IFP when far end only prepared to accept %d bytes; data loss may occur. "
+ "You may need to override the T38FaxMaxDatagram value for this endpoint in the channel driver configuration.\n", f->datalen, s->far_max_ifp);
}
/* Save seq_no for debug output because udptl_build_packet increments it */