[asterisk-commits] mjordan: branch 1.8 r352144 - /branches/1.8/res/res_fax_spandsp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 23 13:12:18 CST 2012


Author: mjordan
Date: Mon Jan 23 13:12:14 2012
New Revision: 352144

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=352144
Log:
Correctly apply FAXOPT settings (V17, V27, V29) before starting spandsp layer

While the FAXOPT function could be used to set the modem capabilities, the
input to that function was not being applied correctly to the spandsp layer.
This patch applies the current model capabilities before starting the spandsp
layer.

(closes issue: ASTERISK-16409)
Reported by: Kristijan Vrban
Tested by: Matt Jordan, Matthew Nicholson
Patches:
  spandsp-modems-1.8.diff uploaded by mnicholson (license 5081)
  spandsp-modems-10.diff uploaded by mnicholson (license 5081)


Modified:
    branches/1.8/res/res_fax_spandsp.c

Modified: branches/1.8/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_fax_spandsp.c?view=diff&rev=352144&r1=352143&r2=352144
==============================================================================
--- branches/1.8/res/res_fax_spandsp.c (original)
+++ branches/1.8/res/res_fax_spandsp.c Mon Jan 23 13:12:14 2012
@@ -131,6 +131,7 @@
 static void t30_phase_e_handler(t30_state_t *t30_state, void *data, int completion_code);
 static void spandsp_log(int level, const char *msg);
 static int update_stats(struct spandsp_pvt *p, int completion_code);
+static int spandsp_modems(struct ast_fax_session_details *details);
 
 static void set_logging(logging_state_t *state, struct ast_fax_session_details *details);
 static void set_local_info(t30_state_t *t30_state, struct ast_fax_session_details *details);
@@ -410,6 +411,31 @@
 {
 	t30_set_ecm_capability(t30_state, details->option.ecm);
 	t30_set_supported_compressions(t30_state, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION);
+}
+
+static int spandsp_modems(struct ast_fax_session_details *details)
+{
+	int modems = 0;
+	if (AST_FAX_MODEM_V17 & details->modems) {
+		modems |= T30_SUPPORT_V17;
+	}
+	if (AST_FAX_MODEM_V27 & details->modems) {
+		modems |= T30_SUPPORT_V27TER;
+	}
+	if (AST_FAX_MODEM_V29 & details->modems) {
+		modems |= T30_SUPPORT_V29;
+	}
+	if (AST_FAX_MODEM_V34 & details->modems) {
+#if defined(T30_SUPPORT_V34)
+		modems |= T30_SUPPORT_V34;
+#elif defined(T30_SUPPORT_V34HDX)
+		modems |= T30_SUPPORT_V34HDX;
+#else
+		ast_log(LOG_WARNING, "v34 not supported in this version of spandsp\n");
+#endif
+	}
+
+	return modems;
 }
 
 /*! \brief create an instance of the spandsp tech_pvt for a fax session */
@@ -584,6 +610,7 @@
 	set_local_info(p->t30_state, s->details);
 	set_file(p->t30_state, s->details);
 	set_ecm(p->t30_state, s->details);
+	t30_set_supported_modems(p->t30_state, spandsp_modems(s->details));
 
 	/* perhaps set_transmit_on_idle() should be called */
 




More information about the asterisk-commits mailing list