[Asterisk-cvs] zaptel wctdm.c,1.92,1.93
mattf at lists.digium.com
mattf at lists.digium.com
Wed Dec 22 14:27:25 CST 2004
Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv26373
Modified Files:
wctdm.c
Log Message:
Added ability to switch the native codec of the TDM card to ALAW
Index: wctdm.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wctdm.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- wctdm.c 4 Dec 2004 04:19:41 -0000 1.92
+++ wctdm.c 22 Dec 2004 19:23:08 -0000 1.93
@@ -357,6 +357,7 @@
static int _opermode = 0;
static char *opermode = "FCC";
static int fxshonormode = 0;
+static int alawoverride = 0;
static int wctdm_init_proslic(struct wctdm *wc, int card, int fast , int manual, int sane);
@@ -1345,7 +1346,10 @@
wait_just_a_bit(HZ/10);
/* Enable PCM, ulaw */
- wctdm_setreg(wc, card, 33, 0x28);
+ if (alawoverride)
+ wctdm_setreg(wc, card, 33, 0x20);
+ else
+ wctdm_setreg(wc, card, 33, 0x28);
/* Set On-hook speed, Ringer impedence, and ringer threshold */
reg16 |= (fxo_modes[_opermode].ohs << 6);
@@ -1527,7 +1531,10 @@
}
#endif
- wctdm_setreg(wc, card, 1, 0x28);
+ if (alawoverride)
+ wctdm_setreg(wc, card, 1, 0x20);
+ else
+ wctdm_setreg(wc, card, 1, 0x28);
// U-Law 8-bit interface
wctdm_setreg(wc, card, 2, (3-card) * 8); // Tx Start count low byte 0
wctdm_setreg(wc, card, 3, 0); // Tx Start count high byte 0
@@ -1752,7 +1759,10 @@
/* Zapata stuff */
sprintf(wc->span.name, "WCTDM/%d", wc->pos);
sprintf(wc->span.desc, "%s Board %d", wc->variety, wc->pos + 1);
- wc->span.deflaw = ZT_LAW_MULAW;
+ if (alawoverride)
+ wc->span.deflaw = ZT_LAW_ALAW;
+ 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);
wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM;
More information about the svn-commits
mailing list