/* open debug, if enabled and not only stack debugging */
if (options.deb)
{
- SPRINT(filename, "%s/debug.log", INSTALL_DATA);
+ SPRINT(filename, "%s/debug.log", LOG_DIR);
debug_fp = fopen(filename, "a");
}
if (options.deb & DEBUG_STACK)
{
- SPRINT(filename, "%s/debug_mISDN.log", INSTALL_DATA);
+ SPRINT(filename, "%s/debug_mISDN.log", LOG_DIR);
mISDN_debug_init(0xffffffff, filename, filename, filename);
} else
mISDN_debug_init(0, NULL, NULL, NULL);
ret = bind(mISDNport->b_socket[i], (struct sockaddr *)&addr, sizeof(addr));
if (ret < 0)
{
- PERROR("Error: Failed to bind bchannel-socket for index %d with mISDN-DSP layer. Did you load mISDN_dsp.ko?\n", i);
+ PERROR("Error: Failed to bind bchannel-socket for index %d with mISDN-DSP layer (errno=%d). Did you load mISDN_dsp.ko?\n", i, errno);
close(mISDNport->b_socket[i]);
mISDNport->b_socket[i] = -1;
return(0);
*/
void PmISDN::set_tone(const char *dir, const char *tone)
{
- int id;
+ int id = TONE_OFF;
if (!tone)
tone = "";
l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_IND, DIRECTION_IN);
add_trace("tei", NULL, "%d", l3m->pid);
end_trace();
+ mISDNport->l2link = 1;
if ((!mISDNport->ntmode || mISDNport->ptp) && l3m->pid < 127)
{
if (mISDNport->l2establish)
mISDNport->l2establish = 0;
PDEBUG(DEBUG_ISDN, "the link became active before l2establish timer expiry.\n");
}
- mISDNport->l2link = 1;
}
break;
l1l2l3_trace_header(mISDNport, NULL, L2_RELEASE_IND, DIRECTION_IN);
add_trace("tei", NULL, "%d", l3m->pid);
end_trace();
+ /* down if not nt-ptmp */
+ if (!mISDNport->ntmode || mISDNport->ptp)
+ mISDNport->l2link = 0;
}
if ((!mISDNport->ntmode || mISDNport->ptp) && l3m->pid < 127)
{
- mISDNport->l2link = 0;
if (!mISDNport->l2establish && mISDNport->l2hold)
{
PDEBUG(DEBUG_ISDN, "set timer and establish.\n");
/*
* global function to add a new card (port)
*/
-struct mISDNport *mISDNport_open(int port, char *portname, int ptp, int force_nt, int l2hold, struct interface *interface)
+struct mISDNport *mISDNport_open(int port, char *portname, int ptp, int force_nt, int te_special, int l2hold, struct interface *interface)
{
int ret;
struct mISDNport *mISDNport, **mISDNportp;
mISDNportp = &((*mISDNportp)->next);
mISDNport = (struct mISDNport *)MALLOC(sizeof(struct mISDNport));
mISDNport->l1link = -1;
+ mISDNport->l2link = -1;
pmemuse++;
*mISDNportp = mISDNport;
mISDNport->b_num = devinfo.nrbchan;
mISDNport->portnum = port;
mISDNport->ntmode = nt;
+ mISDNport->tespecial = te_special;
mISDNport->pri = pri;
mISDNport->ptp = ptp;
mISDNport->l2hold = l2hold;
time(&mISDNport->l2establish);
}
- /* initially, we assume that the link is down, exept for nt-ptmp */
- mISDNport->l2link = (mISDNport->ntmode && !mISDNport->ptp)?1:0;
+ /* for nt-mode ptmp the link is always up */
+ if (mISDNport->ntmode && !mISDNport->ptp)
+ mISDNport->l2link = 1;
PDEBUG(DEBUG_BCHANNEL, "using 'mISDN_dsp.o' module\n");