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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Sep 8 10:41:57 MST 2006


Author: pcadach
Date: Fri Sep  8 12:41:57 2006
New Revision: 42446

URL: http://svn.digium.com/view/asterisk?rev=42446&view=rev
Log:
Cleanup debugging messages

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/channels/chan_h323.c?rev=42446&r1=42445&r2=42446&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/chan_h323.c (original)
+++ team/pcadach/chan_h323-live/channels/chan_h323.c Fri Sep  8 12:41:57 2006
@@ -580,19 +580,17 @@
 	/* make sure null terminated */
 	called_addr[sizeof(called_addr) - 1] = '\0'; 
 
-	if (c->cid.cid_num) {
+	if (c->cid.cid_num)
 		strncpy(pvt->options.cid_num, c->cid.cid_num, sizeof(pvt->options.cid_num));
-		ast_log(LOG_DEBUG, "Setting CID number to %s\n", pvt->options.cid_num);
-	}
-	if (c->cid.cid_name) {
+
+	if (c->cid.cid_name)
 		strncpy(pvt->options.cid_name, c->cid.cid_name, sizeof(pvt->options.cid_name));
-		ast_log(LOG_DEBUG, "Setting CID name to %s\n", pvt->options.cid_name);
-	}
 
 	/* indicate that this is an outgoing call */
 	pvt->outgoing = 1;
 
-	ast_log(LOG_DEBUG, "Placing outgoing call to %s, %d\n", called_addr, pvt->options.dtmfcodec);
+	if (h323debug)
+		ast_log(LOG_DEBUG, "Placing outgoing call to %s, %d\n", called_addr, pvt->options.dtmfcodec);
 	ast_mutex_unlock(&pvt->lock);
 	res = h323_make_call(called_addr, &(pvt->cd), &pvt->options);
 	if (res) {
@@ -1599,8 +1597,10 @@
 	char *ext, *host;
 	char *h323id = NULL;
 	char tmp[256], tmp1[256];
-	
-	ast_log(LOG_DEBUG, "type=%s, format=%d, data=%s.\n", type, format, (char *)data);
+
+	if (h323debug)	
+		ast_log(LOG_DEBUG, "type=%s, format=%d, data=%s.\n", type, format, (char *)data);
+
 	pvt = oh323_alloc(0);
 	if (!pvt) {
 		ast_log(LOG_WARNING, "Unable to build pvt data for '%s'\n", (char *)data);
@@ -1630,7 +1630,9 @@
 	if (ext) {
 		strncpy(pvt->exten, ext, sizeof(pvt->exten) - 1);
 	}
-	ast_log(LOG_DEBUG, "Extension: %s Host: %s\n",  pvt->exten, host);
+	if (h323debug)
+		ast_log(LOG_DEBUG, "Extension: %s Host: %s\n",  pvt->exten, host);
+
 	if (!usingGk) {
 		if (create_addr(pvt, host)) {
 			oh323_destroy(pvt);
@@ -1931,7 +1933,8 @@
 {
 	struct oh323_pvt *pvt;
 
-	ast_log(LOG_DEBUG, "Received ALERT/PROGRESS message for %s tones\n", (inband ? "inband" : "self-generated"));
+	if (h323debug)
+		ast_log(LOG_DEBUG, "Received ALERT/PROGRESS message for %s tones\n", (inband ? "inband" : "self-generated"));
 
 	pvt = find_call_locked(call_reference, token);
 	if (!pvt) {
@@ -2018,7 +2021,8 @@
 				return NULL;
 			}
 			strncpy(pvt->context, default_context, sizeof(pvt->context) - 1);
-			ast_log(LOG_DEBUG, "Sending %s to context [%s]\n", cd->call_source_aliases, pvt->context);
+			if (h323debug)
+				ast_log(LOG_DEBUG, "Sending %s to context [%s]\n", cd->call_source_aliases, pvt->context);
 			/* XXX: Is it really required??? */
 #if 0
 			memset(&pvt->options, 0, sizeof(pvt->options));



More information about the asterisk-commits mailing list