From 0a1121e435c240bc917130fdf86afcc34f7a8a7f Mon Sep 17 00:00:00 2001 From: markster Date: Fri, 16 Apr 2004 17:59:07 +0000 Subject: Add support for E&M / E1 git-svn-id: http://svn.digium.com/svn/zaptel/trunk@366 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- tor2.c | 2 +- wct1xxp.c | 2 +- wct4xxp.c | 2 +- zaptel.c | 11 +++++++++-- zaptel.h | 1 + ztcfg.c | 4 ++++ 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tor2.c b/tor2.c index 9df1f82..fd95998 100755 --- a/tor2.c +++ b/tor2.c @@ -307,7 +307,7 @@ static void init_spans(struct tor2 *tor) struct zt_chan *mychans = tor->chans[x] + y; sprintf(mychans->name, "Tor2/%d/%d/%d", tor->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_SF; + ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_SF | ZT_SIG_EM_E1; c = (x * tor->spans[x].channels) + y; mychans->pvt = &tor->tchans[c]; mychans->chanpos = y + 1; diff --git a/wct1xxp.c b/wct1xxp.c index f9e20e3..e5d9b06 100755 --- a/wct1xxp.c +++ b/wct1xxp.c @@ -786,7 +786,7 @@ static int t1xxp_software_init(struct t1xxp *wc) init_waitqueue_head(&wc->span.maintq); for (x=0;xspan.channels;x++) { sprintf(wc->chans[x].name, "WCT1/%d/%d", wc->num, x + 1); - wc->chans[x].sigcap = ZT_SIG_EM | ZT_SIG_CLEAR | + wc->chans[x].sigcap = ZT_SIG_EM | ZT_SIG_CLEAR | ZT_SIG_EM_E1 | ZT_SIG_FXSLS | ZT_SIG_FXSGS | ZT_SIG_FXSKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_SF; diff --git a/wct4xxp.c b/wct4xxp.c index da87006..64b654a 100755 --- a/wct4xxp.c +++ b/wct4xxp.c @@ -583,7 +583,7 @@ static void init_spans(struct t4 *wc) 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_FXOLS | ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_EM_E1; c = (x * wc->spans[x].channels) + y; mychans->pvt = wc; mychans->chanpos = y + 1; diff --git a/zaptel.c b/zaptel.c index 81f9dbb..0250673 100755 --- a/zaptel.c +++ b/zaptel.c @@ -339,7 +339,7 @@ static rwlock_t chan_lock = RW_LOCK_UNLOCKED; static struct zt_zone *tone_zones[ZT_TONE_ZONE_MAX]; -#define NUM_SIGS 9 +#define NUM_SIGS 10 static inline void rotate_sums(void) @@ -367,7 +367,8 @@ static unsigned int in_sig[NUM_SIGS][2] = { { ZT_SIG_FXOLS,0 | (ZT_ABIT << 8)}, { ZT_SIG_FXOGS,ZT_BBIT | ((ZT_ABIT | ZT_BBIT) << 8)}, { ZT_SIG_FXOKS,0 | (ZT_ABIT << 8)}, - { ZT_SIG_SF, 0} + { ZT_SIG_SF, 0}, + { ZT_SIG_EM_E1, ZT_DBIT | (ZT_ABIT << 8) }, } ; /* must have span to begin with */ @@ -405,6 +406,8 @@ static char *sigstr(int sig) return "FXOGS"; case ZT_SIG_EM: return "E&M"; + case ZT_SIG_EM_E1: + return "E&M-E1"; case ZT_SIG_CLEAR: return "ClearChannel"; case ZT_SIG_HDLCRAW: @@ -1768,6 +1771,8 @@ who cares what the sig bits are as long as they are stable */ ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT, ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT, ZT_BBIT | ZT_CBIT | ZT_DBIT }, /* no signalling */ + { ZT_SIG_EM_E1, ZT_DBIT, ZT_ABIT | ZT_BBIT | ZT_DBIT, + ZT_ABIT | ZT_BBIT | ZT_DBIT, ZT_DBIT }, /* E and M E1 */ } ; int x; @@ -4800,6 +4805,7 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig) chan->rxhooksig = rxsig; switch(chan->sig) { case ZT_SIG_EM: /* E and M */ + case ZT_SIG_EM_E1: switch(rxsig) { case ZT_RXSIG_OFFHOOK: /* went off hook */ /* The interface is going off hook */ @@ -4924,6 +4930,7 @@ void zt_rbsbits(struct zt_chan *chan, int cursig) } /* Fall through */ case ZT_SIG_EM: /* E and M */ + case ZT_SIG_EM_E1: case ZT_SIG_FXOLS: /* FXO Loopstart */ case ZT_SIG_FXOKS: /* FXO Kewlstart */ if (cursig & ZT_ABIT) /* off hook */ diff --git a/zaptel.h b/zaptel.h index 2748037..9e2350e 100755 --- a/zaptel.h +++ b/zaptel.h @@ -101,6 +101,7 @@ #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_EM_E1 (1 << 17) /* E1 E&M Variation */ /* tone flag values */ #define ZT_REVERSE_RXTONE 1 /* reverse polarity rx tone logic */ diff --git a/ztcfg.c b/ztcfg.c index aa44f28..13160e9 100755 --- a/ztcfg.c +++ b/ztcfg.c @@ -403,6 +403,9 @@ static int chanconfig(char *keyword, char *args) if (!strcasecmp(keyword, "e&m")) { sig[x] = "E & M"; cc[x].sigtype = ZT_SIG_EM; + } else if (!strcasecmp(keyword, "e&me1")) { + sig[x] = "E & M E1"; + cc[x].sigtype = ZT_SIG_EM_E1; } else if (!strcasecmp(keyword, "fxsls")) { sig[x] = "FXS Loopstart"; cc[x].sigtype = ZT_SIG_FXSLS; @@ -600,6 +603,7 @@ static struct handler { { "loadzone", registerzone }, { "defaultzone", defaultzone }, { "e&m", chanconfig }, + { "e&me1", chanconfig }, { "fxsls", chanconfig }, { "fxsgs", chanconfig }, { "fxsks", chanconfig }, -- cgit v1.2.3