[Asterisk-cvs] asterisk/channels chan_zap.c,1.287,1.288

markster at lists.digium.com markster at lists.digium.com
Sat Jun 26 10:45:15 CDT 2004


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

Modified Files:
	chan_zap.c 
Log Message:
Merge cmaj's ZapDND and specific channel status manager commands (bugs #1917, 1918)


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.287
retrieving revision 1.288
diff -u -d -r1.287 -r1.288
--- chan_zap.c	26 Jun 2004 05:20:42 -0000	1.287
+++ chan_zap.c	26 Jun 2004 14:31:09 -0000	1.288
@@ -8188,6 +8188,42 @@
 	return p;
 }
 
+static int action_zapdndon(struct mansession *s, struct message *m)
+{
+    struct zt_pvt *p = NULL;
+    char *channel = astman_get_header(m, "ZapChannel");
+    if (ast_strlen_zero(channel)) {
+        astman_send_error(s, m, "No channel specified");
+        return 0;
+    }
+    p = find_channel(atoi(channel));
+    if (!p) {
+        astman_send_error(s, m, "No such channel");
+        return 0;
+    }
+    p->dnd = 1;
+    astman_send_ack(s, m, "DND Enabled");
+    return 0;
+}
+
+static int action_zapdndoff(struct mansession *s, struct message *m)
+{
+    struct zt_pvt *p = NULL;
+    char *channel = astman_get_header(m, "ZapChannel");
+    if (ast_strlen_zero(channel)) {
+        astman_send_error(s, m, "No channel specified");
+        return 0;
+    }
+    p = find_channel(atoi(channel));
+    if (!p) {
+        astman_send_error(s, m, "No such channel");
+        return 0;
+    }
+    p->dnd = 0;
+    astman_send_ack(s, m, "DND Disabled");
+    return 0;
+}
+
 static int action_transfer(struct mansession *s, struct message *m)
 {
 	struct zt_pvt *p = NULL;
@@ -9038,6 +9074,8 @@
 	ast_manager_register( "ZapTransfer", 0, action_transfer, "Transfer Zap Channel" );
 	ast_manager_register( "ZapHangup", 0, action_transferhangup, "Hangup Zap Channel" );
 	ast_manager_register( "ZapDialOffhook", 0, action_zapdialoffhook, "Dial over Zap channel while offhook" );
+    ast_manager_register( "ZapDNDon", 0, action_zapdndon, "Toggle Zap channel Do Not Disturb status ON" );
+    ast_manager_register( "ZapDNDoff", 0, action_zapdndoff, "Toggle Zap channel Do Not Disturb status OFF" );
 
 	return res;
 }




More information about the svn-commits mailing list