[zaptel-commits] tzafrir: branch tzafrir/patches r2799 - in /team/tzafrir/patches: ./ wctdm24x...

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Sat Jul 28 20:40:38 CDT 2007


Author: tzafrir
Date: Sat Jul 28 20:40:37 2007
New Revision: 2799

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2799
Log:
* Extend wctdm_type.diff from #9496 to wctdm24xxp as well.
* Adapt genzaptelconf accordingly.

Modified:
    team/tzafrir/patches/wctdm.c
    team/tzafrir/patches/wctdm24xxp/base.c
    team/tzafrir/patches/xpp/utils/genzaptelconf

Modified: team/tzafrir/patches/wctdm.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/patches/wctdm.c?view=diff&rev=2799&r1=2798&r2=2799
==============================================================================
--- team/tzafrir/patches/wctdm.c (original)
+++ team/tzafrir/patches/wctdm.c Sat Jul 28 20:40:37 2007
@@ -2017,6 +2017,18 @@
 	return 0;
 }
 
+/** Set the name for the card
+ * @param chan the channel struct. Should have pvt and chan_pos set.
+ * @param type a label of the type of port (FXS, FXO or empty). It is intended
+ *   to be human readable, and hence use FXS for an FXS module.
+ */
+static void wctdm_set_chan_name(struct zt_chan *chan, const char *type) {
+	struct wctdm *span = (struct wctdm*)chan->pvt;
+
+	sprintf(chan->name, "WCTDM/%d/%d:%s", span->pos, 
+			chan->chanpos - 1, type);
+}
+
 static int wctdm_initialize(struct wctdm *wc)
 {
 	int x;
@@ -2030,11 +2042,11 @@
 	} else
 		wc->span.deflaw = ZT_LAW_MULAW;
 	for (x = 0; x < NUM_CARDS; x++) {
-		sprintf(wc->chans[x].name, "WCTDM/%d/%d", wc->pos, x);
 		wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
 		wc->chans[x].sigcap |= ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
 		wc->chans[x].chanpos = x+1;
 		wc->chans[x].pvt = wc;
+		wctdm_set_chan_name(&wc->chans[x], "empty");
 	}
 	wc->span.chans = wc->chans;
 	wc->span.channels = NUM_CARDS;
@@ -2060,10 +2072,13 @@
 	/* Finalize signalling  */
 	for (x = 0; x < NUM_CARDS; x++) {
 		if (wc->cardflag & (1 << x)) {
-			if (wc->modtype[x] == MOD_TYPE_FXO)
+			if (wc->modtype[x] == MOD_TYPE_FXO) {
 				wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
-			else
+				wctdm_set_chan_name(&wc->chans[x], "FXO");
+			} else {
 				wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
+				wctdm_set_chan_name(&wc->chans[x], "FXS");
+			}
 		}
 	}
 }

Modified: team/tzafrir/patches/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/patches/wctdm24xxp/base.c?view=diff&rev=2799&r1=2798&r2=2799
==============================================================================
--- team/tzafrir/patches/wctdm24xxp/base.c (original)
+++ team/tzafrir/patches/wctdm24xxp/base.c Sat Jul 28 20:40:37 2007
@@ -2983,6 +2983,18 @@
 	return 0;
 }
 
+/** Set the name for the card
+ * @param chan the channel struct. Should have pvt and chan_pos set.
+ * @param type a label of the type of port (FXS, FXO or empty). It is intended
+ *   to be human readable, and hence use FXS for an FXS module.
+ */
+static void wctdm_set_chan_name(struct zt_chan *chan, const char *type) {
+	struct wctdm *span = (struct wctdm*)chan->pvt;
+
+	sprintf(chan->name, "WCTDM/%d/%d:%s", span->pos, 
+			chan->chanpos - 1, type);
+}
+
 static int wctdm_initialize(struct wctdm *wc)
 {
 	int x;
@@ -2996,7 +3008,7 @@
 	} else
 		wc->span.deflaw = ZT_LAW_MULAW;
 	for (x=0;x<wc->cards;x++) {
-		sprintf(wc->chans[x].name, "WCTDM/%d/%d", wc->pos, x);
+		wctdm_set_chan_name(&wc->chans[x], "empty");
 		wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
 		wc->chans[x].sigcap |= ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
 		wc->chans[x].chanpos = x+1;
@@ -3030,12 +3042,16 @@
 	/* Finalize signalling  */
 	for (x=0;x<wc->cards;x++) {
 		if (wc->cardflag & (1 << x)) {
-			if (wc->modtype[x] == MOD_TYPE_FXO)
+			if (wc->modtype[x] == MOD_TYPE_FXO) {
 				wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
-			else if (wc->modtype[x] == MOD_TYPE_FXS)
+				wctdm_set_chan_name(&wc->chans[x], "FXO");
+			} else if (wc->modtype[x] == MOD_TYPE_FXS) { 
 				wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
-			else if (wc->modtype[x] == MOD_TYPE_QRV)
+				wctdm_set_chan_name(&wc->chans[x], "FXO");
+			} else if (wc->modtype[x] == MOD_TYPE_QRV) {
 				wc->chans[x].sigcap = ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
+				wctdm_set_chan_name(&wc->chans[x], "QRV");
+			}
 		}
 	}
 }

Modified: team/tzafrir/patches/xpp/utils/genzaptelconf
URL: http://svn.digium.com/view/zaptel/team/tzafrir/patches/xpp/utils/genzaptelconf?view=diff&rev=2799&r1=2798&r2=2799
==============================================================================
--- team/tzafrir/patches/xpp/utils/genzaptelconf (original)
+++ team/tzafrir/patches/xpp/utils/genzaptelconf Sat Jul 28 20:40:37 2007
@@ -948,6 +948,17 @@
 			# in case this is a real channel. 
 			chan_num=`echo $line |awk '{print $1}'`
 			case "$line" in
+			*WCTDM/*/*:FXS) print_pattern $chan_num fxo $mode ;;
+			*WCTDM/*/*:FXO) print_pattern $chan_num fxs $mode ;;
+			*WCTDM/*/*:empty) : ;;
+			*WCTDM/*/*:QVR) # What is that??
+				case "$mode" in
+				list) echo "# ??: $line";;
+				files)
+					echo "# ??: $line" >>$zaptel_file
+					echo "; ??: $line" >>$zapata_file
+				esac
+                                ;;
 			*WCTDM/*|*\ WRTDM/*|*OPVXA1200/*) 
 				# TDM400P/2400P and similar cards (Sangoma A200, OpenVox A1200)
 				# this can be either FXS or FXO




More information about the zaptel-commits mailing list