From a1281f4eafa7eb5b869d2935803b5dd198d5997c Mon Sep 17 00:00:00 2001 From: russell Date: Wed, 15 Jun 2005 21:31:22 +0000 Subject: more stuff for 2nd gen support git-svn-id: http://svn.digium.com/svn/zaptel/branches/v1-0@677 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel.h | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'zaptel.h') diff --git a/zaptel.h b/zaptel.h index 14dd69f..8146b63 100755 --- a/zaptel.h +++ b/zaptel.h @@ -304,6 +304,14 @@ char dialstr[ZT_MAX_DTMF_BUF]; } ZT_DIAL_OPERATION; +typedef struct zt_indirect_data +{ +int chan; +int op; +void *data; +} ZT_INDIRECT_DATA; + + /* ioctl definitions */ #define ZT_CODE 'J' @@ -589,6 +597,12 @@ char dialstr[ZT_MAX_DTMF_BUF]; #define ZT_SIGFREEZE _IOW (ZT_CODE, 54, int) #define ZT_GETSIGFREEZE _IOR (ZT_CODE, 55, int) +/* + * Do a channel IOCTL from the /dev/zap/ctl interface + */ +#define ZT_INDIRECT _IOWR (ZT_CODE, 56, struct zt_indirect_data) + + /* * 60-80 are reserved for private drivers * 80-85 are reserved for dynamic span stuff @@ -604,6 +618,12 @@ char dialstr[ZT_MAX_DTMF_BUF]; */ #define ZT_DYNAMIC_DESTROY _IOW (ZT_CODE, 81, struct zt_dynamic_span) +/* + * Enable tone detection -- implemented by low level driver + */ +#define ZT_TONEDETECT _IOW (ZT_CODE, 91, int) + + /* * Startup or Shutdown a span */ @@ -630,6 +650,9 @@ char dialstr[ZT_MAX_DTMF_BUF]; #define ZT_MAX_CADENCE 16 +#define ZT_TONEDETECT_ON (1 << 0) /* Detect tones */ +#define ZT_TONEDETECT_MUTE (1 << 1) /* Mute audio in received channel */ + struct zt_ring_cadence { int ringcadence [ZT_MAX_CADENCE]; }; @@ -778,7 +801,8 @@ struct zt_tone_def { /* Structure for zone programming */ #define ZT_EVENT_POLARITY 17 #define ZT_EVENT_PULSEDIGIT (1 << 16) /* This is OR'd with the digit received */ -#define ZT_EVENT_DTMFDIGIT (1 << 17) /* Ditto for DTMF */ +#define ZT_EVENT_DTMFDOWN (1 << 17) /* Ditto for DTMF key down event */ +#define ZT_EVENT_DTMFUP (1 << 18) /* Ditto for DTMF key up event */ /* Flag Value for IOMUX, read avail */ #define ZT_IOMUX_READ 1 @@ -849,7 +873,7 @@ struct zt_tone_def { /* Structure for zone programming */ #define ZT_DEFAULT_PULSEAFTERTIME 750 /* 750ms between dial pulse digits */ #define ZT_MINPULSETIME (15 * 8) /* 15 ms minimum */ -#define ZT_MAXPULSETIME (150 * 8) /* 150 ms maximum */ +#define ZT_MAXPULSETIME (200 * 8) /* 200 ms maximum */ #define ZT_PULSETIMEOUT ((ZT_MAXPULSETIME / 8) + 50) #define ZT_RINGTRAILER (50 * 8) /* Don't consider a ring "over" until it's been gone at least this @@ -1228,6 +1252,9 @@ struct zt_span { /* Opt: IOCTL */ int (*ioctl)(struct zt_chan *chan, unsigned int cmd, unsigned long data); + /* Opt: Native echo cancellation */ + int (*echocan)(struct zt_chan *chan, int ecval); + /* Okay, now we get to the signalling. You have several options: */ /* Option 1: If you're a T1 like interface, you can just provide a @@ -1247,6 +1274,9 @@ struct zt_span { /* Option 3: If you can't use sig bits, you can write a function which handles the individual hook states */ int (*sethook)(struct zt_chan *chan, int hookstate); + + /* Opt: Dacs the contents of chan2 into chan1 if possible */ + int (*dacs)(struct zt_chan *chan1, struct zt_chan *chan2); /* Used by zaptel only -- no user servicable parts inside */ int spanno; /* Span number for zaptel */ @@ -1350,6 +1380,7 @@ extern struct zt_tone *zt_dtmf_tone(char digit, int mf); not be doing so. rxchunk is modified in-place */ extern void zt_ec_chunk(struct zt_chan *chan, unsigned char *rxchunk, const unsigned char *txchunk); +extern void zt_ec_span(struct zt_span *span); /* Don't use these directly -- they're not guaranteed to be there. */ -- cgit v1.2.3