[Asterisk-cvs] asterisk/channels chan_zap.c,1.200,1.201

markster at lists.digium.com markster at lists.digium.com
Tue Apr 6 11:49:56 CDT 2004


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

Modified Files:
	chan_zap.c 
Log Message:
Print actual hook state in chan_zap


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- chan_zap.c	4 Apr 2004 20:43:07 -0000	1.200
+++ chan_zap.c	6 Apr 2004 15:50:18 -0000	1.201
@@ -7056,6 +7056,7 @@
 	int channel;
 	struct zt_pvt *tmp = NULL;
 	ZT_CONFINFO ci;
+	ZT_PARAMS ps;
 	int x;
 
 	if (argc != 4)
@@ -7127,8 +7128,12 @@
 				ast_cli(fd, "Actual Confmute: %s\n", x ? "Yes" : "No");
 			}
 #endif
-			ast_mutex_unlock(&iflock);
-			return RESULT_SUCCESS;
+			ps.channo = tmp->channel;
+			if (ioctl(tmp->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps) < 0) {
+				ast_log(LOG_WARNING, "Failed to get parameters on channel %d\n", tmp->channel);
+			} else {
+				ast_cli(fd, "Actual Hookstate: %s\n", ps.rxisoffhook ? "Offhook" : "Onhook");
+			}
 		}
 		tmp = tmp->next;
 	}




More information about the svn-commits mailing list