[asterisk-commits] mmichelson: trunk r102525 - in /trunk: apps/ channels/ main/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 5 17:00:16 CST 2008


Author: mmichelson
Date: Tue Feb  5 17:00:15 2008
New Revision: 102525

URL: http://svn.digium.com/view/asterisk?view=rev&rev=102525
Log:
Get rid of any remaining ast_verbose calls in the code in favor of 
ast_verb

(closes issue #11934)
Reported by: mvanbaak
Patches:
      20080205_astverb-2.diff.txt uploaded by mvanbaak (license 7)


Modified:
    trunk/apps/app_alarmreceiver.c
    trunk/apps/app_dial.c
    trunk/apps/app_dumpchan.c
    trunk/apps/app_followme.c
    trunk/apps/app_minivm.c
    trunk/apps/app_privacy.c
    trunk/apps/app_zapras.c
    trunk/channels/chan_unistim.c
    trunk/channels/chan_usbradio.c
    trunk/main/astmm.c
    trunk/main/loader.c
    trunk/main/logger.c
    trunk/main/pbx.c
    trunk/main/tcptls.c
    trunk/res/res_agi.c
    trunk/res/res_jabber.c

Modified: trunk/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_alarmreceiver.c?view=diff&rev=102525&r1=102524&r2=102525
==============================================================================
--- trunk/apps/app_alarmreceiver.c (original)
+++ trunk/apps/app_alarmreceiver.c Tue Feb  5 17:00:15 2008
@@ -121,15 +121,14 @@
 	sscanf(value, "%u", &v);
 	v++;
 	
-	if(option_verbose >= 4)
-		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: New value for %s: %u\n", key, v);
+	ast_verb(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))
-		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: database_increment write error\n");
+	if (res)
+		ast_verb(4, "AlarmReceiver: database_increment write error\n");
 	
 	return;	
 }
@@ -240,8 +239,7 @@
 		  /* if outa time, leave */
 		if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) >
 		    ((i > 0) ? sdto : fdto)){
-			if(option_verbose >= 4)
-				ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);
+			ast_verb(4, "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);
 				
 			ast_debug(1,"AlarmReceiver: DTMF timeout on chan %s\n",chan->name);
 				
@@ -342,8 +340,7 @@
 		res = fprintf(logfile, "[events]\n\n");
 	
 	if(res < 0){
-		if (option_verbose >= 3 )
-		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: can't write metadata\n");	
+		ast_verb(3, "AlarmReceiver: can't write metadata\n");	
 		
 		ast_debug(1,"AlarmReceiver: can't write metadata\n");
 	}
@@ -394,8 +391,7 @@
 		fd = mkstemp(workstring);
 		
 		if(fd == -1) {
-			if (option_verbose >= 3)
-				ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: can't make temporary file\n");	
+			ast_verb(3, "AlarmReceiver: can't make temporary file\n");	
 			ast_debug(1,"AlarmReceiver: can't make temporary file\n");
 			res = -1;
 		}
@@ -451,8 +447,7 @@
 
 	/* Wait for first event */
 
-	if(option_verbose >= 4)
-		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Waiting for first event from panel\n");
+	ast_verb(4, "AlarmReceiver: Waiting for first event from panel\n");
 
 	while(res >= 0){
 
@@ -461,8 +456,7 @@
 	        	/* Send ACK tone sequence */
                         
 		                                                                                                                    
-        		if(option_verbose >= 4)
-                		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Sending 1400Hz 100ms burst (ACK)\n");
+                ast_verb(4, "AlarmReceiver: Sending 1400Hz 100ms burst (ACK)\n");
                                                                                                                                             
                                                                                                                                             
         		res = send_tone_burst(chan, 1400.0, 100, tldn);
@@ -471,8 +465,7 @@
                 		res = ast_safe_sleep(chan, 100);
                                                                                                                                             
         		if(!res){
-                		if(option_verbose >= 4)
-                        		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Sending 2300Hz 100ms burst (ACK)\n");
+                       	ast_verb(4, "AlarmReceiver: Sending 2300Hz 100ms burst (ACK)\n");
                                                                                                                                             
                 		res = send_tone_burst(chan, 2300.0, 100, tldn);
         		}
@@ -489,22 +482,19 @@
 				database_increment("no-events-received");
 			else{
 				if(ack_retries){
-					if(option_verbose >= 4)
-						ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: ACK retries during this call: %d\n", ack_retries);
+					ast_verb(4, "AlarmReceiver: ACK retries during this call: %d\n", ack_retries);
 					
 					database_increment("ack-retries");
 				}
 			}
-			if(option_verbose >= 4)
-				ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: App exiting...\n");
+			ast_verb(4, "AlarmReceiver: App exiting...\n");
 			res = -1;
 			break;
 		}
 		
 		if(res != 0){
 			 /* Didn't get all of the digits */
-			if(option_verbose >= 2)
-				ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Incomplete string: %s, trying again...\n", event);
+			ast_verb(2, "AlarmReceiver: Incomplete string: %s, trying again...\n", event);
 
 			if(!got_some_digits){
 				got_some_digits = (!ast_strlen_zero(event)) ? 1 : 0;
@@ -716,8 +706,7 @@
                                                                                                                                   
 	if(!cfg){
 	
-		if(option_verbose >= 4)
-			ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: No config file\n");
+		ast_verb(4, "AlarmReceiver: No config file\n");
 		return 0;
 	}
 	else{

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=102525&r1=102524&r2=102525
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Tue Feb  5 17:00:15 2008
@@ -1770,13 +1770,11 @@
 				peer->whentohangup = time(NULL) + calldurationlimit;
 			}
 			if (!ast_strlen_zero(dtmfcalled)) { 
-				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the called party.\n", dtmfcalled);
+				ast_verb(3, "Sending DTMF '%s' to the called party.\n", dtmfcalled);
 				res = ast_dtmf_stream(peer, chan, dtmfcalled, 250, 0);
 			}
 			if (!ast_strlen_zero(dtmfcalling)) {
-				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the calling party.\n", dtmfcalling);
+				ast_verb(3, "Sending DTMF '%s' to the calling party.\n", dtmfcalling);
 				res = ast_dtmf_stream(chan, peer, dtmfcalling, 250, 0);
 			}
 		}

Modified: trunk/apps/app_dumpchan.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dumpchan.c?view=diff&rev=102525&r1=102524&r2=102525
==============================================================================
--- trunk/apps/app_dumpchan.c (original)
+++ trunk/apps/app_dumpchan.c Tue Feb  5 17:00:15 2008
@@ -141,8 +141,8 @@
 
 	pbx_builtin_serialize_variables(chan, &vars);
 	serialize_showchan(chan, info, sizeof(info));
-	if (option_verbose >= level)
-		ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars->str, line);
+	if (level > 0)
+		ast_verb(level, "\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars->str, line);
 	
 	return 0;
 }

Modified: trunk/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_followme.c?view=diff&rev=102525&r1=102524&r2=102525
==============================================================================
--- trunk/apps/app_followme.c (original)
+++ trunk/apps/app_followme.c Tue Feb  5 17:00:15 2008
@@ -609,8 +609,7 @@
 				if (f->frametype == AST_FRAME_CONTROL) {
 					switch(f->subclass) {
 					case AST_CONTROL_HANGUP:
-						if (option_verbose > 2)
-							ast_verb(3, "%s received a hangup frame.\n", winner->name);
+						ast_verb(3, "%s received a hangup frame.\n", winner->name);
 						if (dg == 0) {
 							ast_verb(3, "The calling channel hungup. Need to drop everyone else.\n");
 							clear_calling_tree(findme_user_list);
@@ -618,8 +617,7 @@
 						}
 						break;
 					case AST_CONTROL_ANSWER:
-						if (option_verbose > 2)
-							ast_verb(3, "%s answered %s\n", winner->name, caller->name);
+						ast_verb(3, "%s answered %s\n", winner->name, caller->name);
 						/* If call has been answered, then the eventual hangup is likely to be normal hangup */ 
 						winner->hangupcause = AST_CAUSE_NORMAL_CLEARING;
 						caller->hangupcause = AST_CAUSE_NORMAL_CLEARING;

Modified: trunk/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_minivm.c?view=diff&rev=102525&r1=102524&r2=102525
==============================================================================
--- trunk/apps/app_minivm.c (original)
+++ trunk/apps/app_minivm.c Tue Feb  5 17:00:15 2008
@@ -1263,12 +1263,10 @@
  		case '3':
  			message_exists = 0;
  			/* Record */
-			if (option_verbose > 2) {
- 				if (recorded == 1) 
-					ast_verb(3, "Re-recording the message\n");
- 				else
-					ast_verb(3, "Recording the message\n");
-			}
+ 			if (recorded == 1) 
+				ast_verb(3, "Re-recording the message\n");
+ 			else
+				ast_verb(3, "Recording the message\n");
 			if (recorded && outsidecaller) 
  				cmd = ast_play_and_wait(chan, "beep");
  			recorded = 1;

Modified: trunk/apps/app_privacy.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_privacy.c?view=diff&rev=102525&r1=102524&r2=102525
==============================================================================
--- trunk/apps/app_privacy.c (original)
+++ trunk/apps/app_privacy.c Tue Feb  5 17:00:15 2008
@@ -76,8 +76,7 @@
 	);
 
 	if (!ast_strlen_zero(chan->cid.cid_num)) {
-		if (option_verbose > 2)
-			ast_verbose (VERBOSE_PREFIX_3 "CallerID Present: Skipping\n");
+		ast_verb(3, "CallerID Present: Skipping\n");
 	} else {
 		/*Answer the channel if it is not already*/
 		if (chan->_state != AST_STATE_UP) {
@@ -148,9 +147,8 @@
 			 */
 			chan->cid.cid_pres &= (AST_PRES_UNAVAILABLE ^ 0xFF);
 
-			if (option_verbose > 2) {
-				ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID to %s, callerpres to %d\n",phone,chan->cid.cid_pres);
-			}
+			ast_verb(3, "Changed Caller*ID to %s, callerpres to %d\n",phone,chan->cid.cid_pres);
+
 			pbx_builtin_setvar_helper(chan, "PRIVACYMGRSTATUS", "SUCCESS");
 		} else {
 			pbx_builtin_setvar_helper(chan, "PRIVACYMGRSTATUS", "FAILED");

Modified: trunk/apps/app_zapras.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_zapras.c?view=diff&rev=102525&r1=102524&r2=102525
==============================================================================
--- trunk/apps/app_zapras.c (original)
+++ trunk/apps/app_zapras.c Tue Feb  5 17:00:15 2008
@@ -165,16 +165,13 @@
 			if (res < 0) {
 				ast_log(LOG_WARNING, "wait4 returned %d: %s\n", res, strerror(errno));
 			}
-			if (option_verbose > 2) {
-				if (WIFEXITED(status)) {
-					ast_verbose(VERBOSE_PREFIX_3 "RAS on %s terminated with status %d\n", chan->name, WEXITSTATUS(status));
-				} else if (WIFSIGNALED(status)) {
-					ast_verbose(VERBOSE_PREFIX_3 "RAS on %s terminated with signal %d\n", 
-						 chan->name, WTERMSIG(status));
-				} else {
-					ast_verbose(VERBOSE_PREFIX_3 "RAS on %s terminated weirdly.\n", chan->name);
-				}
-			}
+			if (WIFEXITED(status))
+				ast_verb(3, "RAS on %s terminated with status %d\n", chan->name, WEXITSTATUS(status));
+			else if (WIFSIGNALED(status))
+				ast_verb(3, "RAS on %s terminated with signal %d\n", chan->name, WTERMSIG(status));
+			else
+				ast_verbose(VERBOSE_PREFIX_3 "RAS on %s terminated weirdly.\n", chan->name);
+
 			/* Throw back into audio mode */
 			x = 1;
 			ioctl(chan->fds[0], ZT_AUDIOMODE, &x);

Modified: trunk/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=102525&r1=102524&r2=102525
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Tue Feb  5 17:00:15 2008
@@ -760,12 +760,12 @@
 		int tmp;
 		char iabuf[INET_ADDRSTRLEN];
 		char iabuf2[INET_ADDRSTRLEN];
-		ast_verbose("\n**> From %s sending %d bytes to %s ***\n",
+		ast_verb(0, "\n**> From %s sending %d bytes to %s ***\n",
 					ast_inet_ntoa(addr_ourip->sin_addr), (int) size,
 					ast_inet_ntoa(addr_to->sin_addr));
 		for (tmp = 0; tmp < size; tmp++)
-			ast_verbose("%.2x ", (unsigned char) data[tmp]);
-		ast_verbose("\n******************************************\n");
+			ast_verb(0, "%.2x ", (unsigned char) data[tmp]);
+		ast_verb(0, "\n******************************************\n");
 
 	}
 #endif
@@ -801,10 +801,8 @@
 	pte->timeout = tick + RETRANSMIT_TIMER;
 
 /*#ifdef DUMP_PACKET */
-	if ((unistimdebug) && (option_verbose > 5)) {
-		ast_verbose("Sending datas with seq #0x%.4x Using slot #%d :\n", pte->seq_server,
-					buf_pos);
-	}
+	if (unistimdebug)
+		ast_verb(6, "Sending datas with seq #0x%.4x Using slot #%d :\n", pte->seq_server, buf_pos);
 /*#endif */
 	send_raw_client(pte->wsabufsend[buf_pos].len, pte->wsabufsend[buf_pos].buf, &(pte->sin),
 				  &(pte->sout));
@@ -815,8 +813,8 @@
 static void send_ping(struct unistimsession *pte)
 {
 	BUFFSEND;
-	if ((unistimdebug) && (option_verbose > 5))
-		ast_verbose("Sending ping\n");
+	if (unistimdebug)
+		ast_verb(6, "Sending ping\n");
 	pte->tick_next_ping = get_tick_count() + unistim_keepalive;
 	memcpy(buffsend + SIZE_HEADER, packet_send_ping, sizeof(packet_send_ping));
 	send_client(SIZE_HEADER + sizeof(packet_send_ping), buffsend, pte);
@@ -866,8 +864,7 @@
 	memcpy(&s->sin, addr_from, sizeof(struct sockaddr_in));
 	get_to_address(unistimsock, &s->sout);
 	if (unistimdebug) {
-		ast_verbose
-			("Creating a new entry for the phone from %s received via server ip %s\n",
+		ast_verb(0, "Creating a new entry for the phone from %s received via server ip %s\n",
 			 ast_inet_ntoa(addr_from->sin_addr), ast_inet_ntoa(s->sout.sin_addr));
 	}
 	ast_mutex_init(&s->lock);
@@ -895,7 +892,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending end call\n");
+		ast_verb(0, "Sending end call\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_end_call, sizeof(packet_send_end_call));
 	send_client(SIZE_HEADER + sizeof(packet_send_end_call), buffsend, pte);
 }
@@ -915,22 +912,22 @@
 {
 	/* Check if our send queue contained only one element */
 	if (pte->last_buf_available == 1) {
-		if ((unistimdebug) && (option_verbose > 5))
-			ast_verbose("Our single packet was ACKed.\n");
+		if (unistimdebug)
+			ast_verb(6, "Our single packet was ACKed.\n");
 		pte->last_buf_available--;
 		set_ping_timer(pte);
 		return;
 	}
 	/* Check if this ACK catch up our latest packet */
 	else if (pte->last_seq_ack + 1 == pte->seq_server + 1) {
-		if ((unistimdebug) && (option_verbose > 5))
-			ast_verbose("Our send queue is completely ACKed.\n");
+		if (unistimdebug)
+			ast_verb(6, "Our send queue is completely ACKed.\n");
 		pte->last_buf_available = 0;    /* Purge the send queue */
 		set_ping_timer(pte);
 		return;
 	}
-	if ((unistimdebug) && (option_verbose > 5))
-		ast_verbose("We still have packets in our send queue\n");
+	if (unistimdebug)
+		ast_verb(6, "We still have packets in our send queue\n");
 	return;
 }
 
@@ -938,7 +935,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending start timer\n");
+		ast_verb(0, "Sending start timer\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_StartTimer, sizeof(packet_send_StartTimer));
 	send_client(SIZE_HEADER + sizeof(packet_send_StartTimer), buffsend, pte);
 }
@@ -947,7 +944,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending stop timer\n");
+		ast_verb(0, "Sending stop timer\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_stop_timer, sizeof(packet_send_stop_timer));
 	send_client(SIZE_HEADER + sizeof(packet_send_stop_timer), buffsend, pte);
 }
@@ -956,7 +953,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending icon pos %d with status 0x%.2x\n", pos, status);
+		ast_verb(0, "Sending icon pos %d with status 0x%.2x\n", pos, status);
 	memcpy(buffsend + SIZE_HEADER, packet_send_icon, sizeof(packet_send_icon));
 	buffsend[9] = pos;
 	buffsend[10] = status;
@@ -968,7 +965,7 @@
 	BUFFSEND;
 	if (!tone1) {
 		if (unistimdebug)
-			ast_verbose("Sending Stream Based Tone Off\n");
+			ast_verb(0, "Sending Stream Based Tone Off\n");
 		memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_off,
 			   sizeof(packet_send_stream_based_tone_off));
 		send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_off), buffsend, pte);
@@ -976,12 +973,11 @@
 	}
 	/* Since most of the world use a continuous tone, it's useless
 	   if (unistimdebug)
-	   ast_verbose ("Sending Stream Based Tone Cadence Download\n");
+	   ast_verb(0, "Sending Stream Based Tone Cadence Download\n");
 	   memcpy (buffsend + SIZE_HEADER, packet_send_StreamBasedToneCad, sizeof (packet_send_StreamBasedToneCad));
 	   send_client (SIZE_HEADER + sizeof (packet_send_StreamBasedToneCad), buffsend, pte); */
 	if (unistimdebug)
-		ast_verbose("Sending Stream Based Tone Frequency Component List Download %d %d\n",
-					tone1, tone2);
+		ast_verb(0, "Sending Stream Based Tone Frequency Component List Download %d %d\n", tone1, tone2);
 	tone1 *= 8;
 	if (!tone2) {
 		memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_single_freq,
@@ -1003,7 +999,7 @@
 	}
 
 	if (unistimdebug)
-		ast_verbose("Sending Stream Based Tone On\n");
+		ast_verb(0, "Sending Stream Based Tone On\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_on,
 		   sizeof(packet_send_stream_based_tone_on));
 	send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_on), buffsend, pte);
@@ -1025,7 +1021,7 @@
 	int i;
 
 	if (unistimdebug)
-		ast_verbose("Sending favorite pos %d with status 0x%.2x\n", pos, status);
+		ast_verb(0, "Sending favorite pos %d with status 0x%.2x\n", pos, status);
 	memcpy(buffsend + SIZE_HEADER, packet_send_favorite, sizeof(packet_send_favorite));
 	buffsend[10] = pos;
 	buffsend[24] = pos;
@@ -1042,7 +1038,7 @@
 	int i = 0;
 
 	if (unistimdebug)
-		ast_verbose("Refreshing all favorite\n");
+		ast_verb(0, "Refreshing all favorite\n");
 	for (i = 0; i < 6; i++) {
 		if ((pte->device->softkeyicon[i] <= FAV_ICON_HEADPHONES_ONHOLD) &&
 			(pte->device->softkeylinepos != i))
@@ -1083,7 +1079,7 @@
 static int RegisterExtension(const struct unistimsession *pte)
 {
 	if (unistimdebug)
-		ast_verbose("Trying to register extension '%s' into context '%s' to %s\n",
+		ast_verb(0, "Trying to register extension '%s' into context '%s' to %s\n",
 					pte->device->extension_number, pte->device->lines->context,
 					pte->device->lines->fullname);
 	return ast_add_extension(pte->device->lines->context, 0,
@@ -1094,7 +1090,7 @@
 static int UnregisterExtension(const struct unistimsession *pte)
 {
 	if (unistimdebug)
-		ast_verbose("Trying to unregister extension '%s' context '%s'\n",
+		ast_verb(0, "Trying to unregister extension '%s' context '%s'\n",
 					pte->device->extension_number, pte->device->lines->context);
 	return ast_context_remove_extension(pte->device->lines->context,
 										pte->device->extension_number, 1, "Unistim");
@@ -1118,7 +1114,7 @@
 		if (cur->device) {	      /* This session was registred ? */
 			s->state = STATE_CLEANING;
 			if (unistimdebug)
-				ast_verbose("close_client session %p device %p lines %p sub %p\n",
+				ast_verb(0, "close_client session %p device %p lines %p sub %p\n",
 							s, s->device, s->device->lines,
 							s->device->lines->subs[SUB_REAL]);
 			change_favorite_icon(s, FAV_ICON_NONE);
@@ -1126,7 +1122,7 @@
 			if (sub) {
 				if (sub->owner) {       /* Call in progress ? */
 					if (unistimdebug)
-						ast_verbose("Aborting call\n");
+						ast_verb(0, "Aborting call\n");
 					ast_queue_hangup(sub->owner);
 				}
 			} else
@@ -1136,7 +1132,7 @@
 			cur->device->session = NULL;
 		} else {
 			if (unistimdebug)
-				ast_verbose("Freeing an unregistered client\n");
+				ast_verb(0, "Freeing an unregistered client\n");
 		}
 		if (prev)
 			prev->next = cur->next;
@@ -1158,7 +1154,7 @@
 	ast_mutex_lock(&pte->lock);
 	if (++pte->nb_retransmit >= NB_MAX_RETRANSMIT) {
 		if (unistimdebug)
-			ast_verbose("Too many retransmit - freeing client\n");
+			ast_verb(0, "Too many retransmit - freeing client\n");
 		ast_mutex_unlock(&pte->lock);
 		close_client(pte);
 		return 1;
@@ -1179,7 +1175,7 @@
 			unsigned short seq;
 
 			seq = ntohs(sbuf[1]);
-			ast_verbose("Retransmit slot #%d (seq=#0x%.4x), last ack was #0x%.4x\n", i,
+			ast_verb(0, "Retransmit slot #%d (seq=#0x%.4x), last ack was #0x%.4x\n", i,
 						seq, pte->last_seq_ack);
 		}
 		send_raw_client(pte->wsabufsend[i].len, pte->wsabufsend[i].buf, &pte->sin,
@@ -1197,7 +1193,7 @@
 	int i;
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending text at pos %d, inverse flag %d\n", pos, inverse);
+		ast_verb(0, "Sending text at pos %d, inverse flag %d\n", pos, inverse);
 	memcpy(buffsend + SIZE_HEADER, packet_send_text, sizeof(packet_send_text));
 	buffsend[10] = pos;
 	buffsend[11] = inverse;
@@ -1213,7 +1209,7 @@
 	BUFFSEND;
 	int i;
 	if (unistimdebug)
-		ast_verbose("Sending status text\n");
+		ast_verb(0, "Sending status text\n");
 	if (pte->device) {
 		if (pte->device->status_method == 1) {  /* For new firmware and i2050 soft phone */
 			int n = strlen(text);
@@ -1250,7 +1246,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending led_update (%x)\n", led);
+		ast_verb(0, "Sending led_update (%x)\n", led);
 	memcpy(buffsend + SIZE_HEADER, packet_send_led_update, sizeof(packet_send_led_update));
 	buffsend[9] = led;
 	send_client(SIZE_HEADER + sizeof(packet_send_led_update), buffsend, pte);
@@ -1265,7 +1261,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending select output packet output=%x volume=%x mute=%x\n", output,
+		ast_verb(0, "Sending select output packet output=%x volume=%x mute=%x\n", output,
 					volume, mute);
 	memcpy(buffsend + SIZE_HEADER, packet_send_select_output,
 		   sizeof(packet_send_select_output));
@@ -1324,7 +1320,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending ring packet\n");
+		ast_verb(0, "Sending ring packet\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_ring, sizeof(packet_send_ring));
 	buffsend[24] = style + 0x10;
 	buffsend[29] = volume * 0x10;
@@ -1335,7 +1331,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending no ring packet\n");
+		ast_verb(0, "Sending no ring packet\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_no_ring, sizeof(packet_send_no_ring));
 	send_client(SIZE_HEADER + sizeof(packet_send_no_ring), buffsend, pte);
 }
@@ -1345,7 +1341,7 @@
 	BUFFSEND;
 	int i;
 	if (unistimdebug)
-		ast_verbose("Sending title text\n");
+		ast_verb(0, "Sending title text\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_title, sizeof(packet_send_title));
 	i = strlen(text);
 	if (i > 12)
@@ -1362,7 +1358,7 @@
 	struct ast_tm atm = { 0, };
 
 	if (unistimdebug)
-		ast_verbose("Sending Time & Date\n");
+		ast_verb(0, "Sending Time & Date\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_date_time, sizeof(packet_send_date_time));
 	ast_localtime(&tv, &atm, NULL);
 	buffsend[10] = (unsigned char) atm.tm_mon + 1;
@@ -1379,7 +1375,7 @@
 	struct ast_tm atm = { 0, };
 
 	if (unistimdebug)
-		ast_verbose("Sending Time & Date #2\n");
+		ast_verb(0, "Sending Time & Date #2\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_date_time2, sizeof(packet_send_date_time2));
 	ast_localtime(&tv, &atm, NULL);
 	if (pte->device)
@@ -1400,7 +1396,7 @@
 	struct ast_tm atm = { 0, };
 
 	if (unistimdebug)
-		ast_verbose("Sending Time & Date #3\n");
+		ast_verb(0, "Sending Time & Date #3\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_date_time3, sizeof(packet_send_date_time3));
 	ast_localtime(&tv, &atm, NULL);
 	buffsend[10] = (unsigned char) atm.tm_mon + 1;
@@ -1414,7 +1410,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending set blink\n");
+		ast_verb(0, "Sending set blink\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_blink_cursor, sizeof(packet_send_blink_cursor));
 	send_client(SIZE_HEADER + sizeof(packet_send_blink_cursor), buffsend, pte);
 	return;
@@ -1425,7 +1421,7 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending set cursor position\n");
+		ast_verb(0, "Sending set cursor position\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_set_pos_cursor,
 		   sizeof(packet_send_set_pos_cursor));
 	buffsend[11] = pos;
@@ -1436,10 +1432,10 @@
 static void rcv_resume_connection_with_server(struct unistimsession *pte)
 {
 	BUFFSEND;
-	if (unistimdebug)
-		ast_verbose("ResumeConnectionWithServer received\n");
-	if (unistimdebug)
-		ast_verbose("Sending packet_send_query_mac_address\n");
+	if (unistimdebug) {
+		ast_verb(0, "ResumeConnectionWithServer received\n");
+		ast_verb(0, "Sending packet_send_query_mac_address\n");
+	}
 	memcpy(buffsend + SIZE_HEADER, packet_send_query_mac_address,
 		   sizeof(packet_send_query_mac_address));
 	send_client(SIZE_HEADER + sizeof(packet_send_query_mac_address), buffsend, pte);
@@ -1480,9 +1476,7 @@
 		return 0;
 
 	if (unistimdebug)
-		ast_verbose(VERBOSE_PREFIX_3
-					"Allocating UNISTIM subchannel #%d on %s@%s ptr=%p\n", x, l->name,
-					l->parent->name, sub);
+		ast_verb(3, "Allocating UNISTIM subchannel #%d on %s@%s ptr=%p\n", x, l->name, l->parent->name, sub);
 	sub->parent = l;
 	sub->subtype = x;
 	l->subs[x] = sub;
@@ -1513,13 +1507,13 @@
 	char addrmac[19];
 	int res = 0;
 	if (unistimdebug)
-		ast_verbose("Mac Address received : ");
+		ast_verb(0, "Mac Address received : ");
 	for (tmp = 15; tmp < 15 + SIZE_HEADER; tmp++) {
 		sprintf(&addrmac[i], "%.2x", (unsigned char) buf[tmp]);
 		i += 2;
 	}
 	if (unistimdebug)
-		ast_verbose("%s\n", addrmac);
+		ast_verb(0, "%s\n", addrmac);
 	strcpy(pte->macaddr, addrmac);
 	res = unistim_register(pte);
 	if (!res) {
@@ -1533,7 +1527,7 @@
 				struct unistim_device *d, *newd;
 				struct unistim_line *newl;
 				if (unistimdebug)
-					ast_verbose("New phone, autoprovisioning on\n");
+					ast_verb(0, "New phone, autoprovisioning on\n");
 				/* First : locate the [template] section */
 				ast_mutex_lock(&devicelock);
 				d = devices;
@@ -1606,9 +1600,7 @@
 		}
 	}
 	if (pte->state != STATE_AUTHDENY) {
-		if (option_verbose > 2)
-			ast_verbose(VERBOSE_PREFIX_3 "Device '%s' successfuly registered\n",
-						pte->device->name);
+		ast_verb(3, "Device '%s' successfuly registered\n", pte->device->name);
 		switch (pte->device->extension) {
 		case EXTENSION_NONE:
 			pte->state = STATE_MAINPAGE;
@@ -1650,18 +1642,18 @@
 		pte->device->extension_number[0] = '\0';
 	}
 	if (unistimdebug)
-		ast_verbose("\nSending S1\n");
+		ast_verb(0, "\nSending S1\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_S1, sizeof(packet_send_S1));
 	send_client(SIZE_HEADER + sizeof(packet_send_S1), buffsend, pte);
 
 	if (unistimdebug)
-		ast_verbose("Sending query_basic_manager_04\n");
+		ast_verb(0, "Sending query_basic_manager_04\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_query_basic_manager_04,
 		   sizeof(packet_send_query_basic_manager_04));
 	send_client(SIZE_HEADER + sizeof(packet_send_query_basic_manager_04), buffsend, pte);
 
 	if (unistimdebug)
-		ast_verbose("Sending query_basic_manager_10\n");
+		ast_verb(0, "Sending query_basic_manager_10\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_query_basic_manager_10,
 		   sizeof(packet_send_query_basic_manager_10));
 	send_client(SIZE_HEADER + sizeof(packet_send_query_basic_manager_10), buffsend, pte);
@@ -1860,7 +1852,7 @@
 	int fds;
 
 	if (unistimdebug)
-		ast_verbose("Swapping %d and %d\n", a, b);
+		ast_verb(0, "Swapping %d and %d\n", a, b);
 
 	if ((!p->subs[a]->owner) || (!p->subs[b]->owner)) {
 		ast_log(LOG_WARNING,
@@ -1978,7 +1970,7 @@
 		if (l->subs[SUB_THREEWAY]) {
 			l->subs[SUB_THREEWAY]->alreadygone = 1;
 			if (attempt_transfer(sub, l->subs[SUB_THREEWAY]) < 0)
-				ast_verbose("attempt_transfer failed.\n");
+				ast_verb(0, "attempt_transfer failed.\n");
 		} else
 			ast_queue_hangup(sub->owner);
 	} else {
@@ -1988,7 +1980,7 @@
 			else
 				ast_log(LOG_WARNING, "threeway sub without owner\n");
 		} else
-			ast_verbose("USTM(%s@%s-%d) channel already destroyed\n", sub->parent->name,
+			ast_verb(0, "USTM(%s@%s-%d) channel already destroyed\n", sub->parent->name,
 						sub->parent->parent->name, sub->subtype);
 	}
 	change_callerid(pte, 0, pte->device->redial_number);
@@ -2013,9 +2005,7 @@
 	struct unistimsession *s = l->parent->session;
 	int res;
 
-	if (option_verbose > 2)
-		ast_verbose(VERBOSE_PREFIX_3 "Starting switch on '%s@%s-%d' to %s\n",
-					l->name, l->parent->name, sub->subtype, s->device->phone_number);
+	ast_verb(3, "Starting switch on '%s@%s-%d' to %s\n", l->name, l->parent->name, sub->subtype, s->device->phone_number);
 	ast_copy_string(chan->exten, s->device->phone_number, sizeof(chan->exten));
 	ast_copy_string(s->device->redial_number, s->device->phone_number,
 					sizeof(s->device->redial_number));
@@ -2059,7 +2049,7 @@
 	ast_mutex_lock(&sub->lock);
 	/* Allocate the RTP */
 	if (unistimdebug)
-		ast_verbose("Starting RTP. Bind on %s\n", ast_inet_ntoa(sout.sin_addr));
+		ast_verb(0, "Starting RTP. Bind on %s\n", ast_inet_ntoa(sout.sin_addr));
 	sub->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, sout.sin_addr);
 	if (!sub->rtp) {
 		ast_log(LOG_WARNING, "Unable to create RTP session: %s binaddr=%s\n",
@@ -2102,18 +2092,17 @@
 	else
 		memcpy(&public, &public_ip, sizeof(public));    /* override  */
 	if (unistimdebug) {
-		ast_verbose
-			("RTP started : Our IP/port is : %s:%hd with codec %s (%d)\n",
+		ast_verb(0, "RTP started : Our IP/port is : %s:%hd with codec %s (%d)\n",
 			 ast_inet_ntoa(us.sin_addr),
 			 htons(us.sin_port), ast_getformatname(sub->owner->readformat),
 			 sub->owner->readformat);
-		ast_verbose("Starting phone RTP stack. Our public IP is %s\n",
+		ast_verb(0, "Starting phone RTP stack. Our public IP is %s\n",
 					ast_inet_ntoa(public.sin_addr));
 	}
 	if ((sub->owner->readformat == AST_FORMAT_ULAW) ||
 		(sub->owner->readformat == AST_FORMAT_ALAW)) {
 		if (unistimdebug)
-			ast_verbose("Sending packet_send_rtp_packet_size for codec %d\n", codec);
+			ast_verb(0, "Sending packet_send_rtp_packet_size for codec %d\n", codec);
 		memcpy(buffsend + SIZE_HEADER, packet_send_rtp_packet_size,
 			   sizeof(packet_send_rtp_packet_size));
 		buffsend[10] = codec;
@@ -2121,7 +2110,7 @@
 				   sub->parent->parent->session);
 	}
 	if (unistimdebug)
-		ast_verbose("Sending Jitter Buffer Parameters Configuration\n");
+		ast_verb(0, "Sending Jitter Buffer Parameters Configuration\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_jitter_buffer_conf,
 		   sizeof(packet_send_jitter_buffer_conf));
 	send_client(SIZE_HEADER + sizeof(packet_send_jitter_buffer_conf), buffsend,
@@ -2130,7 +2119,7 @@
 		uint16_t rtcpsin_port = htons(us.sin_port) + 1; /* RTCP port is RTP + 1 */
 
 		if (unistimdebug)
-			ast_verbose("Sending OpenAudioStreamTX using method #%d\n",
+			ast_verb(0, "Sending OpenAudioStreamTX using method #%d\n",
 						sub->parent->parent->rtp_method);
 		if (sub->parent->parent->rtp_method == 3)
 			memcpy(buffsend + SIZE_HEADER, packet_send_open_audio_stream_tx3,
@@ -2161,7 +2150,7 @@
 				   sub->parent->parent->session);
 
 		if (unistimdebug)
-			ast_verbose("Sending OpenAudioStreamRX\n");
+			ast_verb(0, "Sending OpenAudioStreamRX\n");
 		if (sub->parent->parent->rtp_method == 3)
 			memcpy(buffsend + SIZE_HEADER, packet_send_open_audio_stream_rx3,
 				   sizeof(packet_send_open_audio_stream_rx3));
@@ -2193,7 +2182,7 @@
 		uint16_t rtcpsin_port = htons(us.sin_port) + 1; /* RTCP port is RTP + 1 */
 
 		if (unistimdebug)
-			ast_verbose("Sending packet_send_call default method\n");
+			ast_verb(0, "Sending packet_send_call default method\n");
 
 		memcpy(buffsend + SIZE_HEADER, packet_send_call, sizeof(packet_send_call));
 		memcpy(buffsend + 53, &public.sin_addr, sizeof(public.sin_addr));
@@ -2234,13 +2223,13 @@
 	/* No country defined ? Using US tone */
 	if (ast_strlen_zero(pte->device->country)) {
 		if (unistimdebug)
-			ast_verbose("No country defined, using US tone\n");
+			ast_verb(0, "No country defined, using US tone\n");
 		send_tone(pte, 350, 440);
 		return;
 	}
 	if (strlen(pte->device->country) != 2) {
 		if (unistimdebug)
-			ast_verbose("Country code != 2 char, using US tone\n");
+			ast_verb(0, "Country code != 2 char, using US tone\n");
 		send_tone(pte, 350, 440);
 		return;
 	}
@@ -2249,7 +2238,7 @@
 		if ((frequency[i].country[0] == pte->device->country[0]) &&
 			(frequency[i].country[1] == pte->device->country[1])) {
 			if (unistimdebug)
-				ast_verbose("Country code found (%s), freq1=%d freq2=%d\n",
+				ast_verb(0, "Country code found (%s), freq1=%d freq2=%d\n",
 							frequency[i].country, frequency[i].freq1, frequency[i].freq2);
 			send_tone(pte, frequency[i].freq1, frequency[i].freq2);
 		}
@@ -2319,7 +2308,7 @@
 	}
 	if (p->subs[SUB_THREEWAY]) {
 		if (unistimdebug)
-			ast_verbose("Transfer canceled, hangup our threeway channel\n");
+			ast_verb(0, "Transfer canceled, hangup our threeway channel\n");
 		if (p->subs[SUB_THREEWAY]->owner)
 			ast_queue_hangup(p->subs[SUB_THREEWAY]->owner);
 		else
@@ -2346,7 +2335,7 @@
 		if (pte->device->silence_generator == NULL)
 			ast_log(LOG_WARNING, "Unable to start a silence generator.\n");
 		else if (unistimdebug)
-			ast_verbose("Starting silence generator\n");
+			ast_verb(0, "Starting silence generator\n");
 	}
 	handle_dial_page(pte);
 }
@@ -2405,7 +2394,7 @@
 			/* Stop the silence generator */
 			if (s->device->silence_generator) {
 				if (unistimdebug)
-					ast_verbose("Stopping silence generator\n");
+					ast_verb(0, "Stopping silence generator\n");
 				ast_channel_stop_silence_generator(sub->owner,
 												   s->device->silence_generator);
 				s->device->silence_generator = NULL;
@@ -2431,8 +2420,7 @@
 				return;
 			}
 			if (unistimdebug)
-				ast_verbose
-					("Started three way call on channel %p (%s) subchan %d\n",
+				ast_verb(0, "Started three way call on channel %p (%s) subchan %d\n",
 					 p->subs[SUB_THREEWAY]->owner, p->subs[SUB_THREEWAY]->owner->name,
 					 p->subs[SUB_THREEWAY]->subtype);
 		} else
@@ -2453,7 +2441,7 @@
 		ast_log(LOG_NOTICE, "No available lines on: %s\n", s->device->name);
 		return;
 	} else if (unistimdebug)
-		ast_verbose("Handle Call Incoming for %s@%s\n", sub->parent->name,
+		ast_verb(0, "Handle Call Incoming for %s@%s\n", sub->parent->name,
 					s->device->name);
 	start_rtp(sub);
 	if (!sub->rtp)
@@ -2485,7 +2473,7 @@
 		return -1;
 	}
 	if (unistimdebug)
-		ast_verbose("Send Digit %c\n", digit);
+		ast_verb(0, "Send Digit %c\n", digit);
 	switch (digit) {
 	case '0':
 		send_tone(pte, 941, 1336);
@@ -2726,7 +2714,7 @@
 			/* Stop the silence generator */
 			if (pte->device->silence_generator) {
 				if (unistimdebug)
-					ast_verbose("Stopping silence generator\n");
+					ast_verb(0, "Stopping silence generator\n");
 				ast_channel_stop_silence_generator(pte->device->lines->subs[SUB_REAL]->
 												   owner, pte->device->silence_generator);
 				pte->device->silence_generator = NULL;
@@ -3291,30 +3279,30 @@
 {
 	BUFFSEND;
 	if (unistimdebug)
-		ast_verbose("Sending S4\n");
+		ast_verb(0, "Sending S4\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_s4, sizeof(packet_send_s4));
 	send_client(SIZE_HEADER + sizeof(packet_send_s4), buffsend, pte);
 	send_date_time2(pte);
 	send_date_time3(pte);
 	if (unistimdebug)
-		ast_verbose("Sending S7\n");
+		ast_verb(0, "Sending S7\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_S7, sizeof(packet_send_S7));
 	send_client(SIZE_HEADER + sizeof(packet_send_S7), buffsend, pte);
 	if (unistimdebug)
-		ast_verbose("Sending Contrast\n");
+		ast_verb(0, "Sending Contrast\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_Contrast, sizeof(packet_send_Contrast));
 	if (pte->device != NULL)
 		buffsend[9] = pte->device->contrast;
 	send_client(SIZE_HEADER + sizeof(packet_send_Contrast), buffsend, pte);
 
 	if (unistimdebug)
-		ast_verbose("Sending S9\n");
+		ast_verb(0, "Sending S9\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_s9, sizeof(packet_send_s9));
 	send_client(SIZE_HEADER + sizeof(packet_send_s9), buffsend, pte);
 	send_no_ring(pte);
 
 	if (unistimdebug)
-		ast_verbose("Sending S7\n");
+		ast_verb(0, "Sending S7\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_S7, sizeof(packet_send_S7));
 	send_client(SIZE_HEADER + sizeof(packet_send_S7), buffsend, pte);
 	send_led_update(pte, 0);
@@ -3342,7 +3330,7 @@
 	show_main_page(pte);
 	refresh_all_favorite(pte);
 	if (unistimdebug)
-		ast_verbose("Sending arrow\n");
+		ast_verb(0, "Sending arrow\n");
 	memcpy(buffsend + SIZE_HEADER, packet_send_arrow, sizeof(packet_send_arrow));
 	send_client(SIZE_HEADER + sizeof(packet_send_arrow), buffsend, pte);
 	return;
@@ -3361,7 +3349,7 @@
 		0) {
 		buf[size] = 0;
 		if (unistimdebug)
-			ast_verbose("Got the firmware version : '%s'\n", buf + 13);
+			ast_verb(0, "Got the firmware version : '%s'\n", buf + 13);
 		init_phone_step2(pte);
 		return;
 	}
@@ -3371,30 +3359,30 @@
 	}
 	if (memcmp(buf + SIZE_HEADER, packet_recv_r2, sizeof(packet_recv_r2)) == 0) {
 		if (unistimdebug)
-			ast_verbose("R2 received\n");
+			ast_verb(0, "R2 received\n");
 		return;
 	}
 
 	if (pte->state < STATE_MAINPAGE) {
 		if (unistimdebug)
-			ast_verbose("Request not authorized in this state\n");
+			ast_verb(0, "Request not authorized in this state\n");
 		return;
 	}
 	if (!memcmp(buf + SIZE_HEADER, packet_recv_pressed_key, sizeof(packet_recv_pressed_key))) {
 		char keycode = buf[13];
 
 		if (unistimdebug)
-			ast_verbose("Key pressed : keycode = 0x%.2x - current state : %d\n", keycode,
+			ast_verb(0, "Key pressed : keycode = 0x%.2x - current state : %d\n", keycode,
 						pte->state);
 
 		switch (pte->state) {
 		case STATE_INIT:
 			if (unistimdebug)
-				ast_verbose("No keys allowed in the init state\n");
+				ast_verb(0, "No keys allowed in the init state\n");
 			break;
 		case STATE_AUTHDENY:
 			if (unistimdebug)
-				ast_verbose("No keys allowed in authdeny state\n");
+				ast_verb(0, "No keys allowed in authdeny state\n");
 			break;
 		case STATE_MAINPAGE:
 			key_main_page(pte, keycode);
@@ -3424,7 +3412,7 @@
 	}
 	if (memcmp(buf + SIZE_HEADER, packet_recv_pick_up, sizeof(packet_recv_pick_up)) == 0) {
 		if (unistimdebug)
-			ast_verbose("Handset off hook\n");
+			ast_verb(0, "Handset off hook\n");
 		if (!pte->device)	       /* We are not yet registred (asking for a TN in AUTOPROVISIONING_TN) */
 			return;
 		pte->device->receiver_state = STATE_OFFHOOK;
@@ -3446,7 +3434,7 @@
 	}
 	if (memcmp(buf + SIZE_HEADER, packet_recv_hangup, sizeof(packet_recv_hangup)) == 0) {
 		if (unistimdebug)
-			ast_verbose("Handset on hook\n");
+			ast_verb(0, "Handset on hook\n");
 		if (!pte->device)
 			return;
 		pte->device->receiver_state = STATE_ONHOOK;
@@ -3490,11 +3478,11 @@
 		} else {
 			if (memcmp(buf, packet_rcv_discovery, sizeof(packet_rcv_discovery)) == 0) {
 				if (unistimdebug)
-					ast_verbose("Discovery packet received - Sending Discovery ACK\n");
+					ast_verb(0, "Discovery packet received - Sending Discovery ACK\n");
 				if (pte) {	      /* A session was already active for this IP ? */
 					if (pte->state == STATE_INIT) { /* Yes, but it's a dupe */
 						if (unistimdebug)
-							ast_verbose("Duplicated Discovery packet\n");
+							ast_verb(1, "Duplicated Discovery packet\n");
 						send_raw_client(sizeof(packet_send_discovery_ack),
 									  packet_send_discovery_ack, addr_from, &pte->sout);
 						pte->seq_phone = (short) 0x0000;	/* reset sequence number */
@@ -3518,7 +3506,7 @@
 	}
 	if (!pte) {
 		if (unistimdebug)
-			ast_verbose("%s Not a discovery packet from an unknown source : ignoring\n",

[... 611 lines stripped ...]



More information about the asterisk-commits mailing list