|
|
|
@ -466,14 +466,14 @@ struct zt_subchannel {
|
|
|
|
|
int chan;
|
|
|
|
|
short buffer[AST_FRIENDLY_OFFSET/2 + READ_SIZE];
|
|
|
|
|
struct ast_frame f; /* One frame for each channel. How did this ever work before? */
|
|
|
|
|
int needringing;
|
|
|
|
|
int needbusy;
|
|
|
|
|
int needcongestion;
|
|
|
|
|
int needcallerid;
|
|
|
|
|
int needanswer;
|
|
|
|
|
int needflash;
|
|
|
|
|
int linear;
|
|
|
|
|
int inthreeway;
|
|
|
|
|
unsigned int needringing:1;
|
|
|
|
|
unsigned int needbusy:1;
|
|
|
|
|
unsigned int needcongestion:1;
|
|
|
|
|
unsigned int needcallerid:1;
|
|
|
|
|
unsigned int needanswer:1;
|
|
|
|
|
unsigned int needflash:1;
|
|
|
|
|
unsigned int linear:1;
|
|
|
|
|
unsigned int inthreeway:1;
|
|
|
|
|
ZT_CONFINFO curconf;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -497,15 +497,67 @@ static struct zt_pvt {
|
|
|
|
|
|
|
|
|
|
int sig; /* Signalling style */
|
|
|
|
|
int radio; /* radio type */
|
|
|
|
|
int firstradio; /* first radio flag */
|
|
|
|
|
float rxgain;
|
|
|
|
|
float txgain;
|
|
|
|
|
int tonezone; /* tone zone for this chan, or -1 for default */
|
|
|
|
|
struct zt_pvt *next; /* Next channel in list */
|
|
|
|
|
struct zt_pvt *prev; /* Prev channel in list */
|
|
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
|
unsigned int adsi:1;
|
|
|
|
|
unsigned int answeronpolarityswitch:1;
|
|
|
|
|
unsigned int busydetect:1;
|
|
|
|
|
unsigned int callreturn:1;
|
|
|
|
|
unsigned int callwaiting:1;
|
|
|
|
|
unsigned int callwaitingcallerid:1;
|
|
|
|
|
unsigned int cancallforward:1;
|
|
|
|
|
unsigned int canpark:1;
|
|
|
|
|
unsigned int confirmanswer:1; /* Wait for '#' to confirm answer */
|
|
|
|
|
unsigned int destroy:1;
|
|
|
|
|
unsigned int didtdd:1; /* flag to say its done it once */
|
|
|
|
|
unsigned int dialednone:1;
|
|
|
|
|
unsigned int dialing:1;
|
|
|
|
|
unsigned int digital:1;
|
|
|
|
|
unsigned int dnd:1;
|
|
|
|
|
unsigned int echobreak:1;
|
|
|
|
|
unsigned int echocanbridged:1;
|
|
|
|
|
unsigned int echocanon:1;
|
|
|
|
|
unsigned int faxhandled:1; /* Has a fax tone already been handled? */
|
|
|
|
|
unsigned int firstradio:1;
|
|
|
|
|
unsigned int hanguponpolarityswitch:1;
|
|
|
|
|
unsigned int hidecallerid;
|
|
|
|
|
unsigned int ignoredtmf:1;
|
|
|
|
|
unsigned int immediate:1; /* Answer before getting digits? */
|
|
|
|
|
unsigned int inalarm:1;
|
|
|
|
|
unsigned int mate:1; /* flag to say its in MATE mode */
|
|
|
|
|
unsigned int outgoing:1;
|
|
|
|
|
unsigned int overlapdial:1;
|
|
|
|
|
unsigned int permcallwaiting:1;
|
|
|
|
|
unsigned int permhidecallerid:1; /* Whether to hide our outgoing caller ID or not */
|
|
|
|
|
unsigned int priindication_oob:1;
|
|
|
|
|
unsigned int pulse:1;
|
|
|
|
|
unsigned int pulsedial:1; /* whether a pulse dial phone is detected */
|
|
|
|
|
unsigned int restrictcid:1; /* Whether restrict the callerid -> only send ANI */
|
|
|
|
|
unsigned int threewaycalling:1;
|
|
|
|
|
unsigned int transfer:1;
|
|
|
|
|
unsigned int use_callerid:1; /* Whether or not to use caller id on this channel */
|
|
|
|
|
unsigned int use_callingpres:1; /* Whether to use the callingpres the calling switch sends */
|
|
|
|
|
unsigned int usedistinctiveringdetection:1;
|
|
|
|
|
unsigned int zaptrcallerid:1; /* should we use the callerid from incoming call on zap transfer or not */
|
|
|
|
|
#if defined(ZAPATA_PRI)
|
|
|
|
|
unsigned int alerting:1;
|
|
|
|
|
unsigned int alreadyhungup:1;
|
|
|
|
|
unsigned int isidlecall:1;
|
|
|
|
|
unsigned int resetting:1;
|
|
|
|
|
unsigned int setup_ack:1;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(ZAPATA_R2)
|
|
|
|
|
unsigned int hasr2call:1;
|
|
|
|
|
unsigned int r2blocked:1;
|
|
|
|
|
unsigned int sigchecked:1;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct zt_distRings drings;
|
|
|
|
|
int usedistinctiveringdetection;
|
|
|
|
|
|
|
|
|
|
char context[AST_MAX_EXTENSION];
|
|
|
|
|
char defcontext[AST_MAX_EXTENSION];
|
|
|
|
@ -530,20 +582,11 @@ static struct zt_pvt {
|
|
|
|
|
int propconfno; /* Propagated conference number */
|
|
|
|
|
ast_group_t callgroup;
|
|
|
|
|
ast_group_t pickupgroup;
|
|
|
|
|
int immediate; /* Answer before getting digits? */
|
|
|
|
|
int channel; /* Channel Number or CRV */
|
|
|
|
|
int span; /* Span number */
|
|
|
|
|
int dialing;
|
|
|
|
|
time_t guardtime; /* Must wait this much time before using for new call */
|
|
|
|
|
int dialednone;
|
|
|
|
|
int use_callerid; /* Whether or not to use caller id on this channel */
|
|
|
|
|
int cid_signalling; /* CID signalling type bell202 or v23 */
|
|
|
|
|
int cid_start; /* CID start indicator, polarity or ring */
|
|
|
|
|
int hidecallerid;
|
|
|
|
|
int callreturn;
|
|
|
|
|
int permhidecallerid; /* Whether to hide our outgoing caller ID or not */
|
|
|
|
|
int restrictcid; /* Whether restrict the callerid -> only send ANI */
|
|
|
|
|
int use_callingpres; /* Whether to use the callingpres the calling switch sends */
|
|
|
|
|
int callingpres; /* The value of callling presentation that we're going to use when placing a PRI call */
|
|
|
|
|
int callwaitingrepeat; /* How many samples to wait before repeating call waiting */
|
|
|
|
|
int cidcwexpire; /* When to expire our muting for CID/CW */
|
|
|
|
@ -552,63 +595,32 @@ static struct zt_pvt {
|
|
|
|
|
int cidlen;
|
|
|
|
|
int ringt;
|
|
|
|
|
int stripmsd;
|
|
|
|
|
int callwaiting;
|
|
|
|
|
int callwaitcas;
|
|
|
|
|
int callwaitrings;
|
|
|
|
|
int echocancel;
|
|
|
|
|
int echotraining;
|
|
|
|
|
int pulse;
|
|
|
|
|
int echocanbridged;
|
|
|
|
|
int echocanon;
|
|
|
|
|
int echobreak;
|
|
|
|
|
char echorest[20];
|
|
|
|
|
int permcallwaiting;
|
|
|
|
|
int callwaitingcallerid;
|
|
|
|
|
int threewaycalling;
|
|
|
|
|
int transfer;
|
|
|
|
|
int canpark;
|
|
|
|
|
int digital;
|
|
|
|
|
int outgoing;
|
|
|
|
|
int dnd;
|
|
|
|
|
int busydetect;
|
|
|
|
|
int busycount;
|
|
|
|
|
int callprogress;
|
|
|
|
|
int priindication_oob;
|
|
|
|
|
struct timeval flashtime; /* Last flash-hook time */
|
|
|
|
|
struct ast_dsp *dsp;
|
|
|
|
|
int cref; /* Call reference number */
|
|
|
|
|
ZT_DIAL_OPERATION dop;
|
|
|
|
|
int whichwink; /* SIG_FEATDMF_TA Which wink are we on? */
|
|
|
|
|
char finaldial[64];
|
|
|
|
|
int destroy;
|
|
|
|
|
int ignoredtmf;
|
|
|
|
|
int inalarm;
|
|
|
|
|
char accountcode[AST_MAX_ACCOUNT_CODE]; /* Account code */
|
|
|
|
|
int amaflags; /* AMA Flags */
|
|
|
|
|
char didtdd; /* flag to say its done it once */
|
|
|
|
|
struct tdd_state *tdd; /* TDD flag */
|
|
|
|
|
int adsi;
|
|
|
|
|
int cancallforward;
|
|
|
|
|
char call_forward[AST_MAX_EXTENSION];
|
|
|
|
|
char mailbox[AST_MAX_EXTENSION];
|
|
|
|
|
char dialdest[256];
|
|
|
|
|
int onhooktime;
|
|
|
|
|
int msgstate;
|
|
|
|
|
|
|
|
|
|
int confirmanswer; /* Wait for '#' to confirm answer */
|
|
|
|
|
int distinctivering; /* Which distinctivering to use */
|
|
|
|
|
int cidrings; /* Which ring to deliver CID on */
|
|
|
|
|
|
|
|
|
|
int faxhandled; /* Has a fax tone already been handled? */
|
|
|
|
|
|
|
|
|
|
char mate; /* flag to say its in MATE mode */
|
|
|
|
|
int pulsedial; /* whether a pulse dial phone is detected */
|
|
|
|
|
int dtmfrelax; /* whether to run in relaxed DTMF mode */
|
|
|
|
|
int fake_event;
|
|
|
|
|
int zaptrcallerid; /* should we use the callerid from incoming call on zap transfer or not */
|
|
|
|
|
int emdigitwait;
|
|
|
|
|
int answeronpolarityswitch;
|
|
|
|
|
int hanguponpolarityswitch;
|
|
|
|
|
int polarityonanswerdelay;
|
|
|
|
|
struct timeval polaritydelaytv;
|
|
|
|
|
int sendcalleridafter;
|
|
|
|
@ -617,24 +629,17 @@ static struct zt_pvt {
|
|
|
|
|
struct zt_pvt *bearer;
|
|
|
|
|
struct zt_pvt *realcall;
|
|
|
|
|
q931_call *call;
|
|
|
|
|
int isidlecall;
|
|
|
|
|
int resetting;
|
|
|
|
|
int prioffset;
|
|
|
|
|
int logicalspan;
|
|
|
|
|
int alreadyhungup;
|
|
|
|
|
int proceeding;
|
|
|
|
|
int alerting;
|
|
|
|
|
int setup_ack; /* whether we received SETUP_ACKNOWLEDGE or not */
|
|
|
|
|
int dsp_features;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZAPATA_R2
|
|
|
|
|
int r2prot;
|
|
|
|
|
mfcr2_t *r2;
|
|
|
|
|
int hasr2call;
|
|
|
|
|
int r2blocked;
|
|
|
|
|
int sigchecked;
|
|
|
|
|
#endif
|
|
|
|
|
int polarity;
|
|
|
|
|
|
|
|
|
|
} *iflist = NULL, *ifend = NULL;
|
|
|
|
|
|
|
|
|
|
static struct ast_channel *zt_request(const char *type, int format, void *data, int *cause);
|
|
|
|
@ -4209,7 +4214,7 @@ struct ast_frame *zt_read(struct ast_channel *ast)
|
|
|
|
|
p->subs[index].linear = 0;
|
|
|
|
|
res = zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
|
|
|
|
|
if (res)
|
|
|
|
|
ast_log(LOG_WARNING, "Unable to set channel %d (index %d) to campanded mode.\n", p->channel, index);
|
|
|
|
|
ast_log(LOG_WARNING, "Unable to set channel %d (index %d) to companded mode.\n", p->channel, index);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
ast_log(LOG_WARNING, "Don't know how to read frames in format %s\n", ast_getformatname(ast->rawreadformat));
|
|
|
|
|