modified: mISDN.cpp
modified: main.c
/* allocate ressources of port */
#ifdef SOCKET_MISDN
/* allocate ressources of port */
#ifdef SOCKET_MISDN
+ /* open layer 3 and init upqueue */
protocol = (nt)?L3_PROTOCOL_DSS1_USER:L3_PROTOCOL_DSS1_NET;
prop = 0;
if (ptp) // ptp forced
protocol = (nt)?L3_PROTOCOL_DSS1_USER:L3_PROTOCOL_DSS1_NET;
prop = 0;
if (ptp) // ptp forced
mISDNport->ml3 = open_layer3(port-1, protocol, prop , do_layer3, mISDNport);
if (!mISDNport->ml3)
{
mISDNport->ml3 = open_layer3(port-1, protocol, prop , do_layer3, mISDNport);
if (!mISDNport->ml3)
{
- PERROR_RUNTIME("Cannot get layer(%d) id of port %d\n", nt?2:4, port);
+ PERROR_RUNTIME("oper_layer3() failed for port %d\n", port);
+ mISDNport_close(mISDNport);
+ mqueue_init(&mISDNport->upqueue);
#if 0
/* if ntmode, establish L1 to send the tei removal during start */
#if 0
/* if ntmode, establish L1 to send the tei removal during start */
-#ifdef SOCKET_MISDN
- /* init stack queue */
- mqueue_init(&mISDNport->upqueue);
-#endif
-
/* initially, we assume that the link is down, exept for nt-ptmp */
mISDNport->l2link = (mISDNport->ntmode && !mISDNport->ptp)?1:0;
/* initially, we assume that the link is down, exept for nt-ptmp */
mISDNport->l2link = (mISDNport->ntmode && !mISDNport->ptp)?1:0;
- close_layer3(mISDNport->ml3);
- mqueue_purge(&mISDNport->upqueue);
+ /* close layer 3, if open and purge upqueue */
+ if (mISDNport->ml3)
+ {
+ close_layer3(mISDNport->ml3);
+ mqueue_purge(&mISDNport->upqueue);
+ }
#else
/* free ressources of port */
msg_queue_purge(&mISDNport->downqueue);
#else
/* free ressources of port */
msg_queue_purge(&mISDNport->downqueue);
/* set scheduler & priority */
if (options.schedule > 1)
{
/* set scheduler & priority */
if (options.schedule > 1)
{
sched_setscheduler(0, SCHED_OTHER, &schedp);
}
fprintf(stderr, "LCR: Signal received: %d\n", sigset);
sched_setscheduler(0, SCHED_OTHER, &schedp);
}
fprintf(stderr, "LCR: Signal received: %d\n", sigset);
- PERROR("Signal received: %d\n", sigset);
+ PDEBUG(DEBUG_LOG, "Signal received: %d\n", sigset);
SPRINT(tracetext, "%s terminated", NAME);
printf("%s\n", tracetext);
start_trace(0, NULL, NULL, NULL, 0, 0, 0, tracetext);
SPRINT(tracetext, "%s terminated", NAME);
printf("%s\n", tracetext);
start_trace(0, NULL, NULL, NULL, 0, 0, 0, tracetext);
- if (ret)
- add_trace("error", NULL, "%d", ret);
+ if (quit)
+ add_trace("signal", NULL, "%d", quit);