[svn-commits] mnicholson: branch irroot/t38gateway-trunk r323862 - /team/irroot/t38gateway-...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jun 15 14:57:27 CDT 2011


Author: mnicholson
Date: Wed Jun 15 14:57:20 2011
New Revision: 323862

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=323862
Log:
support gateway mode for fancy cli output

Modified:
    team/irroot/t38gateway-trunk/res/res_fax_spandsp.c

Modified: team/irroot/t38gateway-trunk/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-trunk/res/res_fax_spandsp.c?view=diff&rev=323862&r1=323861&r2=323862
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax_spandsp.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax_spandsp.c Wed Jun 15 14:57:20 2011
@@ -865,7 +865,7 @@
 /*! \brief */
 static char *spandsp_fax_cli_show_capabilities(int fd)
 {
-	ast_cli(fd, "SEND RECEIVE T.38 G.711\n\n");
+	ast_cli(fd, "SEND RECEIVE T.38 G.711 GATEWAY\n\n");
 	return  CLI_SUCCESS;
 }
 
@@ -873,35 +873,48 @@
 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 (s->details->caps & AST_FAX_TECH_GATEWAY) {
+		ast_cli(fd, "%-22s : %d\n", "session", s->id);
+		ast_cli(fd, "%-22s : %s\n", "operation", "Gateway");
+		ast_cli(fd, "%-22s : %s\n", "state", ast_fax_state_to_str(s->state));
+		if (s->state != AST_FAX_STATE_UNINITIALIZED) {
+			t38_stats_t stats;
+			t38_gateway_get_transfer_statistics(&p->t38_gw_state, &stats);
+			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 : %d\n", "Page Number", stats.pages_transferred + 1);
+		}
+	} else {
+		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_stats_t stats;
+			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) + 1);
+			ast_cli(fd, "%-22s : %d\n", "Page Number", ((s->details->caps & AST_FAX_TECH_RECEIVE) ? stats.pages_rx : stats.pages_tx) + 1);
 #else
-		ast_cli(fd, "%-22s : %d\n", "Page Number", stats.pages_transferred + 1);
+			ast_cli(fd, "%-22s : %d\n", "Page Number", stats.pages_transferred + 1);
 #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");
+			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);
+			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);
+			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);
+			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");




More information about the svn-commits mailing list