1 /*****************************************************************************\
3 ** Linux Call Router **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
8 ** Header file for defining fixed values for the current version **
10 \*****************************************************************************/
25 #include <sys/types.h>
28 #include <sys/ioctl.h>
31 #include <sys/resource.h>
35 #define DEFAULT_ENDPOINT_APP EndpointAppPBX
37 #define VERSION_STRING "0.5 (Spring 2007)"
50 //extern pthread_mutex_t mutex_lcr; // lcr process mutex
53 extern FILE *debug_fp;
55 extern int global_debug;
58 #define PDEBUG(mask, fmt, arg...) _printdebug(__FUNCTION__, __LINE__, mask, fmt, ## arg)
59 #define PERROR(fmt, arg...) _printerror(__FUNCTION__, __LINE__, fmt, ## arg)
60 #define PDEBUG_RUNTIME(mask, fmt, arg...) _printdebug(NULL, 0, mask, fmt, ## arg)
61 #define PERROR_RUNTIME(fmt, arg...) _printerror(NULL, 0, fmt, ## arg)
62 void _printdebug(const char *function, int line, unsigned long mask, const char *fmt, ...);
63 void _printerror(const char *function, int line, const char *fmt, ...);
65 void debug(const char *function, int line, char *prefix, char *buffer);
67 #define DEBUG_CONFIG 0x0001
68 #define DEBUG_MSG 0x0002
69 #define DEBUG_STACK 0x0004
70 #define DEBUG_BCHANNEL 0x0008
71 #define DEBUG_PORT 0x0100
72 #define DEBUG_ISDN 0x0110
73 //#define DEBUG_KNOCK 0x0140
74 #define DEBUG_VBOX 0x0180
75 #define DEBUG_EPOINT 0x0200
76 #define DEBUG_JOIN 0x0400
77 #define DEBUG_VERSATEL 0x0800
78 #define DEBUG_CRYPT 0x1000
79 #define DEBUG_ROUTE 0x2000
80 #define DEBUG_IDLETIME 0x4000
81 #define DEBUG_LOG 0x7fff
83 // check any faulty malloc
84 #define MALLOC_CHECK_ 1
87 * one of the bits must be enabled in order to write log files
89 #define DEBUG_LOG 0x7fff
92 * load transmit buffer to avoid gaps at the beginning due to jitter
93 * also the maximum load that will be kept in tx-buffer
94 * also the (minimum) number of data to transmit in a frame
96 #define ISDN_LOAD 1024 // samples
97 #define ISDN_MAXLOAD 2048 // samples
99 /* give sendmail program. if not inside $PATH, give absolute path here (e.g. "/usr/sbin/sendmail")
101 #define SENDMAIL "sendmail"
103 /* leave it above 1024, because lower values can be unsafe, higher valuse cause
104 * data larger than 512 bytes of hex strings.
106 #define RSA_BITS 1536
108 /* 'goto' or 'menu' actions may cause infinite loops. they will be prevented by this limit.
109 * Also other recursions, like redialing the 'redial' action must be prevented.
110 * increase it ONLY IF you have a deeper tree of rule sets, than the value given here.
112 #define RULE_NESTING 10
114 /* to debug core bridging, rather than mISDN dsp bridging, enable.
115 * this is for debugging only, bridging conferences will not work
117 //#define DEBUG_COREBRIDGE
119 /* special debugging for buffer overflow bugs
120 * note: whenever a buffer gets strange values, the budetect function must
121 * be modified to detect the change of these values. whenever it is detected,
122 * an error message is given at budetect function.
124 //#define BUDETECT_DEF
127 #define BUDETECT budetect(__FILE__, __LINE__, __FUNCTION__);
128 void budetect(const char *file, int line, char *function);
137 #include <mISDNuser/isdn_net.h>
138 #include <mISDNuser/net_l3.h>
147 #include "interface.h"
148 #include "extension.h"
150 #include "endpoint.h"
151 #include "endpointapp.h"
153 #include "callerid.h"
161 #include "joinremote.h"
163 #include "alawulaw.h"
166 #include "socket_server.h"
171 extern struct tm *now_tm;
172 extern struct timeval now_tv;
173 extern struct timezone now_tz;
175 #define DIRECTION_NONE 0
176 #define DIRECTION_OUT 1
177 #define DIRECTION_IN 2
181 struct mISDNport *mISDNport;