[asterisk-commits] mnicholson: branch group/res_fax r244437 - /team/group/res_fax/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 2 15:43:55 CST 2010


Author: mnicholson
Date: Tue Feb  2 15:43:53 2010
New Revision: 244437

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244437
Log:
Use details->option.debug (set fax debug) to decide when to enable debug mode.

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=244437&r1=244436&r2=244437
==============================================================================
--- team/group/res_fax/res/res_fax_spandsp.c (original)
+++ team/group/res_fax/res/res_fax_spandsp.c Tue Feb  2 15:43:53 2010
@@ -129,7 +129,7 @@
 static void spandsp_log(int level, const char *msg);
 static int update_stats(struct spandsp_pvt *p, int completion_code);
 
-static void set_logging(logging_state_t *state);
+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);
 static void set_file(t30_state_t *t30_state, struct ast_fax_session_details *details);
 static void set_ecm(t30_state_t *t30_state, struct ast_fax_session_details *details);
@@ -368,9 +368,13 @@
 	}
 }
 
-static void set_logging(logging_state_t *state)
-{
-	int level = SPAN_LOG_WARNING + option_debug;
+static void set_logging(logging_state_t *state, struct ast_fax_session_details *details)
+{
+	int level = SPAN_LOG_WARNING;
+
+        if (details->option.debug) {
+		level = SPAN_LOG_DEBUG_3;
+	}
 
 	span_log_set_message_handler(state, spandsp_log);
 	span_log_set_level(state, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | level);
@@ -445,13 +449,13 @@
 
 		/* init t38 stuff */
 		t38_terminal_init(&p->t38_state, caller_mode, t38_tx_packet_handler, p);
-		set_logging(&p->t38_state.logging);
+		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);
+		set_logging(&p->fax_state.logging, s->details);
 	}
 
 	s->state = AST_FAX_STATE_INITIALIZED;
@@ -571,7 +575,7 @@
 #endif
 	}
 
-	set_logging(&p->t30_state->logging);
+	set_logging(&p->t30_state->logging, s->details);
 
 	/* set some parameters */
 	set_local_info(p->t30_state, s->details);
@@ -584,7 +588,7 @@
 
 	/* set T.38 parameters */
 	if (p->ist38) {
-		set_logging(&p->t38_core_state->logging);
+		set_logging(&p->t38_core_state->logging, s->details);
 
 		t38_set_max_datagram_size(p->t38_core_state, s->details->their_t38_parameters.max_ifp);
 




More information about the asterisk-commits mailing list