[Asterisk-cvs] zaptel wct4xxp.c,1.44,1.45 zaptel.c,1.72,1.73 zaptel.conf.sample,1.12,1.13 zaptel.h,1.31,1.32 ztcfg.c,1.14,1.15

markster at lists.digium.com markster at lists.digium.com
Mon May 3 23:12:02 CDT 2004


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

Modified Files:
	wct4xxp.c zaptel.c zaptel.conf.sample zaptel.h ztcfg.c 
Log Message:
Add RBS support to DACS (bug #1451)


Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- wct4xxp.c	26 Apr 2004 05:04:55 -0000	1.44
+++ wct4xxp.c	4 May 2004 03:20:08 -0000	1.45
@@ -583,7 +583,7 @@
 			struct zt_chan *mychans = wc->chans[x] + y;
 			sprintf(mychans->name, "TE4/%d/%d/%d", wc->num, x + 1, y + 1);
 			mychans->sigcap = ZT_SIG_EM | ZT_SIG_CLEAR | ZT_SIG_FXSLS | ZT_SIG_FXSGS | ZT_SIG_FXSKS |
-									 ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_EM_E1;
+									 ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_EM_E1 | ZT_SIG_DACS_RBS;
 			c = (x * wc->spans[x].channels) + y;
 			mychans->pvt = wc;
 			mychans->chanpos = y + 1;

Index: zaptel.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- zaptel.c	1 May 2004 17:36:39 -0000	1.72
+++ zaptel.c	4 May 2004 03:20:08 -0000	1.73
@@ -422,6 +422,8 @@
 			return "CAS";
 		case ZT_SIG_DACS:
 			return "DACS";
+		case ZT_SIG_DACS_RBS:
+			return "DACS+RBS";
 		case ZT_SIG_SF:
 			return "SF (ToneOnly)";
 		case ZT_SIG_NONE:
@@ -906,7 +908,7 @@
 	oldconf = chan->confna;
 	  /* initialize conference variables */
 	chan->_confn = 0;
-	if ((chan->sig & ZT_SIG_DACS) != ZT_SIG_DACS) {
+	if ((chan->sig & __ZT_SIG_DACS) != __ZT_SIG_DACS) {
 		chan->confna = 0;
 		chan->confmode = 0;
 	}
@@ -1970,7 +1972,7 @@
 	chan->iomask = 0;
 	/* release conference resource if any */
 	if (chan->confna) zt_check_conf(chan->confna);
-	if ((chan->sig & ZT_SIG_DACS) != ZT_SIG_DACS) {
+	if ((chan->sig & __ZT_SIG_DACS) != __ZT_SIG_DACS) {
 		chan->confna = 0;
 		chan->confmode = 0;
 	}
@@ -2085,7 +2087,7 @@
 			res = -EBUSY;
 		else if (chans[unit]->master != chans[unit])
 			res = -EBUSY;
-		else if (chans[unit]->sig == ZT_SIG_DACS)
+		else if ((chans[unit]->sig & __ZT_SIG_DACS) == __ZT_SIG_DACS)
 			res = -EBUSY;
 		else {
 			/* Assume everything is going to be okay */
@@ -2929,7 +2931,7 @@
 				return -EINVAL;
 			ch.sigtype = chans[ch.master]->sig;
 			newmaster = chans[ch.master];
-		} else if (ch.sigtype == ZT_SIG_DACS) {
+		} else if ((ch.sigtype & __ZT_SIG_DACS) == __ZT_SIG_DACS) {
 			newmaster = chans[ch.chan];
 			if ((ch.idlebits < 1) || (ch.idlebits >= ZT_MAX_CHANNELS))
 				return -EINVAL;
@@ -3003,7 +3005,7 @@
 				/* Clear FCS flag */
 				chans[ch.chan]->flags &= ~ZT_FLAG_FCS;
 			}
-			if ((ch.sigtype & ZT_SIG_DACS) == ZT_SIG_DACS) {
+			if ((ch.sigtype & __ZT_SIG_DACS) == __ZT_SIG_DACS) {
 				/* Setup conference properly */
 				chans[ch.chan]->confmode = ZT_CONF_DIGITALMON;
 				chans[ch.chan]->confna = ch.idlebits;
@@ -5766,6 +5768,16 @@
 					__zt_real_transmit(&span->chans[x]);
 				}
 			}
+			if (span->chans[x].sig == ZT_SIG_DACS_RBS) {
+				if (chans[span->chans[x].confna]) {
+				    	/* Just set bits for our destination */
+					if (span->chans[x].txsig != chans[span->chans[x].confna]->rxsig) {
+						span->chans[x].txsig = chans[span->chans[x].confna]->rxsig;
+						span->rbsbits(&span->chans[x], chans[span->chans[x].confna]->rxsig);
+					}
+				}
+			}
+
 		}
 		spin_unlock_irqrestore(&span->chans[x].lock, flags);
 	}

Index: zaptel.conf.sample
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.conf.sample,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- zaptel.conf.sample	27 Mar 2004 21:33:32 -0000	1.12
+++ zaptel.conf.sample	4 May 2004 03:20:08 -0000	1.13
@@ -87,6 +87,9 @@
 #             sethdlc (available separately).
 # "dacs"    : The zaptel driver cross connects the channels starting at
 #             the channel number listed at the end, after a colon
+# "dacsrbs" : The zaptel driver cross connects the channels starting at
+#             the channel number listed at the end, after a colon and 
+#             also performs the DACSing of RBS bits
 #
 # The channel list is a comma-separated list of channels or ranges, for
 # example:
@@ -113,6 +116,7 @@
 #clear=47
 #fcshdlc=48
 #dacs=1-24:48
+#dacsrbs=1-24:48
 #
 # Finally, you can preload some tone zones, to prevent them from getting
 # overwritten by other users (if you allow non-root users to open /dev/zap/*

Index: zaptel.h
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- zaptel.h	16 Apr 2004 17:59:07 -0000	1.31
+++ zaptel.h	4 May 2004 03:20:08 -0000	1.32
@@ -93,6 +93,8 @@
 
 /* The following are all variations on clear channel */
 
+#define __ZT_SIG_DACS	 (1 << 16)
+
 #define ZT_SIG_CLEAR	 (1 << 7)					/* Clear channel */
 #define ZT_SIG_HDLCRAW	((1 << 8)  | ZT_SIG_CLEAR)	/* Raw unchecked HDLC */
 #define ZT_SIG_HDLCFCS	((1 << 9)  | ZT_SIG_HDLCRAW)	/* HDLC with FCS calculation */
@@ -100,8 +102,9 @@
 #define ZT_SIG_SLAVE	 (1 << 11) 					/* Slave to another channel */
 #define	ZT_SIG_SF	 (1 << 14)			/* Single Freq. tone only, no sig bits */
 #define ZT_SIG_CAS	 (1 << 15)			/* Just get bits */
-#define ZT_SIG_DACS	((1 << 16) | ZT_SIG_CLEAR)	/* Cross connect */
+#define ZT_SIG_DACS	(__ZT_SIG_DACS | ZT_SIG_CLEAR)	/* Cross connect */
 #define ZT_SIG_EM_E1	 (1 << 17)			/* E1 E&M Variation */
+#define ZT_SIG_DACS_RBS	 ((1 << 18) | __ZT_SIG_DACS)	/* Cross connect w/ RBS */
 
 /* tone flag values */
 #define	ZT_REVERSE_RXTONE 1  /* reverse polarity rx tone logic */

Index: ztcfg.c
===================================================================
RCS file: /usr/cvsroot/zaptel/ztcfg.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ztcfg.c	16 Apr 2004 17:59:07 -0000	1.14
+++ ztcfg.c	4 May 2004 03:20:08 -0000	1.15
@@ -376,7 +376,7 @@
 	bzero(chans, sizeof(chans));
 	strtok(args, ":");
 	idle = strtok(NULL, ":");
-	if (!strcasecmp(keyword, "dacs")) {
+	if (!strcasecmp(keyword, "dacs") || !strcasecmp(keyword, "dacsrbs")) {
 		res = parse_channel(idle, &dacschan);
 	}
 	if (!res)
@@ -389,7 +389,7 @@
 				error("Channel %d already configured as '%s' at line %d\n", x, sig[x], slineno[x]);
 				continue;
 			}
-			if (!strcasecmp(keyword, "dacs") && slineno[dacschan]) {
+			if ((!strcasecmp(keyword, "dacs") || !strcasecmp(keyword, "dacsrbs")) && slineno[dacschan]) {
 				error("DACS Destination channel %d already configured as '%s' at line %d\n", dacschan, sig[dacschan], slineno[dacschan]);
 				continue;
 			} else {
@@ -439,6 +439,16 @@
 				cc[dacschan].sigtype = ZT_SIG_DACS;
 				sig[dacschan] = "DACS";
 				dacschan++;
+			} else if (!strcasecmp(keyword, "dacsrbs")) {
+				/* Setup channel for monitor */
+				cc[x].idlebits = dacschan;
+				cc[x].sigtype = ZT_SIG_DACS_RBS;
+				sig[x] = "DACS w/ RBS";
+				/* Setup inverse */
+				cc[dacschan].idlebits = x;
+				cc[dacschan].sigtype = ZT_SIG_DACS_RBS;
+				sig[dacschan] = "DACS w/ RBS";
+				dacschan++;
 			} else if (!strcasecmp(keyword, "unused")) {
 				sig[x] = "Unused";
 				cc[x].sigtype = 0;
@@ -574,7 +584,7 @@
 			if ((cc[x].sigtype != ZT_SIG_SLAVE) && (cc[x].sigtype)) {
 				configs++;
 				ps = 0;
-				if (cc[x].sigtype == ZT_SIG_DACS)
+				if ((cc[x].sigtype & __ZT_SIG_DACS) == __ZT_SIG_DACS)
 					printf("Channel %02d %s to %02d", x, sig[x], cc[x].idlebits);
 				else {
 					printf("Channel %02d: %s (%s)", x, sig[x], laws[cc[x].deflaw]);
@@ -620,6 +630,7 @@
 	{ "unused", chanconfig },
 	{ "cas", chanconfig },
 	{ "dacs", chanconfig },
+	{ "dacsrbs", chanconfig },
 	{ "user", chanconfig },
 	{ "alaw", setlaw },
 	{ "mulaw", setlaw },




More information about the svn-commits mailing list