[asterisk-commits] mjordan: trunk r403466 - in /trunk: ./ res/res_fax_spandsp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Dec 8 21:21:58 CST 2013


Author: mjordan
Date: Sun Dec  8 21:21:56 2013
New Revision: 403466

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403466
Log:
res_fax_spandsp: Always init T.38 session to avoid crashes during state change

Prior to this patch, res_fax_spandsp was conservative with how it initialized
the spandsp T.38 context. It would only initialize it if the driver thought
the current state was a T.38 fax. While this works fine in nominal situations,
in certain off nominal situations, res_fax_spandsp can believe that a T.38
fax will not occur when in fact one has started. In particular, this was
discovered when res_fax would fall back to audio after timing out on a T.38
upgrade. The SIP channel driver would continue to retry the re-INVITE and -
if the remote end responded after res_fax timed out with a 200 OK - a T.38
frame would be delivered to the res_fax stack when it no longer expected it.

As it turns out, there does not appear to be any downside to always
initializing the T.38 context, other than the actual memory allocation.
Since that avoids this off nominal situation (and others which are equally
likely hard to predict), this is the safest way to avoid this problem.

Much thanks to Torrey as well for providing a scenario that reproduces this
issue.

(closes issue ASTERISK-21242)
Reported by: Ashley Winters
Tested by: Torrey Searle
patches:
  always-init-t38.patch uploaded by awinters (License 6477)
  A_PARTY.xml uploaded by tsearle (License 5334)
........

Merged revisions 403449 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 403450 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 403458 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/res/res_fax_spandsp.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Sun Dec  8 21:21:56 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403290,403292-403398,403435
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403290,403292-403398,403435,403458

Modified: trunk/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_fax_spandsp.c?view=diff&rev=403466&r1=403465&r2=403466
==============================================================================
--- trunk/res/res_fax_spandsp.c (original)
+++ trunk/res/res_fax_spandsp.c Sun Dec  8 21:21:56 2013
@@ -545,7 +545,7 @@
 
 	p->stats = &spandsp_global_stats.g711;
 
-	if (s->details->caps & AST_FAX_TECH_T38) {
+	if (s->details->caps & (AST_FAX_TECH_T38 | AST_FAX_TECH_AUDIO)) {
 		if ((s->details->caps & AST_FAX_TECH_AUDIO) == 0) {
 			/* audio mode was not requested, start in T.38 mode */
 			p->ist38 = 1;
@@ -555,9 +555,7 @@
 		/* init t38 stuff */
 		t38_terminal_init(&p->t38_state, caller_mode, t38_tx_packet_handler, s);
 		set_logging(&p->t38_state.logging, s->details);
-	}
-
-	if (s->details->caps & AST_FAX_TECH_AUDIO) {
+
 		/* init audio stuff */
 		fax_init(&p->fax_state, caller_mode);
 		set_logging(&p->fax_state.logging, s->details);




More information about the asterisk-commits mailing list