[Asterisk-cvs] zaptel wcfxs.c,1.41,1.42

markster at lists.digium.com markster at lists.digium.com
Fri Apr 2 00:30:29 CST 2004


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv19277

Modified Files:
	wcfxs.c 
Log Message:
Add onhook transfer mode and experimental "robust" mode...


Index: wcfxs.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wcfxs.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- wcfxs.c	25 Feb 2004 15:35:13 -0000	1.41
+++ wcfxs.c	2 Apr 2004 05:29:37 -0000	1.42
@@ -195,6 +195,7 @@
 static void wcfxs_release(struct wcfxs *wc);
 
 static int debug = 0;
+static int robust = 0;
 
 static int wcfxs_init_proslic(struct wcfxs *wc, int card, int fast , int manual, int sane);
 
@@ -1136,6 +1137,8 @@
 #endif				
 					printk("wcfxs: Card %d Going off hook\n", card);
 				zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+				if (robust)
+					wcfxs_init_proslic(wc, card, 1, 0, 1);
 				wc->oldrxhook[card] = 1;
 			
 			} else if (wc->oldrxhook[card] && !wc->debouncehook[card]) {
@@ -1162,6 +1165,19 @@
 	struct wcfxs *wc = chan->pvt;
 	int x;
 	switch (cmd) {
+	case ZT_ONHOOKTRANSFER:
+		if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
+			return -EINVAL;
+		if (get_user(x, (int *)data))
+			return -EFAULT;
+		wc->ohttimer[chan->chanpos - 1] = x << 3;
+		wc->idletxhookstate[chan->chanpos - 1] = 0x2;	/* OHT mode when idle */
+		if (wc->lasttxhook[chan->chanpos - 1] == 0x1) {
+				/* Apply the change if appropriate */
+				wc->lasttxhook[chan->chanpos - 1] = 0x2;
+				wcfxs_setreg(wc, x, 64, wc->lasttxhook[chan->chanpos - 1]);
+		}
+		break;
 	case WCFXS_GET_STATS:
 		if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
 			return -EINVAL;




More information about the svn-commits mailing list