From c9b481c5ba8a16ed6b8b7d86bb1c6192a6ca3d74 Mon Sep 17 00:00:00 2001 From: paulc Date: Mon, 5 Oct 2009 08:53:43 +0000 Subject: [PATCH] Support for newer versions of spandsp with separate RX and TX pages stats. git-svn-id: http://voip.null.ro/svn/yate@2864 acf43c95-373e-0410-b603-e72c3f656dc1 --- configure.in | 29 +++++++++++++++++++++++++++++ modules/faxchan.cpp | 6 +++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d0cfa9eb..744c2b25 100644 --- a/configure.in +++ b/configure.in @@ -683,6 +683,34 @@ AC_TRY_COMPILE([ #include ],[ fax_state_t fax_state; +t30_stats_t fax_stats; +t38_terminal_state_t t38_t_state; +t38_gateway_state_t t38_g_state; +fax_stats.pages_tx = fax_stats.pages_rx = 0; +fax_init(&fax_state,TRUE); +t30_set_ecm_capability(fax_get_t30_state(&fax_state),1); +t30_set_supported_compressions(fax_get_t30_state(&fax_state),T30_SUPPORT_T6_COMPRESSION); +t30_set_tx_file(fax_get_t30_state(&fax_state),"abc",-1,-1); +t30_set_tx_ident(fax_get_t30_state(&fax_state),"xyz"); +fax_set_transmit_on_idle(&fax_state,1); +t38_terminal_init(&t38_t_state,TRUE,NULL,NULL); +t38_gateway_init(&t38_g_state,NULL,NULL); +], +HAVE_SPANDSP="yes" +) +if [[ "x$HAVE_SPANDSP" = "xyes" ]]; then +SPANDSP_INC="-I$ac_cv_use_spandsp -DSPANDSP_TXRXSTATS" +else +AC_TRY_COMPILE([ +#define __STDC_LIMIT_MACROS +#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES +#include +#include +#include +#include +#include +],[ +fax_state_t fax_state; t38_terminal_state_t t38_t_state; t38_gateway_state_t t38_g_state; fax_init(&fax_state,TRUE); @@ -727,6 +755,7 @@ if [[ "x$HAVE_SPANDSP" = "xyes" ]]; then SPANDSP_INC="-I$ac_cv_use_spandsp -DSPANDSP_PRE006" fi fi +fi CFLAGS="$SAVE_CFLAGS" AC_LANG_RESTORE fi diff --git a/modules/faxchan.cpp b/modules/faxchan.cpp index 527d446b..7d490a5a 100644 --- a/modules/faxchan.cpp +++ b/modules/faxchan.cpp @@ -618,11 +618,15 @@ void FaxChan::updateInfo(t30_state_t* t30) t30_get_transfer_statistics(t30, &t); if (!t.error_correcting_mode) m_ecm = false; +#ifdef SPANDSP_TXRXSTATS + m_pages = t.pages_tx + t.pages_rx; +#else m_pages = t.pages_transferred; +#endif Debug(this,DebugAll,"bit rate %d", t.bit_rate); Debug(this,DebugAll,"error correction %d", t.error_correcting_mode); - Debug(this,DebugAll,"pages transferred %d", t.pages_transferred); + Debug(this,DebugAll,"pages transferred %d", m_pages); Debug(this,DebugAll,"image size %d x %d", t.width, t.length); Debug(this,DebugAll,"image resolution %d x %d", t.x_resolution, t.y_resolution); Debug(this,DebugAll,"bad rows %d", t.bad_rows);