Index: channels/chan_phone.c
===================================================================
--- channels/chan_phone.c	(revision 16722)
+++ channels/chan_phone.c	(working copy)
@@ -522,13 +522,14 @@
 		}
 	}
 #if 1
-	if (phonee.bits.pstn_ring)
-		ast_verbose("Unit is ringing\n");
-	if (phonee.bits.caller_id) {
-		ast_verbose("We have caller ID\n");
+	if (option_verbose > 3) {
+		if (phonee.bits.pstn_ring)
+			ast_verbose("Unit is ringing\n");
+		if (phonee.bits.caller_id)
+			ast_verbose("We have caller ID\n");
+		if (phonee.bits.pstn_wink)
+			ast_verbose("Detected Wink\n");
 	}
-	if (phonee.bits.pstn_wink)
-		ast_verbose("Detected Wink\n");
 #endif
 	/* Strange -- nothing there.. */
 	p->fr.frametype = AST_FRAME_NULL;
@@ -931,7 +932,8 @@
 				}
 			}
 #if 0
-			ast_verbose("Extension is %s\n", i->ext);
+			if (option_verbose > 3)
+				ast_verbose("Extension is %s\n", i->ext);
 #endif
 		}
 	}
@@ -974,13 +976,12 @@
 		}
 	}
 	if (phonee.bits.pstn_ring) {
-		ast_verbose("Unit is ringing\n");
+		if (option_verbose > 2)
+			ast_verbose("Unit is ringing\n");
 		phone_new(i, AST_STATE_RING, i->context);
 	}
-	if (phonee.bits.caller_id)
+	if (phonee.bits.caller_id && (option_verbose > 2))
 		ast_verbose("We have caller ID\n");
-	
-	
 }
 
 static void *do_monitor(void *data)
Index: channels/chan_skinny.c
===================================================================
--- channels/chan_skinny.c	(revision 16722)
+++ channels/chan_skinny.c	(working copy)
@@ -1569,7 +1569,8 @@
 					strncpy(l->mailbox, mailbox, sizeof(l->mailbox)-1);
 					strncpy(l->mailbox, mailbox, sizeof(l->mailbox)-1);
 					if (!ast_strlen_zero(mailbox)) {
-						ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
 					}
 					l->msgstate = -1;
 					l->capability = capability;
@@ -1596,7 +1597,8 @@
 					for (i = 0; i < MAX_SUBS; i++) {
 						sub = malloc(sizeof(struct skinny_subchannel));
 						if (sub) {
-							ast_verbose(VERBOSE_PREFIX_3 "Allocating Skinny subchannel '%d' on %s@%s\n", i, l->name, d->name);
+							if (option_verbose > 2)
+								ast_verbose(VERBOSE_PREFIX_3 "Allocating Skinny subchannel '%d' on %s@%s\n", i, l->name, d->name);
 							memset(sub, 0, sizeof(struct skinny_subchannel));
 							ast_mutex_init(&sub->lock);
 							sub->parent = l;
@@ -1699,10 +1701,9 @@
 	int res;
 	int getforward=0;
 
-	if (option_verbose > 2) {
+	if (option_verbose > 2)
 		ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s@%s'\n", l->name, l->parent->name);
-	}
-	while(len < AST_MAX_EXTENSION-1) {
+	while (len < AST_MAX_EXTENSION-1) {
 		res = ast_waitfordigit(chan, timeout);
 		timeout = 0;
 		if (res < 0) {
@@ -1724,10 +1725,9 @@
 				if (getforward) {
 					/* Record this as the forwarding extension */
 					strncpy(l->call_forward, exten, sizeof(l->call_forward) - 1);
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n",
 							l->call_forward, chan->name);
-					}
 					transmit_tone(s, SKINNY_DIALTONE);
 					if (res) {
 						break;
@@ -1766,9 +1766,8 @@
 			ast_hangup(chan);
 			return NULL;
 		} else if (l->callwaiting && !strcmp(exten, "*70")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
-			}
 			/* Disable call waiting if enabled */
 			l->callwaiting = 0;
 			transmit_tone(s, SKINNY_DIALTONE);
@@ -1787,9 +1786,8 @@
 			ast_hangup(chan);
 			return NULL;
 		} else if (!l->hidecallerid && !strcmp(exten, "*67")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
-			}
 			/* Disable Caller*ID if enabled */
 			l->hidecallerid = 1;
 			if (chan->cid.cid_num) {
@@ -1815,9 +1813,8 @@
 			break;
 		} else if (!strcmp(exten, "*78")) {
 			/* Do not disturb */
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %s\n", chan->name);
-			}
 			transmit_tone(s, SKINNY_DIALTONE);
 			l->dnd = 1;
 			getforward = 0;
@@ -1825,9 +1822,8 @@
 			len = 0;
 		} else if (!strcmp(exten, "*79")) {
 			/* Do not disturb */
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %s\n", chan->name);
-			}
 			transmit_tone(s, SKINNY_DIALTONE);
 			l->dnd = 0;
 			getforward = 0;
@@ -1839,9 +1835,8 @@
 			memset(exten, 0, sizeof(exten));
 			len = 0;
 		} else if (l->cancallforward && !strcmp(exten, "*73")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %s\n", chan->name);
-			}
 			transmit_tone(s, SKINNY_DIALTONE);
 			memset(l->call_forward, 0, sizeof(l->call_forward));
 			getforward = 0;
@@ -1853,14 +1848,12 @@
 			/* This is a three way call, the main call being a real channel,
 			   and we're parking the first call. */
 			ast_masq_park_call(ast_bridged_channel(sub->next->owner), chan, 0, NULL);
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
-			}
 			break;
 		} else if (!ast_strlen_zero(l->lastcallerid) && !strcmp(exten, "*60")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", l->lastcallerid);
-			}
 			res = ast_db_put("blacklist", l->lastcallerid, "1");
 			if (!res) {
 				transmit_tone(s, SKINNY_DIALTONE);
@@ -1868,9 +1861,8 @@
 				len = 0;
 			}
 		} else if (l->hidecallerid && !strcmp(exten, "*82")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
-			}
 			/* Enable Caller*ID if enabled */
 			l->hidecallerid = 0;
 			if (chan->cid.cid_num) {
@@ -2049,7 +2041,9 @@
 	if (!sub->rtp) {
 		start_rtp(sub);
 	}
-	ast_verbose("skinny_answer(%s) on %s@%s-%d\n", ast->name, l->name, l->parent->name, sub->callid);
+	if (skinnydebug) {
+		ast_verbose("skinny_answer(%s) on %s@%s-%d\n", ast->name, l->name, l->parent->name, sub->callid);
+	}
 	if (ast->_state != AST_STATE_UP) {
 		ast_setstate(ast, AST_STATE_UP);
 	}
@@ -2262,7 +2256,9 @@
 		if (!tmp->nativeformats)
 			tmp->nativeformats = capability;
 		fmt = ast_best_codec(tmp->nativeformats);
-		ast_verbose("skinny_new: tmp->nativeformats=%d fmt=%d\n", tmp->nativeformats, fmt);
+		if (skinnydebug) {
+			ast_verbose("skinny_new: tmp->nativeformats=%d fmt=%d\n", tmp->nativeformats, fmt);
+		}
 		ast_string_field_build(tmp, name, "Skinny/%s@%s-%d", l->name, l->parent->name, sub->callid);
 		if (sub->rtp) {
 			tmp->fds[0] = ast_rtp_fd(sub->rtp);
@@ -2365,9 +2361,8 @@
 			transmit_response(s, req);
 			break;
 		}
-		if (option_verbose > 2) {
+		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Device '%s' successfuly registered\n", s->device->name);
-		}
 		memset(req, 0, SKINNY_MAX_PACKET);
 		req->len = htolel(sizeof(register_ack_message)+4);
 		req->e = htolel(REGISTER_ACK_MESSAGE);
@@ -2449,16 +2444,14 @@
 			/* Do not disturb */
 			transmit_tone(s, SKINNY_DIALTONE);
 			if (s->device->lines->dnd != 0){
-				if (option_verbose > 2) {
+				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Disabling DND on %s@%s\n",find_subchannel_by_line(s->device->lines)->parent->name,find_subchannel_by_line(s->device->lines)->parent->name);
-				}
 				s->device->lines->dnd = 0;
 				transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON);
 				transmit_displaynotify(s, "DnD disabled",10);
 			} else {
-				if (option_verbose > 2) {
+				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Enabling DND on %s@%s\n",find_subchannel_by_line(s->device->lines)->parent->name,find_subchannel_by_line(s->device->lines)->parent->name);
-				}
 				s->device->lines->dnd = 1;
 				transmit_lamp_indication(s, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_OFF);
 				transmit_displaynotify(s, "DnD enabled",10);
@@ -2486,7 +2479,9 @@
 			transmit_speaker_mode(s, 1);
 		break;
 		default:
-			ast_verbose("RECEIVED UNKNOWN STIMULUS:  %d(%d)\n", stimulus, stimulusInstance);
+			if (skinnydebug) {
+				ast_verbose("RECEIVED UNKNOWN STIMULUS:  %d(%d)\n", stimulus, stimulusInstance);
+			}
 			break;
 		}
 		break;
@@ -2776,11 +2771,15 @@
 				ast_queue_frame(sub->next->owner, &f);
 			}
 		} else {
-			ast_verbose("No owner: %s\n", s->device->lines->name);
+			if (skinnydebug) {
+				ast_verbose("No owner: %s\n", s->device->lines->name);
+			}
 		}
 		break;
 	case OPEN_RECIEVE_CHANNEL_ACK_MESSAGE:
-		ast_verbose("Recieved Open Recieve Channel Ack\n");
+		if (skinnydebug) {
+			ast_verbose("Recieved Open Recieve Channel Ack\n");
+		}
 		status = letohl(req->data.openrecievechannelack.status);
 		if (status) {
 			ast_log(LOG_ERROR, "Open Recieve Channel Failure\n");
@@ -2820,7 +2819,9 @@
 		transmit_response(s, req);
 		break;
 	default:
-		ast_verbose("RECEIVED UNKNOWN MESSAGE TYPE:  %x\n", letohl(req->e));
+		if (skinnydebug) {
+			ast_verbose("RECEIVED UNKNOWN MESSAGE TYPE:  %x\n", letohl(req->e));
+		}
 		break;
 	}
 	free(req);
@@ -2917,7 +2918,8 @@
 	struct skinnysession *s = data;
 	char iabuf[INET_ADDRSTRLEN];
 
-	ast_verbose(VERBOSE_PREFIX_3 "Starting Skinny session from %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), s->sin.sin_addr));
+	if (option_verbose > 2)
+		ast_verbose(VERBOSE_PREFIX_3 "Starting Skinny session from %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), s->sin.sin_addr));
 	for (;;) {
 		res = 0;
 		res = get_input(s);
@@ -3172,9 +3174,8 @@
 		} else {
 			d = build_device(cat, ast_variable_browse(cfg, cat));
 			if (d) {
-				if (option_verbose > 2) {
+				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Added device '%s'\n", d->name);
-				}
 				ast_mutex_lock(&devicelock);
 				d->next = devices;
 				devices = d;
@@ -3216,10 +3217,9 @@
 					ast_config_destroy(cfg);
 					return 0;
 			}
-			if (option_verbose > 1) {
+			if (option_verbose > 1)
 				ast_verbose(VERBOSE_PREFIX_2 "Skinny listening on %s:%d\n",
 					ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr), ntohs(bindaddr.sin_port));
-			}
 			ast_pthread_create(&accept_t,NULL, accept_thread, NULL);
 		}
 	}
Index: channels/chan_mgcp.c
===================================================================
--- channels/chan_mgcp.c	(revision 16722)
+++ channels/chan_mgcp.c	(working copy)
@@ -2562,9 +2562,8 @@
 							transmit_notify_request(p->sub, "");
 
 							/* SC: verbose level check */
-							if (option_verbose > 2) {
+							if (option_verbose > 2)
 								ast_verbose(VERBOSE_PREFIX_3 "Setting hookstate of %s@%s to ONHOOK\n", p->name, gw->name);
-							}
 						}
 					} else if (strstr(c, "hd")) {
 						if (p->hookstate != MGCP_OFFHOOK) {
@@ -2723,9 +2722,8 @@
 			ast_hangup(chan);
 			return NULL;
 		} else if (p->hascallwaiting && p->callwaiting && !strcmp(exten, "*70")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
-			}
 			/* Disable call waiting if enabled */
 			p->callwaiting = 0;
 			/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
@@ -2746,9 +2744,8 @@
 			ast_hangup(chan);
 			return NULL;
 		} else if (!p->hidecallerid && !strcmp(exten, "*67")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
-			}
 			/* Disable Caller*ID if enabled */
 			p->hidecallerid = 1;
 			if (chan->cid.cid_num)
@@ -2773,9 +2770,8 @@
 			break;
 		} else if (!strcmp(exten, "*78")) {
 			/* Do not disturb */
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %s\n", chan->name);
-			}
 			/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
 			transmit_notify_request(sub, "L/sl");
 			p->dnd = 1;
@@ -2784,9 +2780,8 @@
 			len = 0;
 		} else if (!strcmp(exten, "*79")) {
 			/* Do not disturb */
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %s\n", chan->name);
-			}
 			/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
 			transmit_notify_request(sub, "L/sl");
 			p->dnd = 0;
@@ -2800,9 +2795,8 @@
 			memset(exten, 0, sizeof(exten));
 			len = 0;
 		} else if (p->cancallforward && !strcmp(exten, "*73")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %s\n", chan->name);
-			}
 			/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
 			transmit_notify_request(sub, "L/sl");
 			memset(p->call_forward, 0, sizeof(p->call_forward));
@@ -2814,14 +2808,12 @@
 			/* This is a three way call, the main call being a real channel, 
 			   and we're parking the first call. */
 			ast_masq_park_call(ast_bridged_channel(sub->next->owner), chan, 0, NULL);
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
-			}
 			break;
 		} else if (!ast_strlen_zero(p->lastcallerid) && !strcmp(exten, "*60")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcallerid);
-			}
 			res = ast_db_put("blacklist", p->lastcallerid, "1");
 			if (!res) {
 				/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
@@ -2830,9 +2822,8 @@
 				len = 0;
 			}
 		} else if (p->hidecallerid && !strcmp(exten, "*82")) {
-			if (option_verbose > 2) {
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
-			}
 			/* Enable Caller*ID if enabled */
 			p->hidecallerid = 0;
 			if (chan->cid.cid_num)
@@ -2937,9 +2928,8 @@
 			return -1;
 		}
 		/*swap_subs(p, SUB_THREEWAY, SUB_REAL);*/
-		if (option_verbose > 2) {
+		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
-		}
 		p->sub = p->sub->next;
 		unalloc_sub(p->sub->next);
 		/* Tell the caller not to hangup */
@@ -3066,9 +3056,8 @@
 			dump_queue(p->parent, p);
 			dump_cmd_queues(p, NULL);
 			
-			if (option_verbose > 2 && (strcmp(p->name, p->parent->wcardep) != 0)) {
+			if (option_verbose > 2 && (strcmp(p->name, p->parent->wcardep) != 0))
 				ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", p->name, p->parent->name);
-			}
 			/* JS: For RSIP on wildcard we reset all endpoints */
 			if (!strcmp(p->name, p->parent->wcardep)) {
 				/* Reset all endpoints */
@@ -3080,9 +3069,8 @@
 					/*if ((strcmp(tmp_ep->name, "*") != 0) && (strcmp(tmp_ep->name, "aaln/" "*") != 0)) {*/
 					if (strcmp(tmp_ep->name, g->wcardep) != 0) {
 						struct mgcp_subchannel *tmp_sub, *first_sub;
-						if (option_verbose > 2) {
+						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", tmp_ep->name, p->parent->name);
-						}
 						
 						first_sub = tmp_ep->sub;
 						tmp_sub = tmp_ep->sub;
@@ -3147,9 +3135,8 @@
 				if (!sub->next->owner) {
 					/* plave the first call on hold and start up a new call */
 					sub->cxmode = MGCP_CX_MUTE;
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
-					}
 					transmit_modify_request(sub);
 					if (sub->owner && ast_bridged_channel(sub->owner)) {
 						ast_moh_start(ast_bridged_channel(sub->owner), NULL);
@@ -3160,10 +3147,9 @@
 					/* We've got two active calls lets decide whether or not to conference or just flip flop */
 					if ((!sub->outgoing) && (!sub->next->outgoing)) {
 						/* We made both calls lets conferenct */
-						if (option_verbose > 2) {
+						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "MGCP Conferencing %d and %d on %s@%s\n", 
 								sub->id, sub->next->id, p->name, p->parent->name);
-						}
 						sub->cxmode = MGCP_CX_CONF;
 						sub->next->cxmode = MGCP_CX_CONF;
 						if (ast_bridged_channel(sub->next->owner)) 
@@ -3174,14 +3160,12 @@
 						/* Let's flipflop between calls */
 						/* XXX Need to check for state up ??? */
 						/* XXX Need a way to indicate the current call, or maybe the call that's waiting */
-						if (option_verbose > 2) {
+						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "We didn't make one of the calls FLIPFLOP %d and %d on %s@%s\n", 
 								sub->id, sub->next->id, p->name, p->parent->name);
-						}
 						sub->cxmode = MGCP_CX_MUTE;
-						if (option_verbose > 2) {
+						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
-						}
 						transmit_modify_request(sub);
 						if (ast_bridged_channel(sub->owner)) 
 							ast_moh_start(ast_bridged_channel(sub->owner), NULL);
@@ -3194,7 +3178,8 @@
 						if (sub->next->owner && (sub->next->owner->_state != AST_STATE_UP)) {
 							handle_hd_hf(sub->next, ev);
 						} else {
-							ast_verbose(VERBOSE_PREFIX_3 "MGCP Unmuting %d on %s@%s\n", sub->next->id, p->name, p->parent->name);
+							if (option_verbose > 2)
+								ast_verbose(VERBOSE_PREFIX_3 "MGCP Unmuting %d on %s@%s\n", sub->next->id, p->name, p->parent->name);
 							sub->next->cxmode = MGCP_CX_SENDRECV;
 							transmit_modify_request(sub->next);
 						}
@@ -3255,10 +3240,9 @@
 					mgcp_queue_hangup(sub);
 				} else {
 					/* SC: verbose level check */
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
 							p->name, p->parent->name, sub->id);
-					}
 					/* Instruct the other side to remove the connection since it apparently *
 					 * still thinks the channel is active. *
 					 * For Cisco IAD2421 /BAK/ */
@@ -3273,14 +3257,12 @@
 					p->callwaiting = -1;
 				}
 				if (has_voicemail(p)) {
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(+)\n", p->name, p->parent->name);
-					}
 					transmit_notify_request(sub, "L/vmwi(+)");
 				} else {
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(-)\n", p->name, p->parent->name);
-					}
 					transmit_notify_request(sub, "L/vmwi(-)");
 				}
 			}
@@ -3815,7 +3797,8 @@
 						for (i = 0; i < MAX_SUBS; i++) {
 							sub = malloc(sizeof(struct mgcp_subchannel));
 							if (sub) {
-								ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
+								if (option_verbose > 2)
+									ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
 								memset(sub, 0, sizeof(struct mgcp_subchannel));
 								ast_mutex_init(&sub->lock);
 								ast_mutex_init(&sub->cx_queue_lock);
@@ -3884,7 +3867,8 @@
 					strncpy(e->musicclass, musicclass, sizeof(e->musicclass) - 1);
 					strncpy(e->mailbox, mailbox, sizeof(e->mailbox)-1);
 					if (!ast_strlen_zero(mailbox)) {
-						ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, gw->name, e->name);
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "Setting mailbox '%s' on %s@%s\n", mailbox, gw->name, e->name);
 					}
 					if (!ep_reload) {
 						/* XXX SC: potential issue due to reload */
@@ -3931,7 +3915,8 @@
 
 						if (sub) {
 							if (!ep_reload) {
-								ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
+								if (option_verbose > 2)
+									ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name);
 								memset(sub, 0, sizeof(struct mgcp_subchannel));
 								ast_mutex_init(&sub->lock);
 								ast_mutex_init(&sub->cx_queue_lock);
@@ -4241,9 +4226,8 @@
 			ast_mutex_lock(&gatelock);
 			g = build_gateway(cat, ast_variable_browse(cfg, cat));
 			if (g) {
-				if (option_verbose > 2) {
+				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Added gateway '%s'\n", g->name);
-				}
 				g->next = gateways;
 				gateways = g;
 			}
@@ -4313,7 +4297,8 @@
 		while (e && e->needaudit) {
 			e->needaudit = 0;
 			transmit_audit_endpoint(e);
-			ast_verbose(VERBOSE_PREFIX_3 "MGCP Auditing endpoint %s@%s for hookstate\n", e->name, g->name);
+			if (option_verbose > 2)
+				ast_verbose(VERBOSE_PREFIX_3 "MGCP Auditing endpoint %s@%s for hookstate\n", e->name, g->name);
 			e = e->next;
 		}
 		g = g->next;
Index: channels/chan_zap.c
===================================================================
--- channels/chan_zap.c	(revision 16722)
+++ channels/chan_zap.c	(working copy)
@@ -5814,12 +5814,11 @@
 				break;
 			} else if (!strcmp(exten, "*78")) {
 				/* Do not disturb */
-				if (option_verbose > 2) {
+				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %d\n", p->channel);
-					manager_event(EVENT_FLAG_SYSTEM, "DNDState",
-								"Channel: Zap/%d\r\n"
-								"Status: enabled\r\n", p->channel);
-				}
+				manager_event(EVENT_FLAG_SYSTEM, "DNDState",
+							"Channel: Zap/%d\r\n"
+							"Status: enabled\r\n", p->channel);
 				res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
 				p->dnd = 1;
 				getforward = 0;
@@ -5827,12 +5826,11 @@
 				len = 0;
 			} else if (!strcmp(exten, "*79")) {
 				/* Do not disturb */
-				if (option_verbose > 2) {
+				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %d\n", p->channel);
-					manager_event(EVENT_FLAG_SYSTEM, "DNDState",
-								"Channel: Zap/%d\r\n"
-								"Status: disabled\r\n", p->channel);
-				}
+				manager_event(EVENT_FLAG_SYSTEM, "DNDState",
+							"Channel: Zap/%d\r\n"
+							"Status: disabled\r\n", p->channel);
 				res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
 				p->dnd = 0;
 				getforward = 0;
@@ -6194,7 +6192,7 @@
 								}
 							}
 						}
-						if(option_verbose > 2)
+						if (option_verbose > 2)
 							/* this only shows up if you have n of the dring patterns filled in */
 							ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
 	
@@ -6212,7 +6210,7 @@
 								/* The ring matches, set the context to whatever is for distinctive ring.. */
 								ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
 								ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
-								if(option_verbose > 2)
+								if (option_verbose > 2)
 									ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
 								break;
 							}
@@ -6308,7 +6306,7 @@
 					}
 				}
 				if (p->usedistinctiveringdetection == 1) {
-					if(option_verbose > 2)
+					if (option_verbose > 2)
 						/* this only shows up if you have n of the dring patterns filled in */
 						ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
 
@@ -6326,7 +6324,7 @@
 							/* The ring matches, set the context to whatever is for distinctive ring.. */
 							ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
 							ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
-							if(option_verbose > 2)
+							if (option_verbose > 2)
 								ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
 							break;
 						}
@@ -6618,9 +6616,10 @@
 		case SIG_FXSGS:
 			if (i->cid_start == CID_START_POLARITY) {
 				i->polarity = POLARITY_REV;
-				ast_verbose(VERBOSE_PREFIX_2 "Starting post polarity "
-					    "CID detection on channel %d\n",
-					    i->channel);
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_2 "Starting post polarity "
+						"CID detection on channel %d\n",
+						i->channel);
 				chan = zt_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0);
 				if (chan && ast_pthread_create(&threadid, &attr, ss_thread, chan)) {
 					ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
@@ -7791,7 +7790,8 @@
 		if (roundrobin)
 			round_robin[x] = p;
 #if 0
-		ast_verbose("name = %s, %d, %d, %d\n",p->owner ? p->owner->name : "<none>", p->channel, channelmatch, groupmatch);
+		if (option_verbose > 3)
+			ast_verbose("name = %s, %d, %d, %d\n",p->owner ? p->owner->name : "<none>", p->channel, channelmatch, groupmatch);
 #endif
 
 		if (p && available(p, channelmatch, groupmatch, &busy, &channelmatched, &groupmatched)) {
@@ -10348,9 +10348,10 @@
 			p = p->next;
 			x++;
 			/* Free associated memory */
-			if(pl)
+			if (pl)
 				destroy_zt_pvt(&pl);
-			ast_verbose(VERBOSE_PREFIX_3 "Unregistered channel %d\n", x);
+			if (option_verbose > 2)
+				ast_verbose(VERBOSE_PREFIX_3 "Unregistered channel %d\n", x);
 		}
 		iflist = NULL;
 		ifcount = 0;
Index: channels/chan_sip.c
===================================================================
--- channels/chan_sip.c	(revision 16722)
+++ channels/chan_sip.c	(working copy)
@@ -6099,7 +6099,7 @@
 
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Unregistered SIP '%s'\n", p->name);
-			manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Unregistered\r\n", p->name);
+		manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Unregistered\r\n", p->name);
 		return PARSE_REGISTER_UPDATE;
 	}
 	ast_copy_string(p->fullcontact, c, sizeof(p->fullcontact));
@@ -6182,9 +6182,8 @@
 	useragent = get_header(req, "User-Agent");
 	if (useragent && strcasecmp(useragent, p->useragent)) {
 		ast_copy_string(p->useragent, useragent, sizeof(p->useragent));
-		if (option_verbose > 3) {
+		if (option_verbose > 3)
 			ast_verbose(VERBOSE_PREFIX_3 "Saved useragent \"%s\" for peer %s\n",p->useragent,p->name);  
-		}
 	}
 	return PARSE_REGISTER_UPDATE;
 }
@@ -6540,7 +6539,8 @@
 		if (p->autokillid > -1)
 			sip_cancel_destroy(p);	/* Remove subscription expiry for renewals */
 		sip_scheddestroy(p, 15000);	/* Delete subscription in 15 secs */
-		ast_verbose(VERBOSE_PREFIX_2 "Extension state: Watcher for hint %s %s. Notify User %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", p->username);
+		if (option_debug > 1)
+			ast_verbose(VERBOSE_PREFIX_2 "Extension state: Watcher for hint %s %s. Notify User %s\n", exten, state == AST_EXTENSION_DEACTIVATED ? "deactivated" : "removed", p->username);
 		p->stateid = -1;
 		p->subscribed = NONE;
 		append_history(p, "Subscribestatus", "%s", state == AST_EXTENSION_REMOVED ? "HintRemoved" : "Deactivated");
@@ -9632,7 +9632,6 @@
 		return -1;
 	}
 
-/* 	ast_verbose("function_sipchaninfo_read: %s\n", data); */
 	p = chan->tech_pvt;
 
 	/* If there is no private structure, this channel is no longer alive */
@@ -13038,7 +13037,7 @@
 			} else {
 				if (option_verbose > 1) { 
 					ast_verbose(VERBOSE_PREFIX_2 "SIP Listening on %s:%d\n", 
-					ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr), ntohs(bindaddr.sin_port));
+						ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr), ntohs(bindaddr.sin_port));
 					ast_verbose(VERBOSE_PREFIX_2 "Using SIP TOS: %s\n", ast_tos2str(global_tos_sip));
 				}
 				if (setsockopt(sipsock, IPPROTO_IP, IP_TOS, &global_tos_sip, sizeof(global_tos_sip))) 
Index: channels/chan_agent.c
===================================================================
--- channels/chan_agent.c	(revision 16722)
+++ channels/chan_agent.c	(working copy)
@@ -652,7 +652,8 @@
 		ast_mutex_unlock(&p->lock);
 		return res;
 	}
-	ast_verbose( VERBOSE_PREFIX_3 "agent_call, call to agent '%s' call on '%s'\n", p->agent, p->chan->name);
+	if (option_verbose > 2)
+		ast_verbose( VERBOSE_PREFIX_3 "agent_call, call to agent '%s' call on '%s'\n", p->agent, p->chan->name);
 	ast_log( LOG_DEBUG, "Playing beep, lang '%s'\n", p->chan->language);
 	res = ast_streamfile(p->chan, beep, p->chan->language);
 	ast_log( LOG_DEBUG, "Played beep, result '%d'\n", res);
Index: channels/chan_iax2.c
===================================================================
--- channels/chan_iax2.c	(revision 16722)
+++ channels/chan_iax2.c	(working copy)
@@ -5722,17 +5722,19 @@
 	if (reg->expire > -1)
 		ast_sched_del(sched, reg->expire);
 	reg->expire = ast_sched_add(sched, (5 * reg->refresh / 6) * 1000, iax2_do_register_s, reg);
-	if ((inaddrcmp(&oldus, &reg->us) || (reg->messages != oldmsgs)) && (option_verbose > 2)) {
-		if (reg->messages > 65534)
-			snprintf(msgstatus, sizeof(msgstatus), " with message(s) waiting\n");
-		else if (reg->messages > 1)
-			snprintf(msgstatus, sizeof(msgstatus), " with %d messages waiting\n", reg->messages);
-		else if (reg->messages > 0)
-			snprintf(msgstatus, sizeof(msgstatus), " with 1 message waiting\n");
-		else
-			snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n");
-		snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), reg->us.sin_addr), ntohs(reg->us.sin_port));
-		ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), ourip, msgstatus);
+	if (inaddrcmp(&oldus, &reg->us) || (reg->messages != oldmsgs)) {
+		if (option_verbose > 2) {
+			if (reg->messages > 65534)
+				snprintf(msgstatus, sizeof(msgstatus), " with message(s) waiting\n");
+			else if (reg->messages > 1)
+				snprintf(msgstatus, sizeof(msgstatus), " with %d messages waiting\n", reg->messages);
+			else if (reg->messages > 0)
+				snprintf(msgstatus, sizeof(msgstatus), " with 1 message waiting\n");
+			else
+				snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n");
+			snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), reg->us.sin_addr), ntohs(reg->us.sin_port));
+			ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), ourip, msgstatus);
+		}
 		manager_event(EVENT_FLAG_SYSTEM, "Registry", "Channel: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr));
 	}
 	reg->regstate = REG_STATE_REGISTERED;
@@ -8120,8 +8122,7 @@
 	res = iax2_provision(&iaxs[callno]->addr, iaxs[callno]->sockfd, NULL, sdata, force);
 	if (option_verbose > 2)
 		ast_verbose(VERBOSE_PREFIX_3 "Provisioned IAXY at '%s' with '%s'= %d\n", 
-		ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[callno]->addr.sin_addr),
-		sdata, res);
+			ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[callno]->addr.sin_addr), sdata, res);
 	return res;
 }
 
Index: apps/app_chanspy.c
===================================================================
--- apps/app_chanspy.c	(revision 16722)
+++ apps/app_chanspy.c	(working copy)
@@ -264,7 +264,7 @@
 	if (running) {
 		memset(inp, 0, sizeof(inp));
 		name = ast_strdupa(spyee->name);
-		if (option_verbose >= 2)
+		if (option_verbose > 1)
 			ast_verbose(VERBOSE_PREFIX_2 "Spying on channel %s\n", name);
 
 		memset(&csth, 0, sizeof(csth));
@@ -327,9 +327,8 @@
 					if (*volfactor > 4) {
 						*volfactor = -4;
 					}
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
-					}
 					csth.volfactor = *volfactor;
 					set_volume(chan, &csth);
 					csth.spy.read_vol_adjustment = csth.volfactor;
@@ -342,9 +341,8 @@
 		ast_deactivate_generator(chan);
 		stop_spying(spyee, &csth.spy);
 
-		if (option_verbose >= 2) {
+		if (option_verbose > 1)
 			ast_verbose(VERBOSE_PREFIX_2 "Done Spying on channel %s\n", name);
-		}
 	} else {
 		running = 0;
 	}
Index: apps/app_alarmreceiver.c
===================================================================
--- apps/app_alarmreceiver.c	(revision 16722)
+++ apps/app_alarmreceiver.c	(working copy)
@@ -122,7 +122,7 @@
 	res = ast_db_get(db_family, key, value, sizeof(value) - 1);
 	
 	if(res){
-		if(option_verbose >= 4)
+		if (option_verbose > 3)
 			ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Creating database entry %s and setting to 1\n", key);
 		/* Guess we have to create it */
 		res = ast_db_put(db_family, key, "1");
@@ -132,14 +132,14 @@
 	sscanf(value, "%u", &v);
 	v++;
 	
-	if(option_verbose >= 4)
+	if (option_verbose > 3)
 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: New value for %s: %u\n", key, v);
 		
 	snprintf(value, sizeof(value), "%u", v);
 	
 	res = ast_db_put(db_family, key, value);
 	
-	if((res)&&(option_verbose >= 4))
+	if ((res) && (option_verbose > 3))
 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: database_increment write error");
 	
 	return;	
@@ -213,7 +213,7 @@
 				break;
 			}
 			if (ast_write(chan, &wf)){
-				if(option_verbose >= 4)
+				if (option_verbose > 3)
 					ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Failed to write frame on %s\n", chan->name);
 				ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
 				res = -1;
@@ -250,7 +250,7 @@
 		  /* if outa time, leave */
 		if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) >
 		    ((i > 0) ? sdto : fdto)){
-			if(option_verbose >= 4)
+			if (option_verbose > 3)
 				ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);
 				
 			ast_log(LOG_DEBUG,"AlarmReceiver: DTMF timeout on chan %s\n",chan->name);
@@ -352,8 +352,8 @@
 		res = fprintf(logfile, "[events]\n\n");
 	
 	if(res < 0){
-		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: can't write metadata\n");	
-		
+		if (option_verbose > 3)
+			ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: can't write metadata\n");	
 		ast_log(LOG_DEBUG,"AlarmReceiver: can't write metadata\n");
 	}
 	else
@@ -403,7 +403,8 @@
 		fd = mkstemp(workstring);
 		
 		if(fd == -1){
-			ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: can't make temporary file\n");	
+			if (option_verbose > 3)
+				ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: can't make temporary file\n");	
 			ast_log(LOG_DEBUG,"AlarmReceiver: can't make temporary file\n");
 			res = -1;
 		}
@@ -459,7 +460,7 @@
 
 	/* Wait for first event */
 
-	if(option_verbose >= 4)
+	if (option_verbose > 3)
 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Waiting for first event from panel\n");
 
 	while(res >= 0){
@@ -469,7 +470,7 @@
 	        	/* Send ACK tone sequence */
                         
 		                                                                                                                    
-        		if(option_verbose >= 4)
+        		if (option_verbose > 3)
                 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Sending 1400Hz 100ms burst (ACK)\n");
                                                                                                                                             
                                                                                                                                             
@@ -479,7 +480,7 @@
                 		res = ast_safe_sleep(chan, 100);
                                                                                                                                             
         		if(!res){
-                		if(option_verbose >= 4)
+                		if (option_verbose > 3)
                         		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Sending 2300Hz 100ms burst (ACK)\n");
                                                                                                                                             
                 		res = send_tone_burst(chan, 2300.0, 100, tldn);
@@ -497,13 +498,13 @@
 				database_increment("no-events-received");
 			else{
 				if(ack_retries){
-					if(option_verbose >= 4)
+					if (option_verbose > 3)
 						ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: ACK retries during this call: %d\n", ack_retries);
 					
 					database_increment("ack-retries");
 				}
 			}
-			if(option_verbose >= 4)
+			if (option_verbose > 3)
 				ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: App exiting...\n");
 			res = -1;
 			break;
@@ -511,7 +512,7 @@
 		
 		if(res != 0){
 			 /* Didn't get all of the digits */
-			if(option_verbose >= 2)
+			if (option_verbose > 1)
 				ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Incomplete string: %s, trying again...\n", event);
 
 			if(!got_some_digits){
@@ -523,7 +524,7 @@
 		
 		got_some_digits = 1;
 
-		if(option_verbose >= 2)
+		if (option_verbose > 1)
 			ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Received Event %s\n", event);
 		ast_log(LOG_DEBUG, "AlarmReceiver: Received event: %s\n", event);
 		
@@ -542,7 +543,7 @@
 		}
 		
 		if(i == 16){
-			if(option_verbose >= 2)
+			if (option_verbose > 1)
 				ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Bad DTMF character %c, trying again\n", event[j]);
 			continue; /* Bad character */
 		}
@@ -553,11 +554,10 @@
 
 		if(checksum){
 			database_increment("checksum-errors");
-			if(option_verbose >= 2){
+			if (option_verbose > 1)
 				ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Nonzero checksum\n");
 			ast_log(LOG_DEBUG, "AlarmReceiver: Nonzero checksum\n");
 			continue;
-			}
 		}
 
 		/* Check the message type for correctness */
@@ -565,7 +565,7 @@
 		if(strncmp(event + 4, "18", 2)){
 			if(strncmp(event + 4, "98", 2)){
 				database_increment("format-errors");
-				if(option_verbose >= 2)
+				if (option_verbose > 1)
 					ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Wrong message type\n");
 				ast_log(LOG_DEBUG, "AlarmReceiver: Wrong message type\n");
 			continue;
@@ -639,7 +639,7 @@
 
 	/* Set write and read formats to ULAW */
 
-	if(option_verbose >= 4)
+	if (option_verbose > 3)
 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Setting read and write formats to ULAW\n");
 
 	if (ast_set_write_format(chan,AST_FORMAT_ULAW)){
@@ -661,7 +661,7 @@
 
 	/* Answer the channel if it is not already */
 
-	if(option_verbose >= 4)
+	if (option_verbose > 3)
 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Answering channel\n");
 
 	if (chan->_state != AST_STATE_UP) {
@@ -676,7 +676,7 @@
 
 	/* Wait for the connection to settle post-answer */
 
-	if(option_verbose >= 4)
+	if (option_verbose > 3)
 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Waiting for connection to stabilize\n");
 
 	res = ast_safe_sleep(chan, 1250);
@@ -744,7 +744,7 @@
                                                                                                                                   
 	if(!cfg){
 	
-		if(option_verbose >= 4)
+		if (option_verbose > 3)
 			ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: No config file\n");
 	}
 	else{
Index: apps/app_rpt.c
===================================================================
--- apps/app_rpt.c	(revision 16722)
+++ apps/app_rpt.c	(working copy)
@@ -6501,7 +6501,8 @@
 
 		ast_masq_park_call(chan, NULL, timeout, &lot);
 
-		if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, return_context);
+		if (option_verbose > 2)
+			ast_verbose( VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, return_context);
 
 		snprintf(tmp,sizeof(tmp) - 1,"%d,%s",lot,template + 1);
 
Index: apps/app_parkandannounce.c
===================================================================
--- apps/app_parkandannounce.c	(revision 16722)
+++ apps/app_parkandannounce.c	(working copy)
@@ -131,7 +131,8 @@
 	} else {
 		dialtech=strsep(&dial, "/");
 		dialstr=dial;
-		ast_verbose( VERBOSE_PREFIX_3 "Dial Tech,String: (%s,%s)\n", dialtech,dialstr);
+		if (option_verbose > 2)
+			ast_verbose( VERBOSE_PREFIX_3 "Dial Tech,String: (%s,%s)\n", dialtech,dialstr);
 	}
 
 	return_context = s;
@@ -172,9 +173,9 @@
 		chan->priority++;
 	}
 
-	if(option_verbose > 2) {
-		ast_verbose( VERBOSE_PREFIX_3 "Return Context: (%s,%s,%d) ID: %s\n", chan->context,chan->exten, chan->priority, chan->cid.cid_num);
-		if(!ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
+	if (option_verbose > 2) {
+		ast_verbose( VERBOSE_PREFIX_3 "Return Context: (%s,%s,%d) ID: %s\n", chan->context, chan->exten, chan->priority, chan->cid.cid_num);
+		if (!ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
 			ast_verbose( VERBOSE_PREFIX_3 "Warning: Return Context Invalid, call will return to default|s\n");
 		}
 	}
@@ -186,7 +187,8 @@
 
 	res=-1; 
 
-	ast_verbose( VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, return_context);
+	if (option_verbose > 2)
+		ast_verbose( VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, return_context);
 
 	/* Now place the call to the extention */
 
@@ -203,7 +205,7 @@
 		} else {
 			if(option_verbose > 3)
 				ast_verbose(VERBOSE_PREFIX_4 "Channel %s was never answered.\n", dchan->name);
-        			ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
+        		ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
 			ast_hangup(dchan);
 			free(orig_s);
 			LOCAL_USER_REMOVE(u);
@@ -220,7 +222,8 @@
 
 	/* now we have the call placed and are ready to play stuff to it */
 
-	ast_verbose(VERBOSE_PREFIX_4 "Announce Template:%s\n", template);
+	if (option_verbose > 2)
+		ast_verbose(VERBOSE_PREFIX_4 "Announce Template:%s\n", template);
 
 	tpl_working = template;
 	tpl_current=strsep(&tpl_working, ":");
@@ -232,7 +235,8 @@
 	}
 
 	for(i=0; i<looptemp; i++) {
-		ast_verbose(VERBOSE_PREFIX_4 "Announce:%s\n", tmp[i]);
+		if (option_verbose > 2)
+			ast_verbose(VERBOSE_PREFIX_4 "Announce:%s\n", tmp[i]);
 		if(!strcmp(tmp[i], "PARKED")) {
 			ast_say_digits(dchan, lot, "", dchan->language);
 		} else {
Index: apps/app_meetme.c
===================================================================
--- apps/app_meetme.c	(revision 16722)
+++ apps/app_meetme.c	(working copy)
@@ -884,8 +884,9 @@
 				snprintf(recordingtmp, sizeof(recordingtmp), "wav");
 				conf->recordingformat = ast_strdupa(recordingtmp);
 			}
-			ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
-				    conf->confno, conf->recordingfilename, conf->recordingformat);
+			if (option_verbose > 2)
+				ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
+					conf->confno, conf->recordingfilename, conf->recordingformat);
 		}
 	}
 
Index: apps/app_zapscan.c
===================================================================
--- apps/app_zapscan.c	(revision 16722)
+++ apps/app_zapscan.c	(working copy)
@@ -235,7 +235,8 @@
 						input[ic++] = '\0';
 						ic=0;
 						ret = atoi(input);
-						ast_verbose(VERBOSE_PREFIX_3 "Zapscan: change channel to %d\n",ret);
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "Zapscan: change channel to %d\n",ret);
 						break;
 					}
 				}
@@ -305,7 +306,8 @@
 	
 	desired_group = ast_strdupa((char *) data);
 	if(!ast_strlen_zero(desired_group)) {
-		ast_verbose(VERBOSE_PREFIX_3 "Scanning for group %s\n", desired_group);
+		if (option_verbose > 2)
+			ast_verbose(VERBOSE_PREFIX_3 "Scanning for group %s\n", desired_group);
 		search_group = 1;
 	}
 
@@ -335,7 +337,8 @@
 		if (tempchan && search_group) {
 			const char *mygroup;
 			if((mygroup = pbx_builtin_getvar_helper(tempchan, "GROUP")) && (!strcmp(mygroup, desired_group))) {
-				ast_verbose(VERBOSE_PREFIX_3 "Found Matching Channel %s in group %s\n", tempchan->name, desired_group);
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Found Matching Channel %s in group %s\n", tempchan->name, desired_group);
 			} else {
 				ast_mutex_unlock(&tempchan->lock);
 				lastchan = tempchan;
@@ -343,7 +346,8 @@
 			}
 		}
 		if (tempchan && (!strcmp(tempchan->tech->type, "Zap")) && (tempchan != chan) ) {
-			ast_verbose(VERBOSE_PREFIX_3 "Zap channel %s is in-use, monitoring...\n", tempchan->name);
+			if (option_verbose > 2)
+				ast_verbose(VERBOSE_PREFIX_3 "Zap channel %s is in-use, monitoring...\n", tempchan->name);
 			ast_copy_string(confstr, tempchan->name, sizeof(confstr));
 			ast_mutex_unlock(&tempchan->lock);
 			if ((tmp = strchr(confstr,'-'))) {
Index: apps/app_amd.c
===================================================================
--- apps/app_amd.c	(revision 16722)
+++ apps/app_amd.c	(working copy)
@@ -137,7 +137,8 @@
 			     AST_APP_ARG(argSilenceThreshold);
 	);
 
-	ast_verbose(VERBOSE_PREFIX_3 "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
+	if (option_verbose > 2)
+		ast_verbose(VERBOSE_PREFIX_3 "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
 
 	/* Lets parse the arguments. */
 	if (ast_strlen_zero(data)) {
@@ -181,10 +182,11 @@
 
 	/* Now we're ready to roll! */
 
-	ast_verbose(VERBOSE_PREFIX_3 "AMD: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
-		"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
-				initialSilence, greeting, afterGreetingSilence, totalAnalysisTime,
-				minimumWordLength, betweenWordsSilence, maximumNumberOfWords, silenceThreshold );
+	if (option_verbose > 2)
+		ast_verbose(VERBOSE_PREFIX_3 "AMD: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
+			"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
+			initialSilence, greeting, afterGreetingSilence, totalAnalysisTime,
+			minimumWordLength, betweenWordsSilence, maximumNumberOfWords, silenceThreshold );
 
 	readFormat = chan->readformat;
 	res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
@@ -209,7 +211,8 @@
 		f = ast_read(chan);
 		if (!f ) {
 			/* No Frame: Called Party Must Have Dropped */
-			ast_verbose(VERBOSE_PREFIX_3 "AMD: HANGUP\n");
+			if (option_verbose > 2)
+				ast_verbose(VERBOSE_PREFIX_3 "AMD: HANGUP\n");
 			ast_log(LOG_DEBUG, "Got hangup\n");
 			strcpy(amdStatus , "HANGUP" );
 			strcpy(amdCause , "" );
@@ -218,7 +221,8 @@
 		framelength = (ast_codec_get_samples(f) / 8);
 		iTotalTime += framelength;
 		if (iTotalTime >= totalAnalysisTime ) {
-			ast_verbose(VERBOSE_PREFIX_3 "AMD: Channel [%s]. Too long...\n", chan->name );
+			if (option_verbose > 2)
+				ast_verbose(VERBOSE_PREFIX_3 "AMD: Channel [%s]. Too long...\n", chan->name );
 			ast_frfree(f);
 			strcpy(amdStatus , "NOTSURE" );
 			sprintf(amdCause , "TOOLONG-%d", iTotalTime );
@@ -229,17 +233,21 @@
 			ast_dsp_silence(silenceDetector, f, &dspsilence);
 			if (dspsilence ) {
 				silenceDuration = dspsilence;
-				/* ast_verbose(VERBOSE_PREFIX_3 "AMD: %d SILENCE: silenceDuration:%d afterGreetingSilence:%d inGreeting:%d\n", currentState, silenceDuration, afterGreetingSilence, inGreeting ); */
+				/* if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "AMD: %d SILENCE: silenceDuration:%d afterGreetingSilence:%d inGreeting:%d\n",
+						currentState, silenceDuration, afterGreetingSilence, inGreeting ); */
 				if (silenceDuration >= betweenWordsSilence ) {
 					if (currentState != STATE_IN_SILENCE ) {
 						previousState = currentState;
-						ast_verbose(VERBOSE_PREFIX_3 "AMD: Changed state to STATE_IN_SILENCE\n");
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "AMD: Changed state to STATE_IN_SILENCE\n");
 					}
 					currentState  = STATE_IN_SILENCE;
 					consecutiveVoiceDuration = 0;
 				}
 				if (inInitialSilence == 1  && silenceDuration >= initialSilence ) {
-					ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: silenceDuration:%d initialSilence:%d\n",
+					if (option_verbose > 2)
+						ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: silenceDuration:%d initialSilence:%d\n",
 							silenceDuration, initialSilence );
 					ast_frfree(f);
 					strcpy(amdStatus , "MACHINE" );
@@ -248,7 +256,8 @@
 				}
 
 				if (silenceDuration >= afterGreetingSilence  &&  inGreeting == 1 ) {
-					ast_verbose(VERBOSE_PREFIX_3 "AMD: HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
+					if (option_verbose > 2)
+						ast_verbose(VERBOSE_PREFIX_3 "AMD: HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
 							silenceDuration, afterGreetingSilence );
 					ast_frfree(f);
 					strcpy(amdStatus , "HUMAN" );
@@ -258,21 +267,25 @@
 			} else {
 				consecutiveVoiceDuration += framelength;
 				voiceDuration += framelength;
-				/* ast_verbose(VERBOSE_PREFIX_3 "AMD: %d VOICE: ConsecutiveVoice:%d voiceDuration:%d inGreeting:%d\n", currentState, consecutiveVoiceDuration, voiceDuration, inGreeting ); */
+				/* if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "AMD: %d VOICE: ConsecutiveVoice:%d voiceDuration:%d inGreeting:%d\n",
+						currentState, consecutiveVoiceDuration, voiceDuration, inGreeting ); */
 
 				/* If I have enough consecutive voice to say that I am in a Word, I can only increment the
 					number of words if my previous state was Silence, which means that I moved into a word. */
 				if (consecutiveVoiceDuration >= minimumWordLength ) {
 					if (currentState == STATE_IN_SILENCE ) {
 						iWordsCount++;
-						ast_verbose(VERBOSE_PREFIX_3 "AMD: Word detected. iWordsCount:%d\n", iWordsCount );
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "AMD: Word detected. iWordsCount:%d\n", iWordsCount );
 						previousState = currentState;
 						currentState = STATE_IN_WORD;
 					}
 				}
 
 				if (iWordsCount >= maximumNumberOfWords ) {
-					ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: iWordsCount:%d\n", iWordsCount );
+					if (option_verbose > 2)
+						ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: iWordsCount:%d\n", iWordsCount );
 					ast_frfree(f);
 					strcpy(amdStatus , "MACHINE" );
 					sprintf(amdCause , "MAXWORDS-%d-%d", iWordsCount, maximumNumberOfWords );
@@ -280,7 +293,8 @@
 				}
 
 				if (inGreeting == 1  &&  voiceDuration >= greeting ) {
-					ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: voiceDuration:%d greeting:%d\n",
+					if (option_verbose > 2)
+						ast_verbose(VERBOSE_PREFIX_3 "AMD: ANSWERING MACHINE: voiceDuration:%d greeting:%d\n",
 							voiceDuration, greeting );
 					ast_frfree(f);
 					strcpy(amdStatus , "MACHINE" );
@@ -371,10 +385,11 @@
 	}
 	ast_config_destroy(cfg);
 
-	ast_verbose(VERBOSE_PREFIX_3 "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
-		"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
-				dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
-				dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold );
+	if (option_verbose > 2)
+		ast_verbose(VERBOSE_PREFIX_3 "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
+			"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] \n",
+			dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
+			dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold );
 
 	return;
 }
Index: apps/app_queue.c
===================================================================
--- apps/app_queue.c	(revision 16722)
+++ apps/app_queue.c	(working copy)
@@ -2955,11 +2955,10 @@
 			if (res < 0) {
 				/* Record this abandoned call */
 				record_abandoned(&qe);
-				 ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
-				if (option_verbose > 2) {
+				ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
+				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "User disconnected from queue %s while waiting their turn\n", args.queuename);
-					res = -1;
-				}
+				res = -1;
 				break;
 			}
 			if (!res) 
@@ -3055,10 +3054,9 @@
 				if (res < 0) {
 					record_abandoned(&qe);
 					ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "User disconnected from queue %s when they almost made it\n", args.queuename);
-						res = -1;
-					}
+					res = -1;
 					break;
 				}
 				if (res && valid_exit(&qe, res)) {
@@ -3067,10 +3065,9 @@
 				}
 				/* exit after 'timeout' cycle if 'n' option enabled */
 				if (go_on) {
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
-						res = -1;
-					}
+					res = -1;
 					ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
                                         record_abandoned(&qe);
 					reason = QUEUE_TIMEOUT;
Index: say.c
===================================================================
--- say.c	(revision 16722)
+++ say.c	(working copy)
@@ -1225,10 +1225,9 @@
 	int state = 0; /* no need to save anything */
 	int mf = 1;    /* +1 = Masculin; -1 = Feminin */
 	char fn[SAY_NUM_BUF_SIZE] = "";
-	ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: started. "
-		"num: %d, options=\"%s\"\n",
-		num, options
-	);
+	if (option_verbose > 2)
+		ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: started. "
+			"num: %d, options=\"%s\"\n", num, options);
 	if (!num) 
 		return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
 	
@@ -1244,10 +1243,9 @@
 		 * state==0 is the normal mode and it means that we continue
 		 * to check if the number num has yet anything left.
 		 */
-		ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: num: %d, "
-			"state=%d, options=\"%s\", mf=%d\n",
-			num, state, options, mf
-		);
+		if (option_verbose > 2)
+			ast_verbose(VERBOSE_PREFIX_3 "ast_say_digits_full: num: %d, "
+				"state=%d, options=\"%s\", mf=%d\n", num, state, options, mf);
 		if (state==1) {
 			snprintf(fn, sizeof(fn), "digits/hundred");
 			state = 0;
Index: res/res_snmp.c
===================================================================
--- res/res_snmp.c	(revision 16722)
+++ res/res_snmp.c	(working copy)
@@ -89,7 +89,8 @@
 {
     load_config();
 
-    ast_verbose(VERBOSE_PREFIX_1 "Loading [Sub]Agent Module\n");
+    if (option_verbose > 0)
+	    ast_verbose(VERBOSE_PREFIX_1 "Loading [Sub]Agent Module\n");
 
     res_snmp_dont_stop = 1;
 	if (res_snmp_enabled)
@@ -100,7 +101,8 @@
 
 int unload_module(void)
 {
-    ast_verbose(VERBOSE_PREFIX_1 "Unloading [Sub]Agent Module\n");
+    if (option_verbose > 0)
+	    ast_verbose(VERBOSE_PREFIX_1 "Unloading [Sub]Agent Module\n");
 
     res_snmp_dont_stop = 0;
     return pthread_join(thread, NULL);
@@ -108,7 +110,8 @@
 
 int reload(void)
 {
-    ast_verbose(VERBOSE_PREFIX_1 "Reloading [Sub]Agent Module\n");
+    if (option_verbose > 0)
+	    ast_verbose(VERBOSE_PREFIX_1 "Reloading [Sub]Agent Module\n");
 
     res_snmp_dont_stop = 0;
 	if (thread != AST_PTHREADT_NULL)
Index: res/res_features.c
===================================================================
--- res/res_features.c	(revision 16722)
+++ res/res_features.c	(working copy)
@@ -2179,7 +2179,8 @@
 
 				ast_register_feature(feature);
 				
-				if (option_verbose >=1) ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s' with code '%s'\n", var->name, app, exten);  
+				if (option_verbose > 0)
+					ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s' with code '%s'\n", var->name, app, exten);  
 			}
 			var = var->next;
 		}	 
Index: res/snmp/agent.c
===================================================================
--- res/snmp/agent.c	(revision 16722)
+++ res/snmp/agent.c	(working copy)
@@ -150,7 +150,8 @@
 
 void *agent_thread(void *arg)
 {
-    ast_verbose(VERBOSE_PREFIX_2 "Starting %sAgent\n", res_snmp_agentx_subagent ? "Sub" : "");
+    if (option_verbose > 1)
+	    ast_verbose(VERBOSE_PREFIX_2 "Starting %sAgent\n", res_snmp_agentx_subagent ? "Sub" : "");
 
     snmp_enable_stderrlog();
 
@@ -173,7 +174,8 @@
 
     snmp_shutdown("asterisk");
 
-    ast_verbose(VERBOSE_PREFIX_2 "Terminating %sAgent\n",
+    if (option_verbose > 1)
+	    ast_verbose(VERBOSE_PREFIX_2 "Terminating %sAgent\n",
 				res_snmp_agentx_subagent ? "Sub" : "");
 
     return NULL;
Index: README
===================================================================
--- README	(revision 16722)
+++ README	(working copy)
@@ -2,14 +2,14 @@
 by Mark Spencer <markster@digium.com>
 and the Asterisk.org developer community
 
-Copyright (C) 2001-2005 Digium, Inc.
+Copyright (C) 2001-2006 Digium, Inc.
 and other copyright holders.
 ================================================================
 
 * SECURITY
   It is imperative that you read and fully understand the contents of
-the SECURITY file before you attempt to configure and run an Asterisk
-server.
+the doc/security.txt file before you attempt to configure and run an
+Asterisk server.
 
 * WHAT IS ASTERISK ?
   Asterisk is an Open Source PBX and telephony toolkit.  It is, in a
