[asterisk-commits] moy: branch moy/mfcr2-1.4 r217520 - /team/moy/mfcr2-1.4/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 9 15:58:54 CDT 2009


Author: moy
Date: Wed Sep  9 15:58:52 2009
New Revision: 217520

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=217520
Log:
more ast_verbose logging replacements

Modified:
    team/moy/mfcr2-1.4/channels/chan_dahdi.c

Modified: team/moy/mfcr2-1.4/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/moy/mfcr2-1.4/channels/chan_dahdi.c?view=diff&rev=217520&r1=217519&r2=217520
==============================================================================
--- team/moy/mfcr2-1.4/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2-1.4/channels/chan_dahdi.c Wed Sep  9 15:58:52 2009
@@ -1466,18 +1466,18 @@
 {
 	struct dahdi_pvt *p = NULL;
 	struct ast_channel *c = NULL;
-	ast_log(LOG_NOTICE, "MFC/R2 call has been accepted on chan %d\n", openr2_chan_get_number(r2chan));
 	p = openr2_chan_get_client_data(r2chan);
 	dahdi_enable_ec(p);
 	p->mfcr2_call_accepted = 1;
 	if (OR2_DIR_BACKWARD == openr2_chan_get_direction(r2chan)) {
+		ast_verbose("MFC/R2 call has been accepted on backward channel %d\n", openr2_chan_get_number(r2chan));
 		/* if accept on offer is not set, it means at this point the PBX thread is already
 		   launched and therefore this callback is being executed in the PBX thread rather than
 		   the monitor thread, don't launch any other thread, just disable the R2 reading and
 		   answer the call */
 		if (!p->mfcr2_accept_on_offer) {
 			openr2_chan_disable_read(r2chan);
-			ast_log(LOG_NOTICE, "Answering MFC/R2 call after accepting it on chan %d\n", openr2_chan_get_number(r2chan));
+			ast_verbose("Answering MFC/R2 call after accepting it on chan %d\n", openr2_chan_get_number(r2chan));
 			dahdi_r2_answer(p);
 			return;
 		}
@@ -1492,7 +1492,7 @@
 			return;
 		}
 	} else {
-		ast_log(LOG_NOTICE, "Call accepted on forward channel %d\n", p->channel);
+		ast_verbose("Call accepted on forward channel %d\n", p->channel);
 		p->subs[SUB_REAL].needringing = 1;
 		p->dialing = 0;
 		/* chan_dahdi will take care of reading from now on, tell the library to forget about it */
@@ -1503,7 +1503,7 @@
 static void dahdi_r2_on_call_answered(openr2_chan_t *r2chan)
 {
 	struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
-	ast_log(LOG_DEBUG, "MFC/R2 call has been answered on chan %d\n", openr2_chan_get_number(r2chan));
+	ast_verbose("MFC/R2 call has been answered on chan %d\n", openr2_chan_get_number(r2chan));
 	p->subs[SUB_REAL].needanswer = 1;
 }
 
@@ -1536,7 +1536,7 @@
 static void dahdi_r2_on_call_disconnect(openr2_chan_t *r2chan, openr2_call_disconnect_cause_t cause)
 {
 	struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
-	ast_log(LOG_NOTICE, "MFC/R2 call disconnected on chan %d\n", openr2_chan_get_number(r2chan));
+	ast_verbose("MFC/R2 call disconnected on chan %d\n", openr2_chan_get_number(r2chan));
 	ast_mutex_lock(&p->lock);
 	if (p->owner) {
 		/* when we have an owner we don't call openr2_chan_disconnect_call here, that will
@@ -1601,7 +1601,7 @@
 {
 	switch (level) {
 	case OR2_LOG_NOTICE:
-		ast_log(LOG_NOTICE, "%s", logmessage);
+		ast_verbose("%s", logmessage);
 		break;
 	case OR2_LOG_WARNING:
 		ast_log(LOG_WARNING, "%s", logmessage);
@@ -1695,6 +1695,11 @@
 	p->cid_name[p->mfcr2_ani_index] = 0;
 }
 
+static void dahdi_r2_on_billing_pulse_received(openr2_chan_t *r2chan)
+{
+	ast_log(LOG_NOTICE, "MFC/R2 billing pulse received on channel %d\n", openr2_chan_get_number(r2chan));
+}
+
 static openr2_event_interface_t dahdi_r2_event_iface = {
 	.on_call_init = dahdi_r2_on_call_init,
 	.on_call_offered = dahdi_r2_on_call_offered,
@@ -1712,8 +1717,8 @@
 	.on_context_log = (openr2_handle_context_logging_func)dahdi_r2_on_context_log,
 	.on_dnis_digit_received = dahdi_r2_on_dnis_digit_received,
 	.on_ani_digit_received = dahdi_r2_on_ani_digit_received,
-	/* so far we do nothing with billing pulses */
-	.on_billing_pulse_received = NULL
+	/* so far we do nothing with billing pulses, just log it */
+	.on_billing_pulse_received = dahdi_r2_on_billing_pulse_received 
 };
 
 static inline int16_t dahdi_r2_alaw_to_linear(uint8_t sample)




More information about the asterisk-commits mailing list