[asterisk-commits] pcadach: branch pcadach/chan_h323-live r42636 - /team/pcadach/chan_h323-live/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Sep 10 06:23:02 MST 2006


Author: pcadach
Date: Sun Sep 10 08:23:02 2006
New Revision: 42636

URL: http://svn.digium.com/view/asterisk?rev=3D42636&view=3Drev
Log:
Debug logging updated

Modified:
    team/pcadach/chan_h323-live/channels/chan_h323.c

Modified: team/pcadach/chan_h323-live/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channe=
ls/chan_h323.c?rev=3D42636&r1=3D42635&r2=3D42636&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- team/pcadach/chan_h323-live/channels/chan_h323.c (original)
+++ team/pcadach/chan_h323-live/channels/chan_h323.c Sun Sep 10 08:23:02 20=
06
@@ -362,7 +362,7 @@
 					ast_sched_del(sched, pvt->DTMFsched);
 				pvt->DTMFsched =3D ast_sched_add(sched, pvt->newduration, oh323_simula=
te_dtmf_end, pvt);
 				if (h323debug)
-					ast_log(LOG_DEBUG, "Scheduled DTMF END simulation for %d ms, id=3D%d\=
n", pvt->newduration, pvt->DTMFsched);
+					ast_log(LOG_DTMF, "Scheduled DTMF END simulation for %d ms, id=3D%d\n=
", pvt->newduration, pvt->DTMFsched);
 			}
 			pvt->curDTMF =3D pvt->newdigit;
 		}
@@ -440,7 +440,8 @@
 	/* Unlink us from the owner if we have one */
 	if (pvt->owner) {
 		ast_channel_lock(pvt->owner);
-		ast_log(LOG_DEBUG, "Detaching from %s\n", pvt->owner->name);
+		if (h323debug)
+			ast_log(LOG_DEBUG, "Detaching from %s\n", pvt->owner->name);
 		pvt->owner->tech_pvt =3D NULL;
 		ast_channel_unlock(pvt->owner);
 	}
@@ -487,14 +488,14 @@
 	if (pvt->rtp && (pvt->options.dtmfmode & H323_DTMF_RFC2833) && (pvt->dtmf=
_pt > 0)) {
 		/* out-of-band DTMF */
 		if (h323debug) {
-			ast_log(LOG_DEBUG, "Begin sending out-of-band digit %c on %s\n", digit,=
 c->name);
+			ast_log(LOG_DTMF, "Begin sending out-of-band digit %c on %s\n", digit, =
c->name);
 		}
 		ast_rtp_senddigit_begin(pvt->rtp, digit);
 		ast_mutex_unlock(&pvt->lock);
 	} else {
 		/* in-band DTMF */
 		if (h323debug) {
-			ast_log(LOG_DEBUG, "Begin sending inband digit %c on %s\n", digit, c->n=
ame);
+			ast_log(LOG_DTMF, "Begin sending inband digit %c on %s\n", digit, c->na=
me);
 		}
 		token =3D pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL;
 		ast_mutex_unlock(&pvt->lock);
@@ -524,14 +525,14 @@
 	if (pvt->rtp && (pvt->options.dtmfmode & H323_DTMF_RFC2833) && (pvt->dtmf=
_pt > 0)) {
 		/* out-of-band DTMF */
 		if (h323debug) {
-			ast_log(LOG_DEBUG, "End sending out-of-band digit %c on %s\n", digit, c=
->name);
+			ast_log(LOG_DTMF, "End sending out-of-band digit %c on %s\n", digit, c-=
>name);
 		}
 		ast_rtp_senddigit_end(pvt->rtp, digit);
 		ast_mutex_unlock(&pvt->lock);
 	} else {
 		/* in-band DTMF */
 		if (h323debug) {
-			ast_log(LOG_DEBUG, "End sending inband digit %c on %s\n", digit, c->nam=
e);
+			ast_log(LOG_DTMF, "End sending inband digit %c on %s\n", digit, c->name=
);
 		}
 		token =3D pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL;
 		ast_mutex_unlock(&pvt->lock);
@@ -637,7 +638,7 @@
 		ast_log(LOG_DEBUG, "Hanging up and scheduling destroy of call %s\n", c->=
name);
 =

 	if (!c->tech_pvt) {
-		ast_log(LOG_DEBUG, "Asked to hangup channel not connected\n");
+		ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
 		return 0;
 	}
 	ast_mutex_lock(&pvt->lock);
@@ -677,7 +678,7 @@
 			/* Release lock to eliminate deadlock */
 			ast_mutex_unlock(&pvt->lock);
 			if (h323_clear_call(call_token, q931cause)) {
-				ast_log(LOG_DEBUG, "ClearCall failed.\n");
+				ast_log(LOG_WARNING, "ClearCall failed.\n");
 			}
 			free(call_token);
 			ast_mutex_lock(&pvt->lock);
@@ -716,7 +717,8 @@
 					ast_log(LOG_NOTICE, "Format changed but channel is locked. Ignoring f=
rame...\n");
 					return &ast_null_frame;
 				}
-				ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
+				if (h323debug)
+					ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
 				pvt->owner->nativeformats =3D f->subclass;
 				pvt->nativeformats =3D f->subclass;
 				ast_set_read_format(pvt->owner, pvt->owner->readformat);
@@ -732,7 +734,8 @@
 				else
 					ast_log(LOG_NOTICE, "Unable to process inband DTMF while channel is l=
ocked\n");
 				if (f &&(f->frametype =3D=3D AST_FRAME_DTMF)) {
-					ast_log(LOG_DEBUG, "Received in-band digit %c.\n", f->subclass);
+					if (h323debug)
+						ast_log(LOG_DTMF, "Received in-band digit %c.\n", f->subclass);
 				}
 			}
 		}
@@ -1530,7 +1533,8 @@
 		pvt->jointcapability =3D pvt->options.capability;
 #if 0
 		if (pvt->rtp) {
-			ast_log(LOG_DEBUG, "Setting NAT on RTP to %d\n", pvt->options.nat);
+			if (h323debug)
+				ast_log(LOG_DEBUG, "Setting NAT on RTP to %d\n", pvt->options.nat);
 			ast_rtp_setnat(pvt->rtp, pvt->options.nat);
 		}
 #endif
@@ -1567,7 +1571,8 @@
 			}
 #if 0
 			if (pvt->rtp) {
-				ast_log(LOG_DEBUG, "Setting NAT on RTP to %d\n", pvt->options.nat);
+				if (h323debug)
+					ast_log(LOG_DEBUG, "Setting NAT on RTP to %d\n", pvt->options.nat);
 				ast_rtp_setnat(pvt->rtp, pvt->options.nat);
 			}
 #endif
@@ -1645,7 +1650,8 @@
 		pvt->jointcapability =3D pvt->options.capability;
 #if 0
 		if (pvt->rtp) {
-			ast_log(LOG_DEBUG, "Setting NAT on RTP to %d\n", pvt->options.nat);
+			if (h323debug)
+				ast_log(LOG_DEBUG, "Setting NAT on RTP to %d\n", pvt->options.nat);
 			ast_rtp_setnat(pvt->rtp, pvt->options.nat);
 		}
 #endif
@@ -1703,7 +1709,7 @@
 		return -1;
 	}
 	if (h323debug)
-		ast_log(LOG_DEBUG, "Received %s digit '%c' (%u ms) for call %s\n", (digi=
t =3D=3D ' ' ? "update for" : "new"), (digit =3D=3D ' ' ? pvt->curDTMF : di=
git), duration, token);
+		ast_log(LOG_DTMF, "Received %s digit '%c' (%u ms) for call %s\n", (digit=
 =3D=3D ' ' ? "update for" : "new"), (digit =3D=3D ' ' ? pvt->curDTMF : dig=
it), duration, token);
 =

 	if (pvt->owner && !ast_channel_trylock(pvt->owner)) {
 		if (digit =3D=3D '!')
@@ -1728,7 +1734,7 @@
 						ast_sched_del(sched, pvt->DTMFsched);
 					pvt->DTMFsched =3D ast_sched_add(sched, duration, oh323_simulate_dtmf=
_end, pvt);
 					if (h323debug)
-						ast_log(LOG_DEBUG, "Scheduled DTMF END simulation for %d ms, id=3D%d=
\n", duration, pvt->DTMFsched);
+						ast_log(LOG_DTMF, "Scheduled DTMF END simulation for %d ms, id=3D%d\=
n", duration, pvt->DTMFsched);
 				}
 				pvt->curDTMF =3D digit;
 			}
@@ -2153,7 +2159,8 @@
 {	=

 	struct oh323_pvt *pvt;
 =

-	ast_log(LOG_DEBUG, "Cleaning connection to %s\n", call_token);
+	if (h323debug)
+		ast_log(LOG_DEBUG, "Cleaning connection to %s\n", call_token);
 	=

 	while (1) {
 		pvt =3D find_call_locked(call_reference, call_token);
@@ -2222,7 +2229,8 @@
 	else {
 		pvt->needhangup =3D 1;
 		pvt->hangupcause =3D cause;
-		ast_log(LOG_DEBUG, "Hangup for %s is pending\n", token);
+		if (h323debug)
+			ast_log(LOG_DEBUG, "Hangup for %s is pending\n", token);
 	}
 	ast_mutex_unlock(&pvt->lock);
 }



More information about the asterisk-commits mailing list