summaryrefslogtreecommitdiffstats
path: root/mISDN.cpp
diff options
context:
space:
mode:
authorSuper User2008-03-24 11:13:44 +0100
committerSuper User2008-03-24 11:13:44 +0100
commitd9d954e58d6acf8c3de95402110e691f0bc29688 (patch)
treef17628b6953b4afd485385e38a80e77f835d4373 /mISDN.cpp
parentfixed dialtone bug (diff)
downloadlcr-d9d954e58d6acf8c3de95402110e691f0bc29688.tar.gz
lcr-d9d954e58d6acf8c3de95402110e691f0bc29688.tar.xz
lcr-d9d954e58d6acf8c3de95402110e691f0bc29688.zip
socket api work
modified: apppbx.cpp modified: cause.c modified: dss1.cpp modified: dss1.h modified: ie.cpp modified: interface.c modified: mISDN.cpp modified: mISDN.h modified: main.c modified: main.h modified: message.c modified: options.c modified: port.cpp modified: q931.h modified: route.c modified: socket_server.c modified: tones.c
Diffstat (limited to 'mISDN.cpp')
-rw-r--r--mISDN.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/mISDN.cpp b/mISDN.cpp
index 1583211..75cdadf 100644
--- a/mISDN.cpp
+++ b/mISDN.cpp
@@ -96,18 +96,19 @@ int mISDN_initialize(void)
return(-1);
}
- /* initialize stuff of the NT lib */
+ /* open debug, if enabled and not only stack debugging */
+ if (options.deb && (options.deb != DEBUG_STACK))
+ {
+ SPRINT(debug_log, "%s/debug.log", INSTALL_DATA);
+ debug_fp = fopen(debug_log, "a");
+ }
+
if (options.deb & DEBUG_STACK)
{
- global_debug = 0xffffffff & ~DBGM_MSG;
-// global_debug = DBGM_L3DATA;
+ SPRINT(debug_stack, "%s/debug_mISDN.log", INSTALL_DATA);
+ mISDN_debug_init(DBGM_ALL, debug_stack, debug_stack, debug_stack);
} else
- global_debug = DBGM_MAN;
- SPRINT(debug_log, "%s/debug.log", INSTALL_DATA);
- if (options.deb & DEBUG_LOG)
- mISDN_debug_init(global_debug, debug_log, debug_log, debug_log);
- else
- mISDN_debug_init(global_debug, NULL, NULL, NULL);
+ mISDN_debug_init(0, NULL, NULL, NULL);
/* init mlayer3 */
init_layer3(4); // buffer of 4
@@ -121,6 +122,10 @@ void mISDN_deinitialize(void)
mISDN_debug_close();
+ if (debug_fp)
+ fclose(debug_fp);
+ debug_fp = NULL;
+
if (mISDNsocket > -1)
close(mISDNsocket);
}
@@ -182,6 +187,7 @@ void mISDN_deinitialize(void)
unsigned char buff[1025];
debug_close();
+ global_debug = 0;
if (mISDNdevice >= 0)
{
@@ -2473,6 +2479,15 @@ int mISDN_handler(void)
if (!mISDNport)
{
PERROR("message belongs to no mISDNport: prim(0x%x) addr(0x%x) msg->len(%d)\n", frm->prim, frm->addr, msg->len);
+ // show a list of all mISDNports and their address
+#if 0
+ mISDNport = mISDNport_first;
+ while(mISDNport)
+ {
+ PERROR(" port %s %x -> %x\n", mISDNport->name, (frm->addr&MASTER_ID_MASK), (unsigned int)(mISDNport->upper_id&MASTER_ID_MASK));
+ mISDNport = mISDNport->next;
+ }
+#endif
goto out;
}