[Asterisk-cvs] asterisk/channels chan_zap.c,1.430,1.431

kpfleming at lists.digium.com kpfleming at lists.digium.com
Tue Apr 26 23:13:59 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv27461/channels

Modified Files:
	chan_zap.c 
Log Message:
add manager events for Zaptel DND state changes (bug #4070, with mods)


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.430
retrieving revision 1.431
diff -u -d -r1.430 -r1.431
--- chan_zap.c	27 Apr 2005 01:59:00 -0000	1.430
+++ chan_zap.c	27 Apr 2005 04:03:49 -0000	1.431
@@ -5291,8 +5291,12 @@
 				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);
+				}
 				res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
 				p->dnd = 1;
 				getforward = 0;
@@ -5300,8 +5304,12 @@
 				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);
+				}
 				res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
 				p->dnd = 0;
 				getforward = 0;
@@ -9353,10 +9361,12 @@
 				"Channel: %d\r\n"
 				"Signalling: %s\r\n"
 				"Context: %s\r\n"
+				"DND: %s\r\n"
 				"Alarm: %s\r\n"
 				"%s"
 				"\r\n",
 				tmp->channel, sig2str(tmp->sig), tmp->context, 
+				tmp->dnd ? "Enabled" : "Disabled",
 				alarm2str(alarm), idText);
 			ast_mutex_unlock(&s->lock);		
 		} 




More information about the svn-commits mailing list