summaryrefslogtreecommitdiff
path: root/wctdm.c
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-12-22 19:23:08 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-12-22 19:23:08 +0000
commitc09e5d336f873eaaf95a5db3b8a255b331cd2bc2 (patch)
tree7cb9523f2c3a21329fdce59ca929b9e5998e82ac /wctdm.c
parent5ccad649b6fbb917cecf9530ba64814459dfe565 (diff)
Added ability to switch the native codec of the TDM card to ALAW
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@514 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wctdm.c')
-rwxr-xr-xwctdm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/wctdm.c b/wctdm.c
index 7b74437..b67888e 100755
--- a/wctdm.c
+++ b/wctdm.c
@@ -357,6 +357,7 @@ static int boostringer = 0;
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 @@ static int wctdm_init_voicedaa(struct wctdm *wc, int card, int fast, int manual,
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 @@ static int wctdm_init_proslic(struct wctdm *wc, int card, int fast, int manual,
}
#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 @@ static int wctdm_initialize(struct wctdm *wc)
/* 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;