static void adsi_begin(struct ast_channel *chan, int *useadsi)
{
int x;
- if(!strcasecmp(chan->type, "sip")){
- *useadsi = 0;
+ if (!adsi_available(chan))
return;
- }
-
x = adsi_load_session(chan, adapp, adver, 1);
if (x < 0)
return;
{
char buf[256];
int bytes=0;
- if(!strcasecmp(chan->type, "sip")){
- return;
- }
+
if (!adsi_available(chan))
return;
bytes += adsi_logo(buf + bytes);
static int busydetect = 0;
+static int busycount = 3;
+
static int callprogress = 0;
static char accountcode[20] = "";
int outgoing;
int dnd;
int busydetect;
+ int busycount;
int callprogress;
struct ast_dsp *dsp;
int cref; /* Call reference number */
if (i->dsp) {
ast_dsp_set_features(i->dsp, features);
ast_dsp_digitmode(i->dsp, DSP_DIGITMODE_DTMF | i->dtmfrelax);
+ if (i->busydetect && CANBUSYDETECT(i)) {
+ ast_dsp_set_busy_count(i->dsp, i->busycount);
+ }
}
}
}
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
break;
+ } else if (strlen(p->lastcallerid) && !strcmp(exten, "*80")) {
+ if (option_verbose > 2)
+ ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcallerid);
+ res = ast_db_put("blacklist", p->lastcallerid, "1");
+ if (!res) {
+ res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ memset(exten, 0, sizeof(exten));
+ len = 0;
+ }
} else if (p->hidecallerid && !strcmp(exten, "*82")) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
tmp->echocancel = echocancel;
tmp->echocanbridged = echocanbridged;
tmp->busydetect = busydetect;
+ tmp->busycount = busycount;
tmp->callprogress = callprogress;
tmp->cancallforward = cancallforward;
tmp->dtmfrelax = relaxdtmf;
echocanbridged = ast_true(v->value);
} else if (!strcasecmp(v->name, "busydetect")) {
busydetect = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "busycount")) {
+ busycount = atoi(v->value);
} else if (!strcasecmp(v->name, "callprogress")) {
callprogress = ast_true(v->value);
} else if (!strcasecmp(v->name, "echocancel")) {
stripmsd = 0;
callwaiting = 0;
busydetect = 0;
+ busycount = 3;
callprogress = 0;
callwaitingcallerid = 0;
hidecallerid = 0;
transfer = ast_true(v->value);
} else if (!strcasecmp(v->name, "busydetect")) {
busydetect = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "busycount")) {
+ busycount = atoi(v->value);
} else if (!strcasecmp(v->name, "callprogress")) {
callprogress = ast_true(v->value);
} else if (!strcasecmp(v->name, "hidecallerid")) {
struct sockaddr_in sin;
int sinlen;
struct mansession *s;
+ pthread_attr_t attr;
+
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
for (;;) {
sinlen = sizeof(sin);
as = accept(asock, &sin, &sinlen);
s->next = sessions;
sessions = s;
ast_pthread_mutex_unlock(&sessionlock);
- if (pthread_create(&t, NULL, session_do, s))
+ if (pthread_create(&t, &attr, session_do, s))
destroy_session(s);
}
+ pthread_attr_destroy(&attr);
return NULL;
}