[asterisk-commits] mnicholson: branch group/res_fax r239618 - /team/group/res_fax/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jan 12 14:46:56 CST 2010
Author: mnicholson
Date: Tue Jan 12 14:46:54 2010
New Revision: 239618
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=239618
Log:
First implementation of the cli_show_session ast_fax_tech function.
Modified:
team/group/res_fax/res/res_fax_spandsp.c
Modified: team/group/res_fax/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/team/group/res_fax/res/res_fax_spandsp.c?view=diff&rev=239618&r1=239617&r2=239618
==============================================================================
--- team/group/res_fax/res/res_fax_spandsp.c (original)
+++ team/group/res_fax/res/res_fax_spandsp.c Tue Jan 12 14:46:54 2010
@@ -42,6 +42,7 @@
#include "asterisk/cli.h"
#include "asterisk/utils.h"
#include "asterisk/timing.h"
+#include "asterisk/astobj2.h"
#include "asterisk/res_fax.h"
#define SPANDSP_FAX_SAMPLES 160
@@ -530,6 +531,39 @@
static char *spandsp_fax_cli_show_session(struct ast_fax_session *s, int fd)
{
+ struct spandsp_pvt *p = s->tech_pvt;
+ t30_stats_t stats;
+
+ ao2_lock(s);
+ ast_cli(fd, "%-22s : %d\n", "session", s->id);
+ ast_cli(fd, "%-22s : %s\n", "operation", (s->details->caps & AST_FAX_TECH_RECEIVE) ? "Receive" : "Transmit");
+ ast_cli(fd, "%-22s : %s\n", "state", ast_fax_state_to_str(s->state));
+ if (s->state != AST_FAX_STATE_UNINITIALIZED) {
+ t30_get_transfer_statistics(p->t30_state, &stats);
+ ast_cli(fd, "%-22s : %s\n", "Last Status", t30_completion_code_to_str(stats.current_status));
+ ast_cli(fd, "%-22s : %s\n", "ECM Mode", stats.error_correcting_mode ? "Yes" : "No");
+ ast_cli(fd, "%-22s : %d\n", "Data Rate", stats.bit_rate);
+ ast_cli(fd, "%-22s : %dx%d\n", "Image Resolution", stats.x_resolution, stats.y_resolution);
+#if SPANDSP_RELEASE_DATE >= 20090220
+ ast_cli(fd, "%-22s : %d\n", "Page Number", (s->details->caps & AST_FAX_TECH_RECEIVE) ? stats.pages_rx : stats.pages_tx);
+#else
+ ast_cli(fd, "%-22s : %d\n", "Page Number", stats.pages_transferred);
+#endif
+ ast_cli(fd, "%-22s : %s\n", "File Name", s->details->caps & AST_FAX_TECH_RECEIVE ? p->t30_state->rx_file : p->t30_state->tx_file);
+
+ ast_cli(fd, "\nData Statistics:\n");
+#if SPANDSP_RELEASE_DATE >= 20090220
+ ast_cli(fd, "%-22s : %d\n", "Tx Pages", stats.pages_tx);
+ ast_cli(fd, "%-22s : %d\n", "Rx Pages", stats.pages_rx);
+#else
+ ast_cli(fd, "%-22s : %d\n", "Tx Pages", (s->details->caps & AST_FAX_TECH_SEND) ? stats.pages_transferred : 0);
+ ast_cli(fd, "%-22s : %d\n", "Rx Pages", (s->details->caps & AST_FAX_TECH_RECEIVE) ? stats.pages_transferred : 0);
+#endif
+ ast_cli(fd, "%-22s : %d\n", "Longest Bad Line Run", stats.longest_bad_row_run);
+ ast_cli(fd, "%-22s : %d\n", "Total Bad Lines", stats.bad_rows);
+ }
+ ao2_unlock(s);
+ ast_cli(fd, "\n\n");
return CLI_SUCCESS;
}
More information about the asterisk-commits
mailing list