#define SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */
-#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
static const char *lbostr[] = {
"0 db (CSU)/0-133 feet (DSX-1)",
"133-266 feet (DSX-1)",
"-15db (CSU)",
"-22.5db (CSU)"
};
-#endif
/*! Global jitterbuffer configuration - by default, jb is disabled */
static struct ast_jb_conf default_jbconf =
unsigned int needunhold:1;
unsigned int linear:1;
unsigned int inthreeway:1;
- DAHDI_CONFINFO curconf;
+ struct dahdi_confinfo curconf;
};
#define CONF_USER_REAL (1 << 0)
struct timeval flashtime; /*!< Last flash-hook time */
struct ast_dsp *dsp;
int cref; /*!< Call reference number */
- DAHDI_DIAL_OPERATION dop;
+ struct dahdi_dialoperation dop;
int whichwink; /*!< SIG_FEATDMF_TA Which wink are we on? */
char finaldial[64];
char accountcode[AST_MAX_ACCOUNT_CODE]; /*!< Account code */
#ifdef HAVE_SS7
struct dahdi_ss7 ss7;
#endif
- DAHDI_PARAMS timing;
+ struct dahdi_params timing;
int is_sig_auto; /*!< Use channel signalling from DAHDI? */
char smdi_port[SMDI_MAX_FILENAME_LEN];
static int alloc_sub(struct dahdi_pvt *p, int x)
{
- DAHDI_BUFFERINFO bi;
+ struct dahdi_bufferinfo bi;
int res;
if (p->subs[x].zfd >= 0) {
ast_log(LOG_WARNING, "%s subchannel of %d already in use\n", subnames[x], p->channel);
if (pvt->pulse || ioctl(pvt->subs[SUB_REAL].zfd, DAHDI_SENDTONE, &dtmf)) {
int res;
- DAHDI_DIAL_OPERATION zo = {
+ struct dahdi_dialoperation zo = {
.op = DAHDI_DIAL_OP_APPEND,
};
{
/* If the conference already exists, and we're already in it
don't bother doing anything */
- DAHDI_CONFINFO zi;
+ struct dahdi_confinfo zi;
memset(&zi, 0, sizeof(zi));
zi.chan = 0;
static int conf_del(struct dahdi_pvt *p, struct dahdi_subchannel *c, int index)
{
- DAHDI_CONFINFO zi;
+ struct dahdi_confinfo zi;
if (/* Can't delete if there's no zfd */
(c->zfd < 0) ||
/* Don't delete from the conference if it's not our conference */
static int reset_conf(struct dahdi_pvt *p)
{
- DAHDI_CONFINFO zi;
+ struct dahdi_confinfo zi;
memset(&zi, 0, sizeof(zi));
p->confno = -1;
memset(&p->subs[SUB_REAL].curconf, 0, sizeof(p->subs[SUB_REAL].curconf));
struct dahdi_pvt *p = ast->tech_pvt;
struct dahdi_pvt *tmp = NULL;
struct dahdi_pvt *prev = NULL;
- DAHDI_PARAMS par;
+ struct dahdi_params par;
ast_debug(1, "dahdi_hangup(%s)\n", ast->name);
if (!ast->tech_pvt) {
static void disable_dtmf_detect(struct dahdi_pvt *p)
{
-#ifdef DAHDI_TONEDETECT
int val;
-#endif
p->ignoredtmf = 1;
-#ifdef DAHDI_TONEDETECT
val = 0;
ioctl(p->subs[SUB_REAL].zfd, DAHDI_TONEDETECT, &val);
-#endif
+
if (!p->hardwaredtmf && p->dsp) {
p->dsp_features &= ~DSP_FEATURE_DIGIT_DETECT;
ast_dsp_set_features(p->dsp, p->dsp_features);
static void enable_dtmf_detect(struct dahdi_pvt *p)
{
-#ifdef DAHDI_TONEDETECT
int val;
-#endif
if (p->channel == CHAN_PSEUDO)
return;
p->ignoredtmf = 0;
-#ifdef DAHDI_TONEDETECT
val = DAHDI_TONEDETECT_ON | DAHDI_TONEDETECT_MUTE;
ioctl(p->subs[SUB_REAL].zfd, DAHDI_TONEDETECT, &val);
-#endif
+
if (!p->hardwaredtmf && p->dsp) {
p->dsp_features |= DSP_FEATURE_DIGIT_DETECT;
ast_dsp_set_features(p->dsp, p->dsp_features);
static int check_for_conference(struct dahdi_pvt *p)
{
- DAHDI_CONFINFO ci;
+ struct dahdi_confinfo ci;
/* Fine if we already have a master, etc */
if (p->master || (p->confno > -1))
return 0;
static int get_alarms(struct dahdi_pvt *p)
{
int res;
- DAHDI_SPANINFO zi;
+ struct dahdi_spaninfo zi;
struct dahdi_params params;
memset(&zi, 0, sizeof(zi));
}
switch (res) {
-#ifdef DAHDI_EVENT_EC_DISABLED
case DAHDI_EVENT_EC_DISABLED:
ast_verb(3, "Channel %d echo canceler disabled due to CED detection\n", p->channel);
p->echocanon = 0;
break;
-#endif
case DAHDI_EVENT_BITSCHANGED:
ast_log(LOG_WARNING, "Recieved bits changed on %s signalling?\n", sig2str(p->sig));
case DAHDI_EVENT_PULSE_START:
ast_log(LOG_WARNING, "Don't know how to handle ring/off hook for signalling %d\n", p->sig);
}
break;
-#ifdef DAHDI_EVENT_RINGBEGIN
case DAHDI_EVENT_RINGBEGIN:
switch (p->sig) {
case SIG_FXSLS:
break;
}
break;
-#endif
case DAHDI_EVENT_RINGEROFF:
if (p->inalarm) break;
if ((p->radio || (p->oprmode < 0))) break;
/* make sure it sends initial key state as first frame */
if ((p->radio || (p->oprmode < 0)) && (!p->firstradio))
{
- DAHDI_PARAMS ps;
+ struct dahdi_params ps;
ps.channo = p->channel;
if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &ps) < 0) {
int features;
struct ast_str *chan_name;
struct ast_variable *v;
- DAHDI_PARAMS ps;
+ struct dahdi_params ps;
if (i->subs[index].owner) {
ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
return NULL;
(i->outgoing && (i->callprogress & CALLPROGRESS_FAX_OUTGOING))) {
features |= DSP_FEATURE_FAX_DETECT;
}
-#ifdef DAHDI_TONEDETECT
x = DAHDI_TONEDETECT_ON | DAHDI_TONEDETECT_MUTE;
if (ioctl(i->subs[index].zfd, DAHDI_TONEDETECT, &x)) {
-#endif
i->hardwaredtmf = 0;
features |= DSP_FEATURE_DIGIT_DETECT;
-#ifdef DAHDI_TONEDETECT
} else if (NEED_MFDETECT(i)) {
i->hardwaredtmf = 1;
features |= DSP_FEATURE_DIGIT_DETECT;
}
-#endif
}
if (features) {
if (i->dsp) {
ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
if (p->cid_signalling == CID_SIG_V23_JP) {
-#ifdef DAHDI_EVENT_RINGBEGIN
if (res == DAHDI_EVENT_RINGBEGIN) {
res = dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
usleep(1);
}
-#endif
} else {
res = 0;
break;
res = dahdi_get_event(mtd->pvt->subs[SUB_REAL].zfd);
switch (res) {
-#ifdef HAVE_DAHDI_NEONMWI
case DAHDI_EVENT_NEONMWI_ACTIVE:
case DAHDI_EVENT_NEONMWI_INACTIVE:
-#endif
case DAHDI_EVENT_NONE:
case DAHDI_EVENT_BITSCHANGED:
break;
i->channel);
dahdi_destroy_channel_bynum(i->channel);
break;
-#ifdef HAVE_DAHDI_NEONMWI
case DAHDI_EVENT_NEONMWI_ACTIVE:
if (i->mwimonitor_neon) {
notify_message(i->mailbox, 1);
ast_log(LOG_NOTICE, "NEON MWI cleared for channel %d, mailbox %s\n", i->channel, i->mailbox);
}
break;
-#endif
}
return thread_spawned;
}
pthread_attr_t attr;
pthread_t threadid;
struct mwi_thread_data *mtd;
-#ifdef DAHDI_VMWI
res2 = ioctl(last->subs[SUB_REAL].zfd, DAHDI_VMWI, res);
if (res2) {
ast_log(LOG_DEBUG, "Unable to control message waiting led on channel %d: %s\n", last->channel, strerror(errno));
}
-#endif
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if ((mtd = ast_calloc(1, sizeof(*mtd)))) {
static int pri_create_trunkgroup(int trunkgroup, int *channels)
{
struct dahdi_spaninfo si;
- DAHDI_PARAMS p;
+ struct dahdi_params p;
int fd;
int span;
int ospan=0;
int x;
struct dahdi_pvt **wlist;
struct dahdi_pvt **wend;
- DAHDI_PARAMS p;
+ struct dahdi_params p;
wlist = &iflist;
wend = &ifend;
static inline int available(struct dahdi_pvt *p, int channelmatch, ast_group_t groupmatch, int *busy, int *channelmatched, int *groupmatched)
{
int res;
- DAHDI_PARAMS par;
+ struct dahdi_params par;
/* First, check group matching */
if (groupmatch) {
if (par.rxisoffhook)
return 1;
else
-#ifdef DAHDI_CHECK_HOOKSTATE
return 0;
-#else
- return 1;
-#endif
} else if (par.rxisoffhook) {
ast_debug(1, "Channel %d off hook, can't use\n", p->channel);
/* Not available when the other end is off hook */
static struct dahdi_pvt *chandup(struct dahdi_pvt *src)
{
struct dahdi_pvt *p;
- DAHDI_BUFFERINFO bi;
+ struct dahdi_bufferinfo bi;
int res;
if ((p = ast_malloc(sizeof(*p)))) {
int x;
int span = PRI_SPAN(channel);
int spanfd;
- DAHDI_PARAMS param;
+ struct dahdi_params param;
int principle = -1;
int explicit = PRI_EXPLICIT(channel);
channel = PRI_CHANNEL(channel);
static int start_pri(struct dahdi_pri *pri)
{
int res, x;
- DAHDI_PARAMS p;
- DAHDI_BUFFERINFO bi;
+ struct dahdi_params p;
+ struct dahdi_bufferinfo bi;
struct dahdi_spaninfo si;
int i;
{
int channel;
struct dahdi_pvt *tmp = NULL;
- DAHDI_CONFINFO ci;
- DAHDI_PARAMS ps;
+ struct dahdi_confinfo ci;
+ struct dahdi_params ps;
int x;
ast_mutex_t *lock;
struct dahdi_pvt *start;
if (!ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GETCONF, &ci)) {
ast_cli(a->fd, "Actual Confinfo: Num/%d, Mode/0x%04x\n", ci.confno, ci.confmode);
}
-#ifdef DAHDI_GETCONFMUTE
if (!ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GETCONFMUTE, &x)) {
ast_cli(a->fd, "Actual Confmute: %s\n", x ? "Yes" : "No");
}
-#endif
if (ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &ps) < 0) {
ast_log(LOG_WARNING, "Failed to get parameters on channel %d: %s\n", tmp->channel, strerror(errno));
} else {
/* Based on irqmiss.c */
static char *dahdi_show_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
-#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
#define FORMAT "%-40.40s %-7.7s %-6d %-6d %-6d %-3.3s %-4.4s %-8.8s %s\n"
#define FORMAT2 "%-40.40s %-7.7s %-6.6s %-6.6s %-6.6s %-3.3s %-4.4s %-8.8s %s\n"
-#else
- #define FORMAT "%-40.40s %-10.10s %-10d %-10d %-10d\n"
- #define FORMAT2 "%-40.40s %-10.10s %-10.10s %-10.10s %-10.10s\n"
-#endif
int span;
int res;
char alarms[50];
int ctl;
- DAHDI_SPANINFO s;
+ struct dahdi_spaninfo s;
switch (cmd) {
case CLI_INIT:
ast_cli(a->fd, "No DAHDI found. Unable to open /dev/dahdi/ctl: %s\n", strerror(errno));
return CLI_FAILURE;
}
- ast_cli(a->fd, FORMAT2, "Description", "Alarms", "IRQ", "bpviol", "CRC4"
-#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
- , "Framing", "Coding", "Options", "LBO"
-#endif
- );
+ ast_cli(a->fd, FORMAT2, "Description", "Alarms", "IRQ", "bpviol", "CRC4", "Framing", "Coding", "Options", "LBO");
for (span = 1; span < DAHDI_MAX_SPANS; ++span) {
s.spanno = span;
}
ast_cli(a->fd, FORMAT, s.desc, alarms, s.irqmisses, s.bpvcount, s.crc4count
-#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
, s.lineconfig & DAHDI_CONFIG_D4 ? "D4" :
s.lineconfig & DAHDI_CONFIG_ESF ? "ESF" :
s.lineconfig & DAHDI_CONFIG_CCS ? "CCS" :
, s.lineconfig & DAHDI_CONFIG_CRC4 ?
s.lineconfig & DAHDI_CONFIG_NOTOPEN ? "CRC4/YEL" : "CRC4" : "YEL"
, lbostr[s.lbo]
-#endif
);
}
close(ctl);
struct dahdi_ss7 *link;
int res;
int curfd;
- DAHDI_PARAMS p;
- DAHDI_BUFFERINFO bi;
+ struct dahdi_params p;
+ struct dahdi_bufferinfo bi;
struct dahdi_spaninfo si;
* AST_MODULE_INFO(, , "DAHDI Telephony"
*/
-#ifdef DAHDI_PRI
+#ifdef HAVE_PRI
+#ifdef HAVE_SS7
+#define tdesc "DAHDI Telephony w/PRI & SS7"
+#else
#define tdesc "DAHDI Telephony w/PRI"
+#endif
+#else
+#ifdef HAVE_SS7
+#define tdesc "DAHDI Telephony w/SS7"
#else
#define tdesc "DAHDI Telephony"
#endif
+#endif
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
.load = load_module,