File: Makefile.in

package info (click to toggle)
isdnutils 1:3.25+dfsg1-3.5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 18,188 kB
  • ctags: 12,236
  • sloc: ansic: 98,041; sh: 19,044; perl: 4,948; makefile: 3,145; cpp: 2,708; tcl: 22
file content (2226 lines) | stat: -rw-r--r-- 81,474 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
## $Id: Makefile.in,v 1.225 2008/08/31 10:49:38 keil Exp $
##
## ISDN accounting for isdn4linux.
##
## Copyright 1995 .. 2002 by Andreas Kool (akool@isdn4linux.de)
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
## $Log: Makefile.in,v $
## Revision 1.225  2008/08/31 10:49:38  keil
## - fix library directories
## - build without root permissions
##
## Revision 1.224  2007/01/05 04:23:57  tobiasb
## Made isdnrep and isdnrate buildable under cygwin. See ChangeLog for details.
##
## Revision 1.223  2006/07/03 19:47:51  tobiasb
## Fix in filelist generation for NO_UTF8=1.
##
## Revision 1.222  2006/02/12 16:16:36  tobiasb
## Support for pre-UTF8 systems. NO_UTF8=1 in makefile, Makefile.in or the make
## command line will convert the data files from UTF-8 to ISO-8859-1 (latin1)
## using iconv.  The distributed source data files in UTF-8 charset remain
## unchanged.  Without NO_UTF8 set, there shall be no changes at all.
##
## Revision 1.221  2006/02/05 02:44:04  tobiasb
## New version number 4.71.  Change in zone lookup.
##
## Revision 1.220  2006/01/15 15:08:55  keil
## fix some issues with newer gcc (mostly aliasing)
##
## Revision 1.219  2005/02/27 22:37:41  tobiasb
## Set version to 4.70.
## A brief and incomplete list of changes between versions 4.68 and 4.70:
## - new entries for parameter file: areacode, skipProv, ignoreUPD
## - new rate-file configuration option: provider skipping
## - several improvements in connection logging
## - new entry for isdn.conf: REPOTIONS
## - new command line options for isdnrep: -c -m -L -U -x
## - new manual pages: rate.conf(5) isdnbill(1)
## - improved table mode (-T) of isdnrate
## For a list of all changes: cvs diff -u -r isdnlog-4.68 -r isdnlog-4.70
##
## Revision 1.218  2005/02/23 14:33:38  tobiasb
## New feature: provider skipping.
## Certain providers can be completely ignored (skipped) when loading the
## rate-file.  The selection is done by Q: tags in rate.conf or by skipProv=
## in the parameter file.  The syntax is explained in the new manual page
## rate.conf(5).  Absurd settings for provider skipping may cause trouble.
## The version number will change to 4.70 in a few days after an update
## of the rate-de.dat.
##
## Revision 1.217  2004/12/10 18:26:10  tobiasb
## Let "make all" in the isdnlog directory create the necessary zone files.
##
## Revision 1.216  2004/10/28 15:10:34  tobiasb
## Moved down the regular rule just added for samples/isdn.conf
## so that all is again the default target.
##
## Revision 1.215  2004/10/28 01:53:29  tobiasb
## Enabled text substitution by configure for isdnlog sample config files
## The pointer to isdnlog documentation required a new config option.
## Added another config option and data for Chinese area codes.
##
## Revision 1.214  2004/07/24 12:03:36  tobiasb
## Increased version number from 4.68 to 4.69.  It is planned to collect
## changes with this odd version number for a longer period of time.
##
## Revision 1.213  2004/07/13 21:44:19  tobiasb
## Patch to isdnlog manpages by Matthias Klose <doko@cs.tu-berlin.de>,
## a maintainer of Debian's isdnutils source package:
## - add manpage for isdnbill *)
## - fix typo in isdnrate.man
## - isdnbill.c: add english help texts
## --
## *) Renamed the sourcefile isdnrep/isdnbill.man to isdnrep/isdnbill.1.in
## because only @MANDATE@ is replaced in %.man files. Other @VARS@ have to
## be processed by config.status and therefore noted in configure.in and
## configure. The isdnrep manpage was used as template for those entries.
##
## Revision 1.212  2004/02/12 23:52:28  tobiasb
## isdnlog-4.68:
##  - New German ratefile, rate-de.dat version 3.08 from rates4linux,
##    included rates have been reviewed in January 2004 or later.
##  - New setting for parameterfile: closefds=yes
##    See isdnlog(8) or isdnlog/start_prog.c for details.
##  - Changes checked in earlier but after step to isdnlog-4.67:
##    - Added Belgian area codes.
##    - Supported database are shown at isdnlog's startup.
##    - isdnlog now tries to reconnect to a mysql server if necessary.
##    - Fixed SIGSEGV in isdnrep with missing zonenames in ratefile.
##    - New options -c and -i for isdnrate.
##    - Some small fixes for redirs in ratefiles.
##    - Disabled unicode for filehandles in Perl scripts.
##
## Revision 1.211  2003/10/29 17:41:33  tobiasb
## isdnlog-4.67:
##  - Enhancements for isdnrep:
##    - New option -r for recomputing the connection fees with the rates
##      from the current (and for a different or the cheapest provider).
##    - Revised output format of summaries at end of report.
##    - New format parameters %j, %v, and %V.
##    - 2 new input formats for -t option.
##  - Fix for dualmode workaround 0x100 to ensure that incoming calls
##    will not become outgoing calls if a CALL_PROCEEDING message with
##    an B channel confirmation is sent by a terminal prior to CONNECT.
##  - Fixed and enhanced t: Tag handling in pp_rate.
##  - Fixed typo in interface description of tools/rate.c
##  - Fixed typo in tools/isdnrate.man, found by Paul Slootman.
##  - Minor update to sample isdn.conf files:
##    - Default isdnrep format shows numbers with 16 chars (+ & 15 digits).
##    - New isdnrep format (-FNIO) without display of transfered bytes.
##    - EUR as currency in Austria, may clash with outdated rate-at.dat.
##      The number left of the currency symbol is nowadays insignificant.
##  - Changes checked in earlier but after step to isdnlog-4.66:
##    - New option for isdnrate: `-rvNN' requires a vbn starting with NN.
##    - Do not compute the zone with empty strings (areacodes) as input.
##    - New ratefile tags r: und t: which need an enhanced pp_rate.
##      For a tag description see rate-files(5).
##    - Some new and a few updated international cellphone destinations.
##
## NOTE: If there any questions, problems, or problems regarding isdnlog,
##    feel free to join the isdn4linux mailinglist, see
##    https://www.isdn4linux.de/mailman/listinfo/isdn4linux for details,
##    or send a mail in English or German to <tobiasb@isdn4linux.de>.
##
## Revision 1.210  2003/08/26 19:46:11  tobiasb
## isdnlog-4.66:
##  - Added support for AVM B1 (with layer 2 d-channel trace) in point-to-
##    point mode, where only TEI 0 is used ("Anlagenanschluss" in German).
##    Many thanks to Klaus Heske for his testing efforts.
##  - The source number "0" in outgoing calls is now expanded to
##    +<country><area>0.  This may be useful for point-to-point setups,
##    when <area> contains area code and local number without extension.
##  - Basic support for different codesets in (E)DSS1 messages.  Except
##    for codeset 0, unknown information elements are now silently
##    ignored (controlled by ignore_unknown_IE in isdnlog/isdnlog.h).
##  - Added some information elements to isdnlog/messages.c.
##  - Increased the length of msn (local number) in struct telnum.
##  - Fixed separation of country and area code for long numbers
##    in getDest, tools/dest.c.
##  - Changed broken (with gcc 2.95.2) generation of .depend.  The old
##    output did not consider the location of objectfiles in subdirs.
##    Remove this file before compiling this upgraded isdnlog.
##  - Moved DUALFIX... defines from tools/tools.h to isdnlog/isdnlog.h.
##  - Added missing R:-Links for cellphone entries in country-de.dat.
##  - Different entry for each city "Neustadt" in tools/zone/de/code.
##  - Earlier changes since isdnlog-4.65:
##     - Allow dualmode workaround 0x100 (DUALFIX_DESTNUM) to work also with
##       CALL_PROCEEDING messages for cleaning up unanswered incoming calls.
##
## Revision 1.209  2003/07/25 22:18:02  tobiasb
## isdnlog-4.65:
##  - New values for isdnlog option -2x / dual=x with enable certain
##    workarounds for correct logging in dualmode in case of prior
##    errors.  See `man isdnlog' and isdnlog/processor.c for details.
##  - New isdnlog option -U2 / ignoreCOLP=2 for displaying ignored
##    COLP information.
##  - Improved handling of incomplete D-channel frames.
##  - Increased length of number aliases shown immediately by isdnlog.
##    Now 127 instead of 32 chars are possible. (Patch by Jochen Erwied.)
##  - The zone number for an outgoing call as defined in the rate-file
##    is written to the logfile again and used by isdnrep
##  - Improved zone summary of isdnrep.  Now the real zone numbers as
##    defined in the rate-file are shown.  The zone number is taken
##    from the logfile as mentioned before or computed from the current
##    rate-file.  Missmatches are indicated with the chars ~,+ and *,
##    isdnrep -v ... explains the meanings.
##  - Fixed provider summary of isdnrep. Calls should no longer be
##    treated wrongly as done via the default (preselected) provider.
##  - Fixed the -pmx command line option of isdnrep, where x is the xth
##    defined [MSN].
##  - `make install' restarts isdnlog after installing the data files.
##  - A new version number generates new binaries.
##  - `make clean' removes isdnlog/isdnlog/ilp.o when called with ILP=1.
##
## Revision 1.208  2002/09/09 06:56:38  akool
## isdnlog-4.64:
##   - new rates
##   - new providers
##   - new country-de.dat and dest.cdb (_Many_ thanks to
##   	Tobias Becker <tobiasb@talypso.de> !)
##
## Revision 1.207  2002/08/15 17:22:42  akool
## isdnlog-4.63
##  - new rates/provider ...
##  - isdnrate now display EuroCent as the default
##
## Revision 1.206  2002/08/10 16:32:03  akool
## isdnlog-4.62
##  - new rates/provider (0190028, Tele2 Ortstarif)
##  - display in EuroCent now the default
##
## Revision 1.205  2002/07/26 22:14:19  akool
## isdnlog-4.61:
##   - Support for mysql-4.0alpha -- many thanks to Jochen Erwied (jochen@erwied.de)!
##
## Revision 1.204  2002/07/25 18:16:05  akool
## isdnlog-2.60:
##   - new provider "01081" (1,5 EuroCent/minute)
## 	- good bye Euro ;-)
##   	with the entry "U:^%.3f c" in "rate-de.dat" now isdnlog/isdnbill
##     shows amounts in EuroCent (Value *= 100.0)
##
## Revision 1.203  2002/07/19 19:03:55  keil
## First changes to compile utils without /usr/src/linux/drivers/isdn
##
## Revision 1.202  2002/06/07 15:39:23  akool
## isdnlog-4.59: New TK-Providers added
##
## Revision 1.201  2002/04/22 19:07:49  akool
## isdnlog-4.58:
##   - Patches from Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
##     - uninitialized variables in
##     	- isdn4k-utils/isdnlog/connect/connect.c
##       - isdn4k-utils/isdnlog/tools/rate.c
##     - return() of a auto-variable in
##       - isdn4k-utils/isdnlog/isdnlog/user_access.c
##
##     *Many* thanks to Enrico!!
##
##   - New rates as of April, 23. 2002 (EUR 0,014 / minute long distance call ;-)
##
## Revision 1.200  2002/03/01 19:33:52  akool
## isdnlog-4.57:
##  - implemented
##      0190054 Calladin
## 		 0190076 Telestunt
## 		 0190082 Talk Light
##  - current rates as of today
##
## Revision 1.199  2002/01/26 20:43:30  akool
## isdnlog-4.56:
##  - dont set the Provider-field of the MySQL DB to "?*? ???" on incoming calls
##
##  - implemented
##      0190029 Telebillig        (17,5 Cent/minute to any cellphone)
## 		 0190031 Teledump
## 		 0190035 TeleDiscount
## 		 0190037 Fonfux            (1,5 Cent/minute german-call)
## 		 0190087 Phonecraft
##
##    you have to change:
##
##    1. "/etc/isdn/rate.conf" - add the following:
##
##      P:229=0		#E Telebillig
## 		 P:231=0		#E Teledump
## 		 P:235=0		#E TeleDiscount
## 		 P:237=0		#E Fonfux
## 		 P:287=0		#E Phonecraft
##
##    2. "/etc/isdn/isdn.conf" (or "/etc/isdn/callerid.conf"):
##
## 	     VBN = 010
##
## 	   to
##
## 	     VBN = 010:01900
##
## Revision 1.198  2001/12/30 17:17:40  akool
## isdnlog-4.55:
##   Tatahhh: isdnlog speaks Euro :-)
##
## 	Many thanks to Bernhard Schmidt (berni@birkenwald.de)!
##
## 	** At least, you have to install "/usr/lib/isdn/rate-de.dat"
##   ** and modify your "/etc/isdn/isdn.conf" or "/etc/isdn/callerid.conf"
##   ** to read:
##   **   [ISDNLOG]
## 	**	   CURRENCY = 0.062,EUR
##
## I wish all of you a happy new year!
##
## Revision 1.197  2001/11/22 15:09:01  akool
## isdnlog-4.54
##   added new prefix 01505 Quam (new german cellphone company)
##
## Revision 1.196  2001/10/15 19:51:47  akool
## isdnlog-4.53
##  - verified Leo's correction of Paul's byte-order independent Patch to the CDB
##    (now it's Ok, Leo, and *many* thanks to Paul!)
##  - "rate-de.dat" updated
##  - added "-Q" option to isdnlog
##
## Revision 1.195  2001/06/12 13:56:47  paul
## zone files are now created byte-order independent, so:
## - creating the zone files works on sparc
## - CDB files created on e.g. intel can be used without problem om sparc
## Our copy of CDB has also been modified for this.
##
## Revision 1.194  2001/04/03 19:15:28  akool
## isdnlog-4.52
##  - small bugfix within "isdnbill" (segfault ...)
##
## Revision 1.193  2001/03/13 14:39:30  leo
## added IIOCNETGPN support for 2.0 kernels
## s. isdnlog/kernel_2_0/README for more information (isdnlog 4.51)
##
## Revision 1.192  2001/01/31 11:58:00  leo
## Fixed length of Alias in ilp.c
##
## Revision 1.191  2001/01/14 12:13:49  akool
## isdnlog-4.49
##  - added more Euracom decodings
##
##  - added new prefixes
##      0151 - Germany cellphone D1
##      0152 - Germany cellphone D2
##      0163 - Germany cellphone Eplus
##    to "country-de.dat"
##
##  - removed Freecall "0130" and "Germany cellphone C"
##
## Revision 1.190  2000/12/23 10:36:29  leo
## Fixed makeing with ILP
##
## Revision 1.189  2000/12/21 09:56:46  leo
## modilp, ilp - show duration, bugfix
## s. isdnlog/ilp/README for more information isdnlog 4.48
##
## Revision 1.188  2000/12/15 14:36:04  leo
## modilp, ilp - B-chan usage in /proc/isdnlog
## s. isdnlog/ilp/README for more information
##
## Revision 1.187  2000/12/12 21:07:32  akool
## isdnlog-4.46
##   010050: Drillisch AG -> ElisaNet GmbH
##
##     WARNING: Please update your "/etc/isdn/rate.conf"
##     	     (see "samples/rate.conf.de" for details)
## 	     Drillisch "Superregionen" is no longer a CbC service ...
##              only "P:150=0 #E ElisaNet" is CbC by now!
##
## Revision 1.186  2000/12/07 16:25:27  leo
## Pauls 2.2/2.4 patch, rate.c: 4.45
##
## Revision 1.185  2000/11/19 14:31:52  leo
## Work around a SIGSEGV with R:Tags - V4.44
##
## Revision 1.184  2000/09/19 16:29:33  leo
## avoid double includes
##
## Revision 1.183  2000/09/08 10:41:54  paul
## Replaced {,} expansions, those only work with SHELL = /bin/bash,
## not with a POSIX-compliant shell.
##
## Revision 1.182  2000/09/05 17:27:36  paul
## runtime selection of country behaviour; version 4.42
##
## Revision 1.181  2000/09/01 06:30:20  paul
## Now install country-de.dat as country.dat; renaming the source can be done by
## someone who is more experienced with CVS.
## Default value for country.dat changed in isdnconf.c; also default zonefile
## etc. changed from .gdbm to .cdb
##
## Revision 1.180  2000/08/27 15:18:19  akool
## isdnlog-4.41
##  - fix a fix within Change_Channel()
##
##  - isdnlog/tools/dest/CDB_File_Dump.pm ... fixed bug with duplicates like _DEMD2
##
##    After installing this, please rebuild dest.cdb by:
##    $ cd isdnlog/tools/dest
##    $ rm dest.cdb
##    $ make alldata
##    $ su -c "cp ./dest.cdb /usr/lib/isdn"
##
##  - isdnlog/isdnlog/processor.c ... fixed warning
##
## Revision 1.179  2000/08/17 21:34:42  akool
## isdnlog-4.40
##  - README: explain possibility to open the "outfile=" in Append-Mode with "+"
##  - Fixed 2 typos in isdnlog/tools/zone/de - many thanks to
##      Tobias Becker <tobias@talypso.de>
##  - detect interface (via IIOCNETGPN) _before_ setting CHARGEINT/HUPTIMEOUT
##  - isdnlog/isdnlog/processor.c ... fixed wrong init of IIOCNETGPNavailable
##  - isdnlog/isdnrep/isdnrep.c ... new option -S summary
##  - isdnlog/isdnrep/rep_main.c
##  - isdnlog/isdnrep/isdnrep.1.in
##  - isdnlog/tools/NEWS
##  - isdnlog/tools/cdb/debian ... (NEW dir) copyright and such from orig
##  - new "rate-de.dat" from sourceforge (hi and welcome: Who is "roro"?)
##
## Revision 1.178  2000/08/14 18:41:43  akool
## isdnlog-4.39
##  - fixed 2 segfaults in processor.c
##  - replaced non-GPL "cdb" with "freecdb_0.61.tar.gz"
##
## Revision 1.177  2000/08/06 13:06:52  akool
## isdnlog-4.38
##  - isdnlog now uses ioctl(IIOCNETGPN) to associate phone numbers, interfaces
##    and slots in "/dev/isdninfo".
##    This requires a Linux-Kernel 2.2.12 or better.
##    Support for older Kernel's are implemented.
##    If IIOCNETGPN is available, the entries "INTERFACE = xxx" in
##    "/etc/isdn/isdn.conf" are obsolete.
##  - added 01013:Tele2 totally Freecall on 12. and 13. August 2000
##  - resolved *any* warning's from "rate-de.dat" (once more ...)
##  - Patch from oliver@escape.de (Oliver Wellnitz) against
##  	 "Ziffernwahl verschluckt Nummern"
##
##    **Please "make clean" before using this version of isdnlog!!**
##
## Revision 1.176  2000/08/04 11:08:26  paul
## Also remove *.gdbm in distclean target
##
## Revision 1.175  2000/08/01 20:31:28  akool
## isdnlog-4.37
## - removed "09978 Schoenthal Oberpfalz" from "zone-de.dtag.cdb". Entry was
##   totally buggy.
##
## - isdnlog/isdnlog/processor.c ... added err msg for failing IIOCGETCPS
##
## - isdnlog/tools/cdb       ... (NEW DIR) cdb Constant Data Base
## - isdnlog/Makefile.in     ... cdb Constant Data Base
## - isdnlog/configure{,.in}
## - isdnlog/policy.h.in
## - isdnlog/FAQ                 sic!
## - isdnlog/NEWS
## - isdnlog/README
## - isdnlog/tools/NEWS
## - isdnlog/tools/dest.c
## - isdnlog/tools/isdnrate.man
## - isdnlog/tools/zone/Makefile.in
## - isdnlog/tools/zone/configure{,.in}
## - isdnlog/tools/zone/config.h.in
## - isdnlog/tools/zone/common.h
## - isdnlog/tools/dest/Makefile.in
## - isdnlog/tools/dest/configure{,.in}
## - isdnlog/tools/dest/makedest
## - isdnlog/tools/dest/CDB_File_Dump.{pm,3pm} ... (NEW) writes cdb dump files
## - isdnlog/tools/dest/mcdb ... (NEW) convert testdest dumps to cdb dumps
##
## - isdnlog/tools/Makefile ... clean:-target fixed
## - isdnlog/tools/telnum{.c,.h} ... TELNUM.vbn was not always initialized
## - isdnlog/tools/rate.c ... fixed bug with R:tag and isdnlog not always
##                            calculating correct rates (isdnrate worked)
##
##  s. isdnlog/tools/NEWS on details for using cdb. and
##     isdnlog/README 20.a Datenbanken for a note about databases (in German).
##
##  As this is the first version with cdb and a major patch there could be
##  still some problems. If you find something let me know. <lt@toetsch.at>
##
## Revision 1.174  2000/07/24 17:02:56  akool
## isdnlog-4.36
##  - added new provider 01017.com
##  - removed too long CbC-entries in "samples/isdn.conf.de"
##
## Revision 1.173  2000/07/21 18:46:24  akool
## isdnlog-4.35
##  - isdnlog/aclocal.m4 ... postgre95 in mysql, thx Daniel Pluta
##  - isdnlog/configure  ... -""-
##  - country-de.dat enhanced
##  - new provider One.Tel added (starts next week)
##
## Revision 1.172  2000/07/19 19:41:32  akool
## isdnlog-4.34
##   - since around Linux-2.2.16 signals are *not* reset to their default
##     behavior when raised :-( (bug or feature?).
##   - isdnlog/rate-pl.dat ... changes from Karsten Voss <vossdoku@gmx.net>
##   - populated "samples/isdn.conf.de" with all german Internet-by-Call numbers
##
## Revision 1.171  2000/07/18 22:26:02  akool
## isdnlog-4.33
##   - isdnlog/tools/rate.c ... Bug fixed
##   - isdnlog/isdnlog/isdnlog.c ... check for callfmt
##   - "rate-de.dat" corrected (duplicates removed)
##
## Revision 1.170  2000/07/17 16:34:20  akool
## isdnlog-4.32
##  - added new Prefixes 0160 (D1) and 0162 (D2) to "country-de.dat"
##  - corrected all german mobil phone numbers (many thank's to
##    Tobias Becker <i4l-projects@talypso.de> for the tool "fix_rates.pl")
##  - isdnlog/tools/rate.c ... New R:-tag
##  - isdnlog/tools/isdnrate.c ... print warnings from getRate if verbose
##  - isdnlog/tools/rate-files.man ... New R:-tag
##  - isdnlog/tools/NEWS ... New R:-tag
##  - isdnlog/README ... New R:-tag
##  - isdnlog/samples/rtest.dat ... example rate-file for testing R:
##
## Revision 1.169  2000/07/16 00:46:00  akool
## isdnlog-4.31
##  - isdnlog/rate-pl.dat ... changed charges
##  - isdnlog/tools/zone/lu/code	... NEW please check this - thx
##
## Revision 1.168  2000/07/07 19:38:29  akool
## isdnlog-4.30
##  - isdnlog/tools/rate-at.c ... 1001 onlinetarif
##  - isdnlog/rate-at.dat ... 1001 onlinetarif
##  - isdnlog $ILABEL / $OLABEL may now contain "\t" (Tab)
##  - isdnlog/isdnlog/processor.c ... clearchan .pay = -1
##  - added
##     - freenet PowerTarif
##     - DTAG flatrate
##       if you really want to use a flatrate please start isdnlog with the
##       Option "-h86399 -I86399" to hangup after 23 hour's 59 seconds ;-)
##
##     - new Provider 01094:Startec, 010012:11883 Telecom, 010021:FITphone
##
## Revision 1.167  2000/06/20 17:09:58  akool
## isdnlog-4.29
##  - better ASN.1 display
##  - many new rates
##  - new Option "isdnlog -Q" dump's "/etc/isdn/isdn.conf" into a SQL database
##
## Revision 1.166  2000/06/02 12:14:26  akool
## isdnlog-4.28
##  - isdnlog/tools/rate.c ... patch by Hans Klein, unknown provider
##  - fixed RR on HFC-cards
##
## Revision 1.165  2000/05/27 22:13:05  akool
## isdnlog-4.26
##  - isdnlog support for Switzerland added
##    *MANY* thanks to gandalf <gandalf@szene.ch>
##
## Revision 1.164  2000/05/27 14:55:29  akool
## isdnlog-4.25
##  - isdnlog/isdnrep/isdnrep.c ... bugfix for wrong providers and duration
##                                  by Hans Klein on d.a.c.i
##
##  - isdnlog/tools/rate-at.c ... 1046 Neu, 1002 ab 1.6., 1024
##  - isdnlog/rate-at.dat ... 1046 Neu, 1002 ab 1.6., 1024
##  - new rates 01078:3U and 01024:Super_24
##
## Revision 1.163  2000/05/16 16:24:02  akool
## isdnlog-4.24
## - isdnlog/tools/rate.c ... bugfix for eXceptions w/o z-entry
##
## Revision 1.162  2000/05/15 19:00:19  akool
## - isdnlog/tools/rate-at.c ... 1001, 1012
##
## Revision 1.161  2000/05/13 14:22:15  akool
## isdnlog-4.22
##  - isdnlog/country-de.dat  ... Patch from Andreas Barth
##  - isdnlog/rate-at.dat  ... 1001, 1012
##  - isdnlog/tools/rate.c ... 1001, 1012
##
##  - rate-de.dat : added "CompuServeOffice"
##
## Revision 1.160  2000/05/07 11:29:31  akool
## isdnlog-4.21
##  - isdnlog/tools/rate.{c,h} ...     new X:tag for exclusions
##  - isdnlog/tools/telnum.c ... 	    new X:tag for exclusions
##  - isdnlog/tools/rate-files.man ... -"-
##  - isdnlog/tools/NEWS ... 	    -"-
##  - isdnlog/README ... 		    -"-
##  - new rates
##
## Revision 1.159  2000/04/30 17:31:24  akool
## isdnlog-4.20
##  - isdnlog/tools/rate-at.c ... patch for max (new rates)
##  - isdnlog/rate-at.dat  ... max new rates
##  - isdnlog/country-de.dat ... _TRMF, some duplicate N entries
##  - isdnlog/tools/NEWS ... hint for rebuilding dest.gdbm
##
##  => ** Please rebuild the destination database! **
##
## Revision 1.158  2000/04/25 20:12:20  akool
## isdnlog-4.19
##   isdnlog/isdnlog/processor.c ... abclcr (-d0) turn off
##   isdnlog/tools/dest.c ... isKey
##
## Revision 1.157  2000/04/13 11:02:17  paul
## Prevent "ls: zone-nl-*.db: No such file or directory" error during make install
##
## Revision 1.156  2000/04/02 17:35:06  akool
## isdnlog-4.18
##  - isdnlog/isdnlog/isdnlog.8.in  ... documented hup3
##  - isdnlog/tools/dest.c ... _DEMD1 not recogniced as key
##  - mySQL Server version 3.22.27 support
##  - new rates
##
## Revision 1.155  2000/03/19 20:26:56  akool
## isdnlog-4.17
##  - new rates
##  - Provider 01080:Telegate aus "samples/rate.conf.de" entfernt, Dienst wurde
##    eingestellt
##  - isdnlog/tools/tools.c  ... fixed sarea ($17, $18)
##
## Revision 1.154  2000/03/09 18:50:01  akool
## isdnlog-4.16
##  - isdnlog/samples/isdn.conf.no ... changed VBN
##  - isdnlog/isdnlog/isdnlog.c .. ciInterval
##  - isdnlog/isdnlog/processor.c .. ciInterval
##  - isdnlog/tools/tools.h .. ciInterval, abclcr conf option
##  - isdnlog/tools/isdnconf.c .. ciInterval, abclcr conf option
##  - isdnlog/tools/isdnrate.c .. removed a warning
##  - isdnlog/NEWS ... updated
##  - isdnlog/README ... updated
##  - isdnlog/isdnlog/isdnlog.8.in ... updated
##  - isdnlog/isdnlog/isdnlog.5.in ... updated
##  - isdnlog/samples/provider ... NEW
##
##    ==> Please run a make clean, and be sure to read isdnlog/NEWS for changes
##    ==> and new features.
##
## Revision 1.153  2000/03/06 07:03:19  akool
## isdnlog-4.15
##   - isdnlog/tools/tools.h ... moved one_call, sum_calls to isdnrep.h
##     ==> DO A 'make clean' PLEASE
##   - isdnlog/tools/telnum.c ... fixed a small typo
##   - isdnlog/isdnrep/rep_main.c ... incl. dest.h
##   - isdnlog/isdnrep/isdnrep.c ... fixed %l, %L
##   - isdnlog/isdnrep/isdnrep.h ... struct one_call, sum_calls are now here
##
##   Support for Norway added. Many thanks to Tore Ferner <torfer@pvv.org>
##     - isdnlog/rate-no.dat  ... NEW
##     - isdnlog/holiday-no.dat  ... NEW
##     - isdnlog/samples/isdn.conf.no ... NEW
##     - isdnlog/samples/rate.conf.no ... NEW
##
## Revision 1.152  2000/02/28 19:53:54  akool
## isdnlog-4.14
##   - Patch from Roland Rosenfeld <roland@spinnaker.de> fix for isdnrep
##   - isdnlog/tools/rate.c ... epnum
##   - isdnlog/tools/rate-at.c ... new rates
##   - isdnlog/rate-at.dat
##   - isdnlog/tools/rate-files.man ... %.3f
##   - doc/Configure.help ... unknown cc
##   - isdnlog/configure.in ... unknown cc
##   - isdnlog/.Config.in ... unknown cc
##   - isdnlog/Makefile.in ... unknown cc
##   - isdnlog/tools/dest/Makefile.in ... LANG => DEST_LANG
##   - isdnlog/samples/rate.conf.pl ... NEW
##   - isdnlog/samples/isdn.conf.pl ... NEW
##   - isdnlog/rate-pl.dat ... NEW
##   - isdnlog/tools/isdnrate.c ... fixed -P pid_dir, restarts on HUP now
##   - isdnlog/tools/isdnrate.man ... SIGHUP documented
##
## Revision 1.151  2000/02/22 20:04:09  akool
## isdnlog-4.13
##  - isdnlog/tools/rate-at.c ... chg. 1003
##  - isdnlog/tools/country.c ... no dupl. area warning
##  - isdnlog/rate-at.dat ... chg. 1003
##  - isdnlog/tools/dest/pp_rate ... added 'q'
##  - isdnlog/country-de.dat ... splitted _INM*
##
##  - isdnlog/tools/rate.c ... getSpecial, vbn2prefix fixed, include
##  - isdnlog/tools/dest/pp_rate ... include
##  - isdnlog/tools/rate-files.man ... include
##
##  - new rates, Services (S:, N:) reenabled
##
## Revision 1.150  2000/02/20 19:03:07  akool
## isdnlog-4.12
##  - ABC_LCR enhanced
##  - country-de.dat more aliases
##  - new rates
##  - isdnlog/Makefile.in ... defined NATION
##  - isdnlog/isdnlog/processor.c ... msn patch for NL
##  - isdnlog/tools/isdnconf.c ... default config
##
## Revision 1.149  2000/02/12 23:50:12  keil
## Fix some syntax error in install
##
## Revision 1.148  2000/02/12 16:40:21  akool
## isdnlog-4.11
##  - isdnlog/Makefile.in ... sep install-targets, installs samples, no isdnconf
##  - isdnlog/samples/rate.conf.{lu,nl} ... NEW
##  - isdnlog/samples/isdn.conf.lu ... chg provider
##  - isdnlog/samples/stop ... chg \d,\d => \d.\d
##  - isdnlog/samples/isdnlog.isdnctrl0.options ... NEW
##  - isdnlog/samples/isdnlog.users ... NEW
##  - isdnlog/country-de.dat ... _DEMF again
##  - isdnlog/isdnlog/processor.c ... LCR
##  - isdnlog/tools/isdnrate.c ... fmt of s
##
##    Old config is not installed anymore, to acomplish this do
##
##    make install-old-conf
##    make install
##
##    A running isdnlog is now HUP-ed not KILL-ed
##
## Revision 1.147  2000/02/11 10:41:50  akool
## isdnlog-4.10
##  - Set CHARGEINT to 11 if < 11
##  - new Option "-dx" controls ABC_LCR feature (see README for infos)
##  - new rates
##
## Revision 1.146  2000/02/07 20:32:38  akool
## isdnlog-4.09
##   - NEW: 01078:3U and 010050:Drillisch foreign countries
##   - isdnlog/isdnrep/isdnrep.c ... moved hist, provider ok again
##   - isdnlog/isdnrep/CHANGES.isdnrep ... NEW (old changes)
##   - isdnlog/isdnlog/isdnlog.8.in ... addded signals
##   - isdnlog/README ... upd. core (SIGSEGV), files
##
## Revision 1.145  2000/02/03 18:24:49  akool
## isdnlog-4.08
##   isdnlog/tools/rate.c ... LCR patch again
##   isdnlog/tools/isdnrate.c ... LCR patch again
##   isdnbill enhanced/fixed
##   DTAG AktivPlus fixed
##
## Revision 1.144  2000/02/02 22:43:08  akool
## isdnlog-4.07
##  - many new rates per 1.2.2000
##
## Revision 1.143  2000/01/26 20:19:38  akool
## isdnlog-4.06
##
##  - isdnlog/Makefile.in ... make install copied / to /etc/isdn sometimes
##  - new "rate-de.dat" - the first one
##      from our new cvs-Server at sourceforge.net!
##
## Revision 1.142  2000/01/24 23:06:20  akool
## isdnlog-4.05
##  - ABC_LCR tested and fixed. It's really working now, Detlef!
##  - Patch from Hans Klein <hansi.klein@net-con.net>
##    German-"Verzonungstabelle" fixed
##  - new "zone-de-dtag.gdbm" generated
##
## Revision 1.141  2000/01/23 22:31:13  akool
## isdnlog-4.04
##  - Support for Luxemburg added:
##   - isdnlog/country-de.dat ... no +352 1 luxemburg city
##   - isdnlog/rate-lu.dat ... initial LU version NEW
##   - isdnlog/holiday-lu.dat ... NEW - FIXME
##   - isdnlog/.Config.in  ... LU support
##   - isdnlog/configure.in ... LU support
##   - isdnlog/samples/isdn.conf.lu ... LU support NEW
##
##  - German zone-table enhanced
##   - isdnlog/tools/zone/de/01033/mk ...fixed, with verify now
##   - isdnlog/tools/zone/redzone ... fixed
##   - isdnlog/tools/zone/de/01033/mzoneall ... fixed, faster
##   - isdnlog/tools/zone/mkzonedb.c .... data Version 1.21
##
##  - Patch from Philipp Matthias Hahn <pmhahn@titan.lahn.de>
##   - PostgreSQL SEGV solved
##
##  - Patch from Armin Schindler <mac@melware.de>
##   - Eicon-Driver Support for isdnlog
##
## Revision 1.140  2000/01/16 12:36:58  akool
## isdnlog-4.03
##  - Patch from Gerrit Pape <pape@innominate.de>
##    fixes html-output if "-t" option of isdnrep is omitted
##  - Patch from Roland Rosenfeld <roland@spinnaker.de>
##    fixes "%p" in ILABEL and OLABEL
##
## Revision 1.139  2000/01/12 23:22:50  akool
## - isdnlog/tools/holiday.c ... returns ERVERYDAY for '*'
## - FAQ/configure{,.in} ...  test '==' => '='
## - isdnlog/tools/dest/configure{,.in} ...  test '==' => '='
## - isdnlog/tools/dest/Makefile.in ...  test '==' => '='
## - isdnlog/tools/zone/configure{,.in} ...  test '==' => '='
##
## - isdnlog/tools/rate-at.c ... P:1069
## - isdnlog/rate-at.dat ... P:1069
## - isdnlog/country-de.dat ... _DEMF
##
## - many new rates
## - more EURACOM sequences decoded
##
## Revision 1.138  2000/01/01 15:05:22  akool
## isdnlog-4.01
##  - first Y2K-Bug fixed
##
## Revision 1.137  1999/12/31 13:57:17  akool
## isdnlog-4.00 (Millenium-Edition)
##  - Oracle support added by Jan Bolt (Jan.Bolt@t-online.de)
##  - resolved *any* warnings against rate-de.dat
##  - Many new rates
##  - CREDITS file added
##
## Revision 1.136  1999/12/24 14:17:02  akool
## isdnlog-3.81
##  - isdnlog/tools/NEWS
##  - isdnlog/tools/telrate/info.html.in  ... bugfix
##  - isdnlog/tools/telrate/telrate.cgi.in ... new Service query
##  - isdnlog/tools/telrate/Makefile.in ... moved tmp below telrate
##  - isdnlog/samples/rate.conf.at ... fixed
##  - isdnlog/tools/rate-at.c ... some changes
##  - isdnlog/rate-at.dat ... ditto
##  - isdnlog/tools/Makefile ... added path to pp_rate
##  - isdnlog/tools/rate.{c,h}  ... getServiceNames, Date-Range in T:-Tag
##  - isdnlog/tools/isdnrate.c ... fixed sorting of services, -X52 rets service names
##  - isdnlog/tools/rate-files.man ... Date-Range in T:-Tag, moved from doc
##  - isdnlog/tools/isdnrate.man ... moved from doc
##  - doc/Makefile.in ... moved man's from doc to tools
##  - isdnlog/Makefile.in ... man's, install isdn.conf.5
##  - isdnlog/configure{,.in} ... sed, awk for man's
##  - isdnlog/tools/zone/Makefile.in ... dataclean
##  - isdnlog/tools/dest/Makefile.in ... dataclean
##  - isdnlog/isdnlog/isdnlog.8.in ... upd
##  - isdnlog/isdnlog/isdn.conf.5.in ... upd
##
## Revision 1.135  1999/12/19 20:24:44  akool
## isdnlog-3.80
##   - resolved most of the Warnings
##   - enhanced "isdnbill"
##
## Revision 1.134  1999/12/17 22:51:52  akool
## isdnlog-3.79
##  - isdnlog/isdnrep/isdnrep.{c,h} ... error -handling, print_msg
##  - isdnlog/isdnrep/rep_main.c
##  - isdnlog/isdnrep/isdnrep.1.in
##  - isdnlog/tools/rate.c  ... dupl entry in rate.conf
##  - isdnlog/tools/NEWS
##  - isdnlog/tools/isdnrate.c
##  - isdnlog/tools/dest/configure{,.in}
##  - isdnlog/tools/zone/configure{,.in}
##
## Revision 1.133  1999/12/16 23:08:26  akool
## isdnlog-3.78
##  - isdnlog/tools/isdnrate.c ... new sOcket option
##  - isdnlog/tools/NEWS ... new sOcket option
##  - doc/isdnrate.man ... ditto
##  - isdnlog/tools/telrate/config.in ... ditto
##  - isdnlog/tools/telrate/telrate.cgi.in ... ditto
##  - isdnlog/tools/telrate/README-telrate ditto
##
## Revision 1.132  1999/12/14 21:02:36  akool
## isdnlog-3.77
##   corrected german zone file
##
## Revision 1.131  1999/12/12 17:21:09  akool
## isdnlog-3.76
## - isdnlog/Makefile.in ... added dep for Makefile.in
## - isdnlog/tools/zone/configure{,.in} ... better error msg if bzip2 not found
## - isdnlog/tools/dest/configure{,.in} ... better error msg if bzip2 not found
## - tools for generating a fully expanded zonefile added
##
## Revision 1.130  1999/12/12 14:35:51  akool
## isdnlog-3.75
##  - ABC_LCR support (untested)
##
## Revision 1.129  1999/12/07 20:07:20  akool
## isdnlog-3.74
##   new rates, faster isdnbill
##
## Revision 1.128  1999/12/02 19:28:02  akool
## isdnlog-3.73
##  - isdnlog/tools/telrate/telrate.cgi.in faster
##  - doc/isdnrate.man ... -P
##  - isdnlog/tools/isdnrate.c ... -P
##  - isdnlog/tools/NEWS ... -P
##  - isdnlog/tools/rate-at.c ... 194040
##  - isdnlog/rate-at.dat
##  - isdnlog/tools/rate.c ... SIGSEGV
##
## Revision 1.127  1999/12/01 21:47:23  akool
## isdnlog-3.72
##   - new rates for 01051
##   - next version of isdnbill
##
##   - isdnlog/tools/telnum.c ... cleanup
##   - isdnlog/tools/isdnrate.c ... -s Service
##   - isdnlog/tools/rate.{c,h} ... -s
##   - isdnlog/tools/NEWS ... -s
##   - doc/isdnrate.man .. updated -o, -s
##   - doc/rate-files.man ... updated
##   - isdnlog/tools/dest/README.makedest ... updt.
##   - isdnlog/isdnlog/isdnlog.8.in .. updt.
##
##   Telrate
##   - isdnlog/tools/telrate/README-telrate
##   - isdnlog/tools/telrate/config.in 	NEW
##   - isdnlog/tools/telrate/configure 	NEW
##   - isdnlog/tools/telrate/Makefile.in 	NEW
##   - isdnlog/tools/telrate/index.html.in 	was index.html
##   - isdnlog/tools/telrate/info.html.in 	was info.html
##   - isdnlog/tools/telrate/telrate.cgi.in 	was telrate.cgi
##   - isdnlog/tools/telrate/leo.sample 	NEW sample config
##   - isdnlog/tools/telrate/alex.sample 	NEW sample config
##
## Revision 1.126  1999/11/28 19:32:41  akool
## isdnlog-3.71
##
## Revision 1.125  1999/11/28 11:15:41  akool
## isdnlog-3.70
##   - patch from Jochen Erwied (j.erwied@gmx.de)
##
## Revision 1.124  1999/11/27 19:24:17  akool
## isdnlog-3.69
##
## Revision 1.123  1999/11/25 22:58:38  akool
## isdnlog-3.68
##  - new utility "isdnbill" added
##  - patch from Jochen Erwied (j.erwied@gmx.de)
##  - new rates
##  - small fixes
##
## Revision 1.122  1999/11/16 18:09:36  akool
## isdnlog-3.67
##   isdnlog-3.66 writes wrong provider number into it's logfile isdn.log
##   there is a patch and a repair program available at
##   http://www.toetsch.at/linux/i4l/i4l-3_66.htm
##
## Revision 1.121  1999/11/12 20:50:48  akool
## isdnlog-3.66
##   - Patch from Jochen Erwied <mack@joker.e.ruhr.de>
##       makes the "-O" and "-C" options usable at the same time
##
##   - Workaround from Karsten Keil <kkeil@suse.de>
##       segfault in ASN.1 parser
##
##   - isdnlog/tools/rate.c ... ignores "empty" providers
##   - isdnlog/tools/telnum.h ... fixed TN_MAX_PROVIDER_LEN
##
## Revision 1.120  1999/11/08 21:09:36  akool
## isdnlog-3.65
##   - added "B:" Tag to "rate-xx.dat"
##
## Revision 1.119  1999/11/07 13:29:25  akool
## isdnlog-3.64
##  - new "Sonderrufnummern" handling
##
## Revision 1.118  1999/11/05 20:21:59  akool
## isdnlog-3.63
##  - many new rates
##  - cosmetics
##
## Revision 1.117  1999/11/02 21:01:56  akool
## isdnlog-3.62
##  - many new rates
##  - next try to fix "Sonderrufnummern"
##
## Revision 1.116  1999/10/30 14:38:46  akool
## isdnlog-3.61
##
## Revision 1.115  1999/10/29 19:45:59  akool
## isdnlog-3.60
##  - successfully ported/tested to/with:
##      - Linux-2.3.24 SMP
##      - egcs-2.91.66
##    using -DBIG_PHONE_NUMBERS
##
##  - finally added working support for HFC-card in "echo mode"
##    try this:
##      hisaxctrl bri 10 1
##      hisaxctrl bri 12 1
##      isdnlog -21 -1
## -----------------^^ new option
##
## Revision 1.114  1999/10/29 12:43:02  akool
## fixed "make install"
##
## Revision 1.113  1999/10/28 18:36:43  akool
## isdnlog-3.59
##  - problems with gcc-2.7.2.3 fixed
##  - *any* startup-warning solved/removed (only 4u, Karsten!)
##  - many new rates
##
## Revision 1.112  1999/10/26 18:17:11  akool
## isdnlog-3.58
##   - big cleanup ( > 1.3 Mb removed!)
##   - v0.02 of destination support - better, but not perfect
##     (does't work with gcc-2.7.2.3 yet - use egcs!)
##
## Revision 1.111  1999/10/25 18:33:13  akool
## isdnlog-3.57
##   WARNING: Experimental version!
##   	   Please use isdnlog-3.56 for production systems!
##
## Revision 1.110  1999/10/22 19:57:58  akool
## isdnlog-3.56 (for Karsten)
##
## Revision 1.109  1999/09/26 10:55:19  akool
## isdnlog-3.55
##   - Patch from Oliver Lauer <Oliver.Lauer@coburg.baynet.de>
##     added hup3 to option file
##   - changed country-de.dat to ISO 3166 Countrycode / Airportcode
##
## Revision 1.108  1999/09/22 09:02:59  akool
## isdnlog-3.54
##
## Revision 1.107  1999/09/19 14:16:26  akool
## isdnlog-3.53
##
## Revision 1.106  1999/09/16 20:27:21  akool
## isdnlog-3.52
##
## Revision 1.105  1999/09/13 09:09:42  akool
## isdnlog-3.51
##   - changed getProvider() to not return NULL on unknown providers
##     many thanks to Matthias Eder <mateder@netway.at>
##   - corrected zone-processing when doing a internal -> world call
##
## Revision 1.104  1999/09/11 22:28:22  akool
## isdnlog-3.50
##   added 3. parameter to "-h" Option: Controls CHARGEHUP for providers like
##   DTAG (T-Online) or AOL.
##   Many thanks to Martin Lesser <m-lesser@lesser-com.de>
##
## Revision 1.103  1999/09/09 11:21:04  akool
## isdnlog-3.49
##
## Revision 1.102  1999/08/29 10:28:11  akool
## isdnlog-3.48
##   cosmetics
##
## Revision 1.101  1999/08/27 20:56:28  akool
## Patch from Kai
##
## Revision 1.100  1999/08/25 17:05:57  akool
## isdnlog-3.46
##
## Revision 1.99  1999/08/21 21:11:31  akool
## rate-de.dat :: V:1.10-Germany [21-Aug-1999 22:26:53]
##
## Revision 1.98  1999/08/20 19:27:18  akool
## isdnlog-3.45
##  - removed about 1 Mb of (now unused) data files
##  - replaced areacodes and "vorwahl.dat" support by zone databases
##  - fixed "Sonderrufnummern"
##  - rate-de.dat :: V:1.10-Germany [20-Aug-1999 21:23:27]
##
## Revision 1.97  1999/08/04 23:11:15  akool
## isdnlog-3.44
##
## Revision 1.96  1999/07/25 15:57:01  akool
## isdnlog-3.43
##   added "telnum" module
##
## Revision 1.95  1999/07/24 08:43:38  akool
## isdnlog-3.42
##   rate-de.dat 1.02-Germany [18-Jul-1999 10:44:21]
##   better Support for Ackermann Euracom
##   WEB-Interface for isdnrate
##   many small fixes
##
## Revision 1.94  1999/07/10 21:37:36  akool
## isdnlog-3.41
##   rate-de.dat V:1.02-Germany [10-Jul-1999 23:32:27]
##   country-de.dat V:1.02-Germany [10-Jul-1999 23:32:36]
##   added all "zone-*" files in binary mode
##
## Revision 1.93  1999/07/03 10:23:55  akool
## fixed Makefile
##
## Revision 1.92  1999/06/30 17:17:10  akool
## isdnlog Version 3.39
##
## Revision 1.91  1999/06/28 19:14:59  akool
## isdnlog Version 3.38
##   - new utility "isdnrate" started
##
## Revision 1.90  1999/06/26 12:25:04  akool
## isdnlog Version 3.37
##   fixed some warnings
##
## Revision 1.89  1999/06/26 10:11:06  akool
## isdnlog Version 3.36
##  - EGCS 1.1.2 bug correction from Nima <nima_ghasseminejad@public.uni-hamburg.de>
##  - zone-1.11
##
## Revision 1.88  1999/06/21 19:32:08  akool
## isdnlog Version 3.35
##   zone data for .nl (many thanks to Paul!)
##
##   WARNING: This version of isdnlog dont even compile! *EXPERIMENTAL*!!
##
## Revision 1.87  1999/06/16 19:11:54  akool
## isdnlog Version 3.34
##   fixed some memory faults
##
## Revision 1.86  1999/06/15 20:02:54  akool
## isdnlog Version 3.33
##   - big step in using the new zone files
##   - *This*is*not*a*production*ready*isdnlog*!!
##   - Maybe the last release before the I4L meeting in Nuernberg
##
## Revision 1.85  1999/06/13 14:06:53  akool
## isdnlog Version 3.32
##
##  - new option "-U1" (or "ignoreCOLP=1") to ignore CLIP/COLP Frames
##  - TEI management decoded
##
## Revision 1.84  1999/06/09 19:57:22  akool
## isdnlog Version 3.31
##  - Release 0.91 of zone-Database (aka "Verzonungstabelle")
##  - "rate-de.dat" V:1.02-Germany [09-Jun-1999 21:45:26]
##
## Revision 1.83  1999/06/03 18:49:36  akool
## isdnlog Version 3.30
##  - rate-de.dat V:1.02-Germany [03-Jun-1999 19:49:22]
##  - small fixes
##
## Revision 1.82  1999/05/22 10:17:50  akool
## isdnlog Version 3.29
##
##  - processing of "sonderrufnummern" much more faster
##  - detection for sonderrufnummern of other provider's implemented
##    (like 01929:FreeNet)
##  - Patch from Oliver Lauer <Oliver.Lauer@coburg.baynet.de>
##  - Patch from Markus Schoepflin <schoepflin@ginit.de>
##  - easter computing corrected
##  - rate-de.dat 1.02-Germany [22-May-1999 11:37:33] (from rate-CVS)
##  - countries-de.dat 1.02-Germany [22-May-1999 11:37:47] (from rate-CVS)
##  - new option "-B" added (see README)
##    (using "isdnlog -B16 ..." isdnlog now works in the Netherlands!)
##
## Revision 1.81  1999/05/13 11:38:43  akool
## isdnlog Version 3.28
##
##  - "-u" Option corrected
##  - "ausland.dat" removed
##  - "countries-de.dat" fully integrated
##      you should add the entry
##      "COUNTRYFILE = /usr/lib/isdn/countries-de.dat"
##      into section "[ISDNLOG]" of your config file!
##  - rate-de.dat V:1.02-Germany [13-May-1999 12:26:24]
##  - countries-de.dat V:1.02-Germany [13-May-1999 12:26:26]
##
## Revision 1.80  1999/05/11 20:27:01  akool
## isdnlog Version 3.27
##
##  - country matching fixed (and faster)
##
## Revision 1.79  1999/05/10 20:37:11  akool
## isdnlog Version 3.26
##
##  - fixed the "0800" -> free of charge problem
##  - *many* additions to "ausland.dat"
##  - first relase of "rate-de.dat" from the CVS-Server of the I4L-Tarif-Crew
##
## Revision 1.78  1999/05/09 18:23:42  akool
## isdnlog Version 3.25
##
##  - README: isdnconf: new features explained
##  - rate-de.dat: many new rates from the I4L-Tarifdatenbank-Crew
##  - added the ability to directly enter a country-name into "rate-xx.dat"
##
## Revision 1.77  1999/05/04 19:32:02  akool
## isdnlog Version 3.24
##
##  - fully removed "sondernummern.c"
##  - removed "gcc -Wall" warnings in ASN.1 Parser
##  - many new entries for "rate-de.dat"
##  - better "isdnconf" utility
##
## Revision 1.76  1999/04/30 19:07:28  akool
## isdnlog Version 3.23
##
##  - changed LCR probing duration from 181 seconds to 153 seconds
##  - "rate-de.dat" filled with May, 1. rates
##
## Revision 1.75  1999/04/29 19:02:56  akool
## isdnlog Version 3.22
##
##  - T-Online corrected
##  - more online rates for rate-at.dat (Thanks to Leopold Toetsch <lt@toetsch.at>)
##
## Revision 1.74  1999/04/26 22:11:33  akool
## isdnlog Version 3.21
##
##  - CVS headers added to the asn* files
##  - repaired the "4.CI" message directly on CONNECT
##  - HANGUP message extended (CI's and EH's shown)
##  - reactivated the OVERLOAD message
##  - rate-at.dat extended
##  - fixes from Michael Reinelt
##
## Revision 1.73  1999/04/25 17:34:27  akool
## isdnlog Version 3.20
##
##  - added ASN.1 Parser from Kai Germaschewski <kai@thphy.uni-duesseldorf.de>
##    isdnlog now fully support all fac- and cf-messages!
##
##  - some additions to the "rate-de.dat"
##
## Revision 1.72  1999/04/19 21:25:06  akool
## change permissions of "countries-at.dat"
##
## Revision 1.71  1999/04/19 19:23:14  akool
## isdnlog Version 3.18
##
## - countries-at.dat added
## - spelling corrections in "countries-de.dat" and "countries-us.dat"
## - LCR-function of isdnconf now accepts a duration (isdnconf -c .,duration)
## - "rate-at.dat" and "rate-de.dat" extended/fixed
## - holiday.c and rate.c fixed (many thanks to reinelt@eunet.at)
##
## Revision 1.70  1999/04/17 14:10:36  akool
## isdnlog Version 3.17
##
## - LCR functions of "isdnconf" fixed
## - HINT's fixed
## - rate-de.dat: replaced "1-5" with "W" and "6-7" with "E"
##
## Revision 1.69  1999/04/16 14:39:07  akool
## isdnlog Version 3.16
##
## - more syntax checks for "rate-xx.dat"
## - isdnrep fixed
##
## Revision 1.68  1999/04/15 19:14:09  akool
## isdnlog Version 3.15
##
## - reenable the least-cost-router functions of "isdnconf"
##   try "isdnconf -c <areacode>" or even "isdnconf -c ."
## - README: "rate-xx.dat" documented
## - small fixes in processor.c and rate.c
## - "rate-de.dat" optimized
## - splitted countries.dat into countries-de.dat and countries-us.dat
##
## Revision 1.67  1999/04/14 13:16:01  akool
## isdnlog Version 3.14
##
## - "make install" now install's "rate-xx.dat", "rate.conf" and "ausland.dat"
## - "holiday-xx.dat" Version 1.1
## - many rate fixes (Thanks again to Michael Reinelt <reinelt@eunet.at>)
##
## Revision 1.66  1999/04/10 16:34:57  akool
## isdnlog Version 3.13
##
## WARNING: This is pre-ALPHA-dont-ever-use-Code!
## 	 "tarif.dat" (aka "rate-xx.dat"): the next generation!
##
## You have to do the following to test this version:
##   cp /usr/src/isdn4k-utils/isdnlog/holiday-de.dat /etc/isdn
##   cp /usr/src/isdn4k-utils/isdnlog/rate-de.dat /usr/lib/isdn
##   cp /usr/src/isdn4k-utils/isdnlog/samples/rate.conf.de /etc/isdn/rate.conf
##
## After that, add the following entries to your "/etc/isdn/isdn.conf" or
## "/etc/isdn/callerid.conf" file:
##
## [ISDNLOG]
## SPECIALNUMBERS = /usr/lib/isdn/sonderrufnummern.dat
## HOLIDAYS       = /usr/lib/isdn/holiday-de.dat
## RATEFILE       = /usr/lib/isdn/rate-de.dat
## RATECONF       = /etc/isdn/rate.conf
##
## Please replace any "de" with your country code ("at", "ch", "nl")
##
## Good luck (Andreas Kool and Michael Reinelt)
##
## Revision 1.65  1999/04/03 12:46:39  akool
## - isdnlog Version 3.12
## - "%B" tag in ILABEL/OLABEL corrected
## - isdnlog now register's incoming calls when there are no free B-channels
##   (idea from sergio@webmedia.es)
## - better "samples/rate.conf.de" (suppress provider without true call-by-call)
## - "tarif.dat" V:1.17 [03-Apr-99]
## - Added EWE-Tel rates from Reiner Klaproth <rk1@msjohan.dd.sn.schule.de>
## - isdnconf can now be used to generate a Least-cost-router table
##   (try "isdnconf -c .")
## - isdnlog now simulate a RELEASE COMPLETE if nothing happpens after a SETUP
## - CHARGEMAX Patches from Oliver Lauer <Oliver.Lauer@coburg.baynet.de>
##
## Revision 1.64  1999/03/25 19:39:41  akool
## - isdnlog Version 3.11
## - make isdnlog compile with egcs 1.1.7 (Bug report from Christophe Zwecker <doc@zwecker.com>)
##
## Revision 1.63  1999/03/24 19:37:29  akool
## - isdnlog Version 3.10
## - moved "sondernnummern.c" from isdnlog/ to tools/
## - "holiday.c" and "rate.c" integrated
## - NetCologne rates from Oliver Flimm <flimm@ph-cip.uni-koeln.de>
## - corrected UUnet and T-Online rates
##
## Revision 1.62  1999/03/20 16:54:37  akool
## isdnlog 3.09 : support for all Internet-by-call numbers
##
## Revision 1.61  1999/03/20 14:32:29  akool
## - isdnlog Version 3.08
## - more tesion)) Tarife from Michael Graw <Michael.Graw@bartlmae.de>
## - use "bunzip -f" from Frank Elsner <Elsner@zrz.TU-Berlin.DE>
## - show another "cheapest" hint if provider is overloaded ("OVERLOAD")
## - "make install" now makes the required entry
##     [GLOBAL]
##     AREADIFF = /usr/lib/isdn/vorwahl.dat
## - README: Syntax description of the new "rate-at.dat"
## - better integration of "sondernummern.c" from mario.joussen@post.rwth-aachen.de
## - server.c: buffer overrun fix from Michael.Weber@Post.RWTH-Aachen.DE (Michael Weber)
##
## Revision 1.60  1999/03/16 17:37:08  akool
## - isdnlog Version 3.07
## - Michael Reinelt's patch as of 16Mar99 06:58:58
## - fix a fix from yesterday with sondernummern
## - ignore "" COLP/CLIP messages
## - dont show a LCR-Hint, if same price
##
## Revision 1.59  1999/03/15 21:27:30  akool
## - isdnlog Version 3.06
## - README: explain some terms about LCR, corrected "-c" Option of "isdnconf"
## - isdnconf: added a small LCR-feature - simply try "isdnconf -c 069"
## - isdnlog: dont change CHARGEINT, if rate is't known!
## - sonderrufnummern 1.02 [15-Mar-99] :: added WorldCom
## - tarif.dat 1.09 [15-Mar-99] :: added WorldCom
## - isdnlog now correctly handles the new "Ortstarif-Zugang" of UUnet
##
## Revision 1.58  1999/03/14 14:26:10  akool
## - isdnlog Version 3.05
## - new Option "-u1" (or "ignoreRR=1")
## - added version information to "sonderrufnummern.dat"
## - added debug messages if sonderrufnummern.dat or tarif.dat could not be opened
## - sonderrufnummern.dat V 1.01 - new 01805 rates
##
## Revision 1.57  1999/03/14 12:15:56  akool
## - isdnlog Version 3.04
## - general cleanup
## - new layout for "rate-xx.dat" and "holiday-xx.dat" files from
##     Michael Reinelt <reinelt@eunet.at>
##     unused by now - it's a work-in-progress !
## - bugfix for Wolfgang Siefert <siefert@wiwi.uni-frankfurt.de>
##     The Agfeo AS 40 (Software release 2.1b) uses AOC_AMOUNT, not AOC_UNITS
## - bugfix for Ralf G. R. Bergs <rabe@RWTH-Aachen.DE> - 0800/xxx numbers
##     are free of charge ;-)
## - tarif.dat V 1.08 - new mobil-rates DTAG
##
## Revision 1.56  1999/03/11 09:21:58  paul
## fixed problems with yesterday's commit
##
## Revision 1.55  1999/03/10 08:35:48  paul
## use DATADIR from "make config" phase instead of hardcoded /usr/lib/isdn
##
## Revision 1.54  1999/03/07 18:18:21  akool
## - new 01805 tarif of DTAG
## - new March 1999 tarife
## - added new provider "01051 Telecom"
## - fixed a buffer overrun from Michael Weber <Michael.Weber@Post.RWTH-Aachen.DE>
## - fixed a bug using "sondernnummern.c"
## - fixed chargeint change over the time
## - "make install" now install's "sonderrufnummern.dat", "tarif.dat",
##   "vorwahl.dat" and "tarif.conf"! Many thanks to
##   Mario Joussen <mario.joussen@post.rwth-aachen.de>
## - Euracom Frames would now be ignored
## - fixed warnings in "sondernnummern.c"
## - "10plus" messages no longer send to syslog
##
## Revision 1.53  1999/02/28 19:32:17  akool
## Fixed a typo in isdnconf.c from Andreas Jaeger <aj@arthur.rhein-neckar.de>
## CHARGEMAX fix from Oliver Lauer <Oliver.Lauer@coburg.baynet.de>
## isdnrep fix from reinhard.karcher@dpk.berlin.fido.de (Reinhard Karcher)
## "takt_at.c" fixes from Ulrich Leodolter <u.leodolter@xpoint.at>
## sondernummern.c from Mario Joussen <mario.joussen@post.rwth-aachen.de>
## Reenable usage of the ZONE entry from Schlottmann-Goedde@t-online.de
## Fixed a typo in callerid.conf.5
##
## Revision 1.52  1999/01/10 15:22:43  akool
##  - "message = 0" bug fixed (many thanks to
##    Sebastian Kanthak <sebastian.kanthak@muehlheim.de>)
##  - CITYWEEKEND via config-file possible
##  - fixes from Michael Reinelt <reinelt@eunet.at>
##  - fix a typo in the README from Sascha Ziemann <szi@aibon.ping.de>
##  - Charge for .at optimized by Michael Reinelt <reinelt@eunet.at>
##  - first alpha-Version of the new chargeinfo-Database
##    ATTENTION: This version requires the following manual steps:
##      cp /usr/src/isdn4k-utils/isdnlog/tarif.dat /usr/lib/isdn
##      cp /usr/src/isdn4k-utils/isdnlog/samples/tarif.conf /etc/isdn
##
## Revision 1.51  1998/12/29 14:51:37  paul
## added isdnconf manpage
##
## Revision 1.50  1998/12/01 16:57:09  paul
## support for .in manpages
##
## Revision 1.49  1998/11/24 20:50:59  akool
##  - changed my email-adress
##  - new Option "-R" to supply the preselected provider (-R24 -> Telepassport)
##  - made Provider-Prefix 6 digits long
##  - full support for internal S0-bus implemented (-A, -i Options)
##  - isdnlog now ignores unknown frames
##  - added 36 allocated, but up to now unused "Auskunft" Numbers
##  - added _all_ 122 Providers
##  - Patch from Jochen Erwied <mack@Joker.E.Ruhr.DE> for Quante-TK-Anlagen
##    (first dialed digit comes with SETUP-Frame)
##
## Revision 1.48  1998/11/07 17:12:45  akool
## Final cleanup. This _is_ isdnlog-3.00
##
## Revision 1.47  1998/11/05 19:09:42  akool
##  - Support for all the new L2 frames from HiSax 3.0d (RR, UA, SABME and
##    tei management)
##  - CityWeekend reimplemented
##    Many thanks to Rainer Gallersdoerfer <gallersd@informatik.rwth-aachen.de>
##    for the tip
##  - more providers
##  - general clean-up
##
## Revision 1.46  1998/11/01 08:49:22  akool
##  - fixed "configure.in" problem with NATION_*
##  - DESTDIR fixes (many thanks to Michael Reinelt <reinelt@eunet.at>)
##  - isdnrep: Outgoing calls ordered by Zone/Provider/MSN corrected
##  - new Switch "-i" -> running on internal S0-Bus
##  - more providers
##  - "sonderrufnummern.dat" extended (Frag Fred, Telegate ...)
##  - added AVM-B1 to the documentation
##  - removed the word "Teles" from the whole documentation ;-)
##
## Revision 1.45  1998/10/16 12:38:04  keil
## fixes to compile and install under 2.0.36
##
## Revision 1.44  1998/10/13 22:17:09  luethje
## isdnlog: evaluate the variable PATH for program starts.
##
## Revision 1.43  1998/10/03 18:05:48  akool
##  - processor.c, takt_at.c : Patch from Michael Reinelt <reinelt@eunet.at>
##    try to guess the zone of the calling/called party
##
##  - isdnrep.c : cosmetics (i hope, you like it, Stefan!)
##
## Revision 1.42  1998/09/27 11:47:21  akool
## fix segfault of isdnlog after each RELASE
##
## Revision 1.41  1998/09/26 18:28:32  akool
##  - quick and dirty Call-History in "-m" Mode (press "h" for more info) added
##    - eat's one more socket, Stefan: sockets[3] now is STDIN, FIRST_DESCR=4 !!
##  - Support for tesion)) Baden-Wuerttemberg Tarif
##  - more Providers
##  - Patches from Wilfried Teiken <wteiken@terminus.cl-ki.uni-osnabrueck.de>
##    - better zone-info support in "tools/isdnconf.c"
##    - buffer-overrun in "isdntools.c" fixed
##  - big Austrian Patch from Michael Reinelt <reinelt@eunet.at>
##    - added $(DESTDIR) in any "Makefile.in"
##    - new Configure-Switches "ISDN_AT" and "ISDN_DE"
##      - splitted "takt.c" and "tools.c" into
##          "takt_at.c" / "takt_de.c" ...
##          "tools_at.c" / "takt_de.c" ...
##    - new feature
##        CALLFILE = /var/log/caller.log
##        CALLFMT  = %b %e %T %N7 %N3 %N4 %N5 %N6
##      in "isdn.conf"
##  - ATTENTION:
##      1. "isdnrep" dies with an seg-fault, if not HTML-Mode (Stefan?)
##      2. "isdnlog/Makefile.in" now has hardcoded "ISDN_DE" in "DEFS"
##      	should be fixed soon
##
## Revision 1.40  1998/06/14 15:33:42  akool
## AVM B1 support (Layer 3)
## Telekom's new currency DEM 0,121 supported
## Disable holiday rates #ifdef ISDN_NL
## memory leak in "isdnrep" repaired
##
## Revision 1.39  1998/06/07 21:07:50  akool
## - Accounting for the following new providers implemented:
##     o.tel.o, Tele2, EWE TEL, Debitel, Mobilcom, Isis, NetCologne,
##     TelePassport, Citykom Muenster, TelDaFax, Telekom, Hutchison Telekom,
##     tesion)), HanseNet, KomTel, ACC, Talkline, Esprit, Interoute, Arcor,
##     WESTCom, WorldCom, Viag Interkom
##
##     Code shamelessly stolen from G.Glendown's (garry@insider.regio.net)
##     program http://www.insider.org/tarif/gebuehr.c
##
## - Telekom's 10plus implemented
##
## - Berechnung der Gebuehrenzone implementiert
##   (CityCall, RegioCall, GermanCall, GlobalCall)
##   The entry "ZONE" is not needed anymore in the config-files
##
##   you need the file
##     http://swt.wi-inf.uni-essen.de/~omatthes/tgeb/vorwahl2.exe
##   and the new entry
##     [GLOBAL]
##       AREADIFF = /usr/lib/isdn/vorwahl.dat
##   for that feature.
##
##   Many thanks to Olaf Matthes (olaf.matthes@uni-essen.de) for the
##   Data-File and Harald Milz for his first Perl-Implementation!
##
## - Accounting for all "Sonderrufnummern" (0010 .. 11834) implemented
##
##   You must install the file
##     "isdn4k-utils/isdnlog/sonderrufnummern.dat.bz2"
##   as "/usr/lib/isdn/sonderrufnummern.dat"
##   for that feature.
##
## ATTENTION: This is *NO* production-code! Please test it carefully!
##
## Revision 1.38  1998/05/10 22:11:47  luethje
## Added support for VORWAHLEN2.EXE
##
## Revision 1.37  1998/03/29 23:17:47  luethje
## mySQL-Patch of Sascha Matzke
##
## Revision 1.36  1998/03/29 19:54:04  luethje
## idnrep: added html feature (incoming/outgoing calls)
##
## Revision 1.35  1998/03/15 22:35:44  tsbogend
## not every CPU is from Intel (greetings from Digital :-))
##
## Revision 1.34  1998/03/08 11:42:27  luethje
## I4L-Meeting Wuerzburg final Edition, golden code - Service Pack number One
##
## Revision 1.33  1997/10/26 23:14:38  fritz
## Get rid of including ../.config in Makefile
## Now all configuration is done in configure.
## Moved depend depency from install to build
## where it belongs.
##
## Revision 1.32  1997/09/26 09:13:01  fritz
## Set SUBDIRS always to overwrite environment.
##
## Revision 1.31  1997/09/07 00:43:06  luethje
## create new error messages for isdnrep
##
## Revision 1.30  1997/06/21 13:48:55  fritz
## Create ./bin if necessary
##
## Revision 1.29  1997/06/15 23:49:28  luethje
## Some new variables for the isdnlog
## isdnlog starts programs noe with the file system rights
## bugfixes
##
## Revision 1.28  1997/05/25 19:40:43  luethje
## isdnlog:  close all files and open again after kill -HUP
## isdnrep:  support vbox version 2.0
## isdnconf: changes by Roderich Schupp <roderich@syntec.m.EUnet.de>
## conffile: ignore spaces at the end of a line
##
## Revision 1.27  1997/05/20 19:00:51  luethje
## some primitve changes
##
## Revision 1.26  1997/05/19 22:58:02  luethje
## - bugfix: it is possible to install isdnlog now
## - improved performance for read files for vbox files and mgetty files.
## - it is possible to decide via config if you want to use avon or
##   areacode.
##
## Revision 1.25  1997/05/17 01:08:11  luethje
## some bugfixes
##
## Revision 1.24  1997/05/15 22:32:41  luethje
## new version
##
## Revision 1.23  1997/05/11 22:59:14  luethje
## new version
##
## Revision 1.22  1997/05/10 01:20:52  luethje
## some primitive changes
##
## Revision 1.21  1997/05/09 23:30:37  luethje
## isdnlog: new switch -O
## isdnrep: new format %S
## bugfix in handle_runfiles()
##
## Revision 1.20  1997/05/06 22:13:21  luethje
## bugfixes in HTML-Code of the isdnrep
##
## Revision 1.19  1997/05/05 21:22:14  luethje
## new version
##
## Revision 1.18  1997/05/04 20:19:34  luethje
## README completed
## isdnrep finished
## interval-bug fixed
##
## Revision 1.17  1997/04/20 23:44:46  luethje
## some primitve changes
##
## Revision 1.16  1997/04/20 22:55:14  luethje
## isdnrep has new features (Documentation will follow ;-)):
##   -variable format string
##   -can create html output (option -w1 or ln -s isdnrep isdnrep.cgi)
##    idea and design by Dirk Staneker (dirk.staneker@student.uni-tuebingen.de
## bugfix of processor.c from akool
##
## Revision 1.15  1997/04/17 23:29:39  luethje
## new structure of isdnrep completed.
##
## Revision 1.14  1997/04/16 22:22:43  luethje
## some bugfixes, README completed
##
## Revision 1.13  1997/04/15 22:36:58  luethje
## allows the character `"' in the program argument like the shell.
## some bugfixes.
##
## Revision 1.12  1997/04/15 00:19:53  luethje
## replace variables: some bugfixes, README comleted
##
## Revision 1.11  1997/04/10 23:32:04  luethje
## Added the feature, that environment variables are allowed in the config files.
##
## Revision 1.10  1997/04/08 21:56:42  luethje
## Create the file isdn.conf
## some bug fixes for pid and lock file
## make the prefix of the code in `isdn.conf' variable
##
## Revision 1.9  1997/04/08 00:02:05  luethje
## Bugfix: isdnlog is running again ;-)
## isdnlog creates now a file like /var/lock/LCK..isdnctrl0
## README completed
## Added some values (countrycode, areacode, lock dir and lock file) to
## the global menu
##
## Revision 1.8  1997/04/06 21:07:25  luethje
## renamed file isdnrep.c to rep_main.c and function.c to isdnrep.c
##
## Revision 1.7  1997/04/03 22:32:36  luethje
## copy the old config files into the new dirctory and create the new config files.
##
## Revision 1.6  1997/04/03 08:56:58  fritz
## Bugfix: Changes for bash-2.00.0:
##         workaround for empty list in for-loops.
##         workaround for missing allow_null_glob_expansion
## Bugfix: CONFIG_HASX11 was not reset on non-X11 systems.
##
## Revision 1.5  1997/03/24 22:52:00  luethje
## isdnrep completed.
##
## Revision 1.4  1997/03/24 04:03:12  fritz
## Added uninstall target, changed rootperm target.
##
## Revision 1.3  1997/03/24 01:42:31  fritz
## Added capbility to override CFLAGS from commandline.
##
## Revision 1.2  1997/03/23 23:11:48  luethje
## improved performance
##
## Revision 1.1  1997/03/23 19:22:33  fritz
## Make isdnlog configurable.
##
## Revision 2.6.37  1997/02/11  17:53:19  akool

.SUFFIXES:
.SUFFIXES: .c .o

SHELL			:= /bin/sh
GENCONF   := install/genconf

#
# autoconf generic stuff
#
PREFIX			:= @prefix@
EXEC_PREFIX		:= @exec_prefix@
BINDIR			:= @bindir@
SBINDIR			:= @sbindir@
LIBEXECDIR		:= @libexecdir@
DATADIR			:= @datadir@
SYSCONFDIR		:= @sysconfdir@
SHAREDSTATEDIR		:= @sharedstatedir@
LOCALSTATEDIR		:= @localstatedir@
LIBDIR			:= @libdir@
INFODIR			:= @infodir@
INCLUDEDIR		:= @includedir@
OLDINCLUDEDIR		:= @oldincludedir@
MANDIR			:= @mandir@
MAN1DIR			:= $(MANDIR)/man1
MAN5DIR			:= $(MANDIR)/man5
MAN8DIR			:= $(MANDIR)/man8
MAN1EXT			:= .1
MAN5EXT			:= .5
MAN8EXT			:= .8
SRCDIR			:= @srcdir@

#
# end of autoconf generic stuff
#

#
# autoconf isdnlog specific stuff
#
INSTALL			:= @INSTALL@
INSTALL_DIR		:= $(INSTALL) -m 0755 -o 0 -g 0 -d
INSTALL_SBIN		:= $(INSTALL) -m 0700 -o 0 -g 0
INSTALL_BIN		:= $(INSTALL) -m 0755 -o 0 -g 0
INSTALL_DATA		:= $(INSTALL) -m 0644 -o 0 -g 0

BZIP2                   := @BZIP2@
BUNZIP2                 := $(BZIP2) -f -d
AWK				= @AWK@
SED				= @SED@

LIBISDNDIR		:= @LIBISDNDIR@
I4LCONFDIR		:= @I4LCONFDIR@
CONFFILE		:= @CONFFILE@
CALLERIDFILE		:= @CALLERIDFILE@
OLDCONFDIR		:= @OLDCONFDIR@
OLDCONFFILE		:= @OLDCONFFILE@
RUNDIR			:= @RUNDIR@
DBMLIB			:= @DBMLIB@
POSTGRES		:= @POSTGRES@
POSTGRESDIR		:= @POSTGRESDIR@
MYSQLDB			:= @MYSQLDB@
MYSQLDIR		:= @MYSQLDIR@
ORACLE			:= @ORACLE@
SERV_PORT		:= @SERV_PORT@
USERFILE		:= @USERFILE@
CDBEXTRALIBS		:= @CDBEXTRALIBS@
DEFS			:=
SUBDIRS			:= tools/zone tools/dest

export NATION		:= @NATION@

export LOGFILE		:= @LOGFILE@
export COUNTRYCODE	:= @COUNTRYCODE@
export COUNTRYPREFIX	:= @COUNTRYPREFIX@
export AREAPREFIX	:= @AREAPREFIX@

# store I4L-Version for make commands issued in the isdnlog subdirectory.
# In this case the export of I4L-Version by the global makefile does not take
# place because this makefile is not evaluated.
STORED_I4LVERSION       := @I4LVERSION@

export ILABEL        := %b %e %T %ICall to tei %t from %N2 on %n2
export OLABEL        := %b %e %T %Itei %t calling %N2 with %n2
export CHARGEMAX     := 1000.00

ifndef ROOTDIR
export ROOTDIR=$(shell pwd)
MAKELIB  =1
else
#PREFIXDIR=$(ROOTDIR)
endif

PREFIXDIR=.

ifeq ($(MAKELIB),1)
SUBDIRS     += $(LIBISDNDIR)
endif

# export CFLAGS  = -Wall -pipe -O6 -fomit-frame-pointer -fforce-mem -fforce-addr -funroll-loops -fstrength-reduce

export CFLAGS  = -Wall -pipe
ifndef _CC
export _CC  = gcc
endif

CC          = $(_CC)

INCLUDE     = -I./isdnlog -I./connect -I./tools -I$(PREFIXDIR) -I$(LIBISDNDIR)

LIB         = $(DBMLIB) -lm

SERVICEFILE = /etc/services

# enable following line to convert data files from UTF-8 to ISO-8859-1
# NO_UTF8=1

######################################################################
# DON'T EDIT BELOW THIS LINE
######################################################################

# next line must match basic regexp "^VERSION \+= \+" and contain only
# the isdnlog version number after it. 
VERSION     = 4.71

# fallback to I4L-Version as set at configure time
ifndef (I4LVERSION)
I4LVERSION := $(STORED_I4LVERSION)
endif

# CSEXT is the file name suffix added to source files after conversion
# from UTF-8 to the ISO-8859-1 charset took place.  Empty by default.
CSEXT =

# all test for NO_UTF8 compare it with 1, so that NO_UTF8=0 works as expected
ifeq ($(NO_UTF8), 1)

export NO_UTF8

CSEXT = .latin1

# NO_UTF8_CONV will be used as filter command, prior overwrite possible
ifndef NO_UTF8_CONV 
NO_UTF8_CONV := iconv -f UTF-8 -t ISO-8859-1
endif
export NO_UTF8_CONV

# files which have to be recoded for make all
# use .conf.in files for selection; .conf files may not created yet
# use .*. instead of .??. as there may be .default. some day
NO_UTF8_FILES := $(wildcard samples/isdn.conf.*.in)
NO_UTF8_FILES += samples/isdn.conf.in
NO_UTF8_FILES := $(patsubst %.in,%,$(NO_UTF8_FILES))
NO_UTF8_FILES += $(wildcard samples/rate.conf.*)
NO_UTF8_FILES += $(wildcard holiday-*.dat)
NO_UTF8_FILES += $(wildcard rate-*.dat)
NO_UTF8_FILES += country-de.dat
# discard already recoded files
NO_UTF8_FILES := $(filter-out %$(CSEXT),$(NO_UTF8_FILES))
# convert to names of recoded files
NO_UTF8_FILES := $(patsubst %,%$(CSEXT),$(NO_UTF8_FILES))

# pattern rule that does the recoding
%$(CSEXT): %
	$(NO_UTF8_CONV) < $< > $@

endif

# Used for all and distclean, 
# including sample config files after text substitution.
MANPAGES    = isdnlog/callerid.conf.5 isdnlog/isdn.conf.5 \
	      isdnlog/isdnformat.5 isdnlog/isdnlog.5 isdnlog/isdnlog.8 \
	      isdnlog/isdnlog.users.5 isdnrep/isdnrep.1 isdnconf/isdnconf.1 \
	      tools/isdnrate.1 tools/rate-files.5 tools/rate.conf.5 \
	      isdnrep/isdnbill.1
MANPAGES   += samples/isdn.conf \
	      samples/isdn.conf.at samples/isdn.conf.de samples/isdn.conf.lu \
	      samples/isdn.conf.nl samples/isdn.conf.no samples/isdn.conf.pl

ifeq ($(POSTGRES),1)
DEFS       += -DPOSTGRES
INCLUDE    += -I$(POSTGRESDIR)/include
LIB        += -L$(POSTGRESDIR)/lib -lpq
endif

ifeq ($(MYSQLDB),1)
DEFS 	   += -DMYSQLDB
INCLUDE    += -I$(MYSQLDIR)/include
LIB        += -L$(MYSQLDIR)/lib/mysql -L$(MYSQLDIR)/lib -lmysqlclient -lm
endif

ifeq ($(ORACLE),1)
DEFS       += -DORACLE
INCLUDE    += -I$(ORACLE_HOME)/precomp/public
ORALIBS = -L$(ORACLE_HOME)/lib \
	-lclntsh $(ORACLE_HOME)/lib/scorept.o $(ORACLE_HOME)/lib/sscoreed.o \
    $(ORACLE_HOME)/rdbms/lib/kpudfo.o \
    -lclient -lsql $(ORACLE_HOME)/lib/nautab.o $(ORACLE_HOME)/lib/naeet.o \
    $(ORACLE_HOME)/lib/naect.o $(ORACLE_HOME)/lib/naedhs.o \
    `cat $(ORACLE_HOME)/lib/naldflgs` \
    -lnetv2 -lnttcp -lnetwork -lncr -lnetv2 -lnttcp -lnetwork \
    -lclient -lvsn -lcommon -lgeneric -lmm -lnlsrtl3 -lcore4 \
    -lnlsrtl3 -lcore4 -lnlsrtl3 -lnetv2 -lnttcp -lnetwork -lncr \
    -lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon -lgeneric \
    $(ORACLE_HOME)/lib/libplsf.a $(ORACLE_HOME)/lib/libplsb.a \
    $(ORACLE_HOME)/lib/libextp.a \
    -lepc -lnlsrtl3  -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lclient \
    -lvsn -lcommon -lgeneric -lnlsrtl3  -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 \
    `cat $(ORACLE_HOME)/lib/sysliblist` -ldl -lm
endif

ifdef DBMALLOC
DEFS       += -DDBMALLOC=1
LIB        += -ldbmalloc
endif

DEFS       += \
               -DVERSION=\"$(VERSION)\"   \
               -DI4LVERSION=\"$(I4LVERSION)\"   \
	       -D@NATION_MACRO@=1		\
 	       -DNATION=\"$(NATION)\"		\
	       -DBIG_PHONE_NUMBERS=1
ifdef ILP
DEFS	+= -DILP=1
endif

ifdef IIOCNETGPN
DEFS += -DIIOCNETGPN=-1
endif

PC = proc
PCFLAGS = mode=oracle ireclen=160 lines=yes

%.o: %.c
	$(CC) $(CFLAGS) $(DEFS) $(INCLUDE) -fno-strict-aliasing -c -o $@ $<

%.1: %.man
	MANDATE=`grep CHECKIN $< | $(AWK) '{print $$4}'`; \
	$(SED) -e s%@MANDATE@%$$MANDATE%g $< > $@

%.5: %.man
	MANDATE=`grep CHECKIN $< | $(AWK) '{print $$4}'`; \
	$(SED) -e s%@MANDATE@%$$MANDATE%g $< > $@

%.1: %.1.in config.status
	./config.status $@

%.5: %.5.in config.status
	./config.status $@

%.8: %.8.in config.status
	./config.status $@

samples/isdn.conf.%: samples/isdn.conf.%.in config.status
	./config.status $@

# samples/isdn.conf is not matched by the rule rule above,
# a regular rule for it can be found further below after all

ISDNLOG_OBJS =  isdnlog/isdnlog.o isdnlog/processor.o isdnlog/functions.o \
                isdnlog/server.o isdnlog/start_prog.o isdnlog/messages.o  \
                connect/connect.o connect/socket.o tools/tools.o      	  \
                connect/conv_address.o isdnlog/user_access.o 		  \
                tools/isdnconf.o tools/telnum.o tools/dest.o		  \
		tools/rate.o tools/rate_skip.o                            \
		tools/zone.o tools/holiday.o tools/zone/upack.o           \
		isdnlog/asn1.o isdnlog/asn1_generic.o isdnlog/asn1_aoc.o  \
		isdnlog/asn1_address.o isdnlog/asn1_diversion.o           \
		isdnlog/asn1_basic_service.o isdnlog/asn1_comp.o          \
		$(LIBISDNDIR)/libisdn.a $(CDBEXTRALIBS)


ifeq ($(POSTGRES),1)
ISDNLOG_OBJS += isdnlog/postgres.o
endif

ifeq ($(MYSQLDB),1)
ISDNLOG_OBJS += isdnlog/mysqldb.o
endif

ifeq ($(ORACLE),1)
ISDNLOG_OBJS += isdnlog/oracle.o
endif

ifdef TESTCENTER
ISDNLOG_OBJS += isdnlog/test_center.o
endif

ifdef ILP
ISDNLOG_OBJS += isdnlog/ilp/ilp.o
endif


ISDNREP_OBJS =  isdnrep/rep_main.o tools/tools.o tools/isdnconf.o         \
                isdnlog/messages.o isdnrep/isdnrep.o isdnrep/opt_time.o   \
		tools/rate.o tools/rate_skip.o                            \
		tools/zone.o tools/holiday.o tools/dest.o                 \
		tools/telnum.o tools/zone/upack.o		          \
                $(LIBISDNDIR)/libisdn.a $(CDBEXTRALIBS)

ISDNBILL_OBJS = isdnrep/isdnbill.o tools/tools.o tools/isdnconf.o         \
                isdnlog/messages.o					  \
		tools/rate.o tools/rate_skip.o                            \
		tools/zone.o tools/holiday.o tools/dest.o	          \
		tools/telnum.o tools/zone/upack.o			  \
                $(LIBISDNDIR)/libisdn.a $(CDBEXTRALIBS)

# Are these all necessary?  I believe they are not.  (tobiasb, 2005-02-05)
ISDNCONF_OBJS=  isdnconf/isdnconf.o tools/tools.o tools/isdnconf.o        \
		tools/rate.o tools/rate_skip.o                            \
		tools/zone.o tools/holiday.o                              \
		tools/telnum.o	tools/dest.o tools/zone/upack.o		  \
                $(LIBISDNDIR)/libisdn.a $(CDBEXTRALIBS)

ISDNRATE_OBJS=  tools/isdnrate.o tools/isdnconf.o tools/tools.o           \
		tools/rate.o tools/rate_skip.o                            \
		tools/zone.o tools/dest.o tools/holiday.o                 \
		tools/telnum.o tools/zone/upack.o			  \
                $(LIBISDNDIR)/libisdn.a $(CDBEXTRALIBS)


ORA_LOAD_OBJS= isdnlog/ora_load.o isdnlog/oracle.o
ISDNLOG      =  bin/isdnlog
ISDNCONF     =  bin/isdnconf
ISDNREP      =  bin/isdnrep
ISDNBILL     =  bin/isdnbill
ISDNRATE     =  bin/isdnrate
ORA_LOAD     =  bin/ora_load

MODS         =  *.o */*.o
ifdef ILP
MODS        +=  isdnlog/ilp/ilp.o 
endif

PROGS        =  $(ISDNLOG) $(ISDNREP) $(ISDNBILL) $(ISDNCONF) $(ISDNRATE)

# do not build isdnlog when NO_ISDNLOG=1 is given
ifeq ($(NO_ISDNLOG), 1)
PROGS       := $(filter-out $(ISDNLOG),$(PROGS))
endif

ifeq ($(ORACLE),1)
PROGS += $(ORA_LOAD)
endif

all:            depend libs mybin progs $(MANPAGES)

# have data files recoded during make all
ifeq ($(NO_UTF8), 1)
all: recode-data

recode-data: $(NO_UTF8_FILES)
endif


ifdef IIOCNETGPN
ISDNLOG_OBJS += isdnlog/kernel_2_0/iiocnetgpn.o
isdnlog/kernel_2_0/iiocnetgpn.o:	isdnlog/kernel_2_0/iiocnetgpn.c
	cd isdnlog/kernel_2_0 && make 
endif	

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck

samples/isdn.conf: samples/isdn.conf.in config.status
	./config.status $@

# recompile when VERSION in Makefile changes for binaries with new version:
FILES_USING_VERSION = isdnlog/isdnlog.o isdnlog/processor.o isdnlog/user_access.o isdnrep/isdnrep.o isdnconf/isdnconf.o tools/isdnconf.o tools/tools.o
$(FILES_USING_VERSION): Makefile

options:
	@echo Making $< with
	@echo $(CC) $(CFLAGS) $(DEFS) $(INCLUDE)
ifeq ($(NO_ISDNLOG), 1)
	@echo Build of isdnlog itself disabled by NO_ISDNLOG=1
endif

progs:		options $(PROGS)

mybin:
		-mkdir -p bin

libs:
		set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i; done

clean:
		-rm -f $(MODS)
		set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i clean; done
ifdef IIOCNETGPN
	    cd isdnlog/kernel_2_0 && make clean
endif
ifeq ($(NO_UTF8), 1)
# an empty CSEXT would clear the entire directory
ifneq ($(strip $(CSEXT)),)
		-rm -f *$(CSEXT) samples/*$(CSEXT)
endif
endif

distclean:      clean
		-rm -f $(MANPAGES)
		-rm -f $(PROGS) .depend config.h config.status config.cache \
		config.log Makefile confdefs.h policy.h *~ *.gdbm *.cdb *.db
		set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i distclean; done

ifeq (.depend,$(wildcard .depend))
include .depend
HEADERS := $(HEADERS) .depend
endif

rootperm:
ifneq ($(NO_ROOTPERM), 1)
	@echo 'main(int argc,char**argv){unlink(argv[0]);return(getuid()==0);}'>g
	@if gcc -x c -o G g && rm -f g && ./G ; then \
		echo ""; echo 'Do "make (un)install" as root!' ;echo ""; false; \
	fi
endif

uninstall:
		if ps x | fgrep $(ISDNLOG) >/dev/null; then kill `cat $(RUNDIR)/isdnlog.isdnctrl0.pid` 2>/dev/null; fi
		rm -f	$(DESTDIR)$(SBINDIR)/$(ISDNLOG) \
			$(DESTDIR)$(BINDIR)/$(ISDNREP)	\
			$(DESTDIR)$(BINDIR)/$(ISDNCONF)
		rm -f	$(DESTDIR)$(MAN8DIR)/isdnlog$(MAN8EXT)		\
			$(DESTDIR)$(MAN1DIR)/isdnrep$(MAN1EXT)		\
			$(DESTDIR)$(MAN1DIR)/isdnconf$(MAN1EXT)		\
			$(DESTDIR)$(MAN5DIR)/callerid.conf$(MAN5EXT)	\
			$(DESTDIR)$(MAN5DIR)/isdnlog$(MAN5EXT)		\
			$(DESTDIR)$(MAN5DIR)/isdnlog.users$(MAN5EXT)    \
			$(DESTDIR)$(MAN1DIR)/isdnrate$(MAN1EXT)		\
			$(DESTDIR)$(MAN5DIR)/rate-files$(MAN5EXT)	\
			$(DESTDIR)$(MAN5DIR)/isdn.conf$(MAN5EXT)	\
			$(DESTDIR)$(MAN5DIR)/isdnformat$(MAN5EXT)	\
			$(DESTDIR)$(DATADIR)/country-$(NATION).dat	\
			$(DESTDIR)$(DATADIR)/rate-$(NATION).dat         \
			$(DESTDIR)$(DATADIR)/dest.gdbm			\
			$(DESTDIR)$(DATADIR)/dest.db			\
			$(DESTDIR)$(DATADIR)/dest.cdb


installdirs:
		$(INSTALL_DIR) $(DESTDIR)$(I4LCONFDIR)
		$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
		$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
		$(INSTALL_DIR) $(DESTDIR)$(MAN1DIR)
		$(INSTALL_DIR) $(DESTDIR)$(MAN5DIR)
		$(INSTALL_DIR) $(DESTDIR)$(MAN8DIR)
		$(INSTALL_DIR) $(DESTDIR)$(DATADIR)

install: all installdirs install-conf install-data install-progs

install-old-conf:
		@if [ -n "$(DESTDIR)$(OLDCONFDIR)" -a "$(DESTDIR)$(OLDCONFDIR)" != '/' ] ; then \
			test ! -f "$(DESTDIR)$(OLDCONFDIR)/$(USERFILE)" || cp -auv $(DESTDIR)$(OLDCONFDIR)/$(USERFILE) $(DESTDIR)$(I4LCONFDIR) ; \
			if [ -f "$(DESTDIR)$(OLDCONFDIR)/$(OLDCONFFILE)" ] ; then \
				cp -auv $(DESTDIR)$(OLDCONFDIR)/$(OLDCONFFILE) $(DESTDIR)$(I4LCONFDIR) ; \
		 		mv $(DESTDIR)$(I4LCONFDIR)/$(OLDCONFFILE) $(DESTDIR)$(I4LCONFDIR)/$(OLDCONFFILE).old ; \
			fi ; \
		fi

install-conf:
		@for f in rate isdn ; do \
		        if [ ! -f "samples/$$f.conf.$(NATION)$(CSEXT)" ] ; then \
				echo ; \
				echo It looks like isdnlog doesn\'t know your countries config ; \
				echo Please read README.Internationalization. ; \
				echo ; \
				echo ; \
				sleep 3 ; \
			elif [ ! -f "$(DESTDIR)$(I4LCONFDIR)/$$f.conf" ]; then \
				$(INSTALL_DATA) samples/$$f.conf.$(NATION)$(CSEXT) $(DESTDIR)$(I4LCONFDIR)/$$f.conf ; \
				echo Please edit $(DESTDIR)$(I4LCONFDIR)/$$f.conf ; \
				sleep 2 ; \
			else \
				$(INSTALL_DATA) samples/$$f.conf.$(NATION)$(CSEXT) $(DESTDIR)$(I4LCONFDIR)/$$f.conf.new ; \
			fi ; \
		done
		@for f in callerid.conf isdnlog.isdnctrl0.options isdnlog.users ; do \
			if [ ! -f "$(DESTDIR)$(I4LCONFDIR)/$$f" ]; then \
				$(INSTALL_DATA) samples/$$f $(DESTDIR)$(I4LCONFDIR)/$$f ; \
				echo Please edit $(DESTDIR)$(I4LCONFDIR)/$$f ; \
				sleep 2 ; \
			else \
				$(INSTALL_DATA) samples/$$f $(DESTDIR)$(I4LCONFDIR)/$$f.new ; \
			fi ; \
		done
		@for f in stop ; do \
			if [ ! -f "$(DESTDIR)$(I4LCONFDIR)/$$f" ]; then \
				$(INSTALL_BIN) samples/$$f $(DESTDIR)$(I4LCONFDIR)/$$f ; \
				echo Please edit $(DESTDIR)$(I4LCONFDIR)/$$f ; \
				sleep 2 ; \
			else \
				$(INSTALL_BIN) samples/$$f $(DESTDIR)$(I4LCONFDIR)/$$f.new ; \
			fi ; \
		done


install-progs:
		$(INSTALL_BIN) $(ISDNREP)  $(DESTDIR)$(BINDIR)
		$(INSTALL_BIN) $(ISDNCONF) $(DESTDIR)$(BINDIR)
		$(INSTALL_BIN) $(ISDNRATE) $(DESTDIR)$(BINDIR)
		$(INSTALL_BIN) $(ISDNBILL) $(DESTDIR)$(BINDIR)
ifneq ($(NO_ISDNLOG), 1)
		$(INSTALL_BIN) $(ISDNLOG)  $(DESTDIR)$(SBINDIR)
		-@if (ps x | fgrep $(ISDNLOG) | grep -v grep) >/dev/null; then \
			kill -HUP `cat $(RUNDIR)/isdnlog.isdnctrl0.pid 2>/dev/null`; \
			echo "Restarting (the first) running isdnlog!" ; \
		fi
endif

# FIXME: "Installing /usr/local/lib/isdn/tools/dest/dest.cdb" is confusing
# because "/tools/dest" is only right for the source location of that file.
install-data:
		$(INSTALL_DATA) isdnlog/isdnlog.8       $(DESTDIR)$(MAN8DIR)/isdnlog$(MAN8EXT)
		$(INSTALL_DATA) isdnrep/isdnrep.1       $(DESTDIR)$(MAN1DIR)/isdnrep$(MAN1EXT)
		$(INSTALL_DATA) isdnrep/isdnbill.1      $(DESTDIR)$(MAN1DIR)/isdnbill$(MAN1EXT)
		$(INSTALL_DATA) isdnconf/isdnconf.1     $(DESTDIR)$(MAN1DIR)/isdnconf$(MAN1EXT)
		$(INSTALL_DATA) isdnlog/callerid.conf.5 $(DESTDIR)$(MAN5DIR)/callerid.conf$(MAN5EXT)
		$(INSTALL_DATA) isdnlog/isdnlog.5       $(DESTDIR)$(MAN5DIR)/isdnlog$(MAN5EXT)
		$(INSTALL_DATA) isdnlog/isdnlog.users.5 $(DESTDIR)$(MAN5DIR)/isdnlog.users$(MAN5EXT)
		$(INSTALL_DATA) isdnlog/isdn.conf.5 $(DESTDIR)$(MAN5DIR)/isdn.conf$(MAN5EXT)
		$(INSTALL_DATA) isdnlog/isdnformat.5 $(DESTDIR)$(MAN5DIR)/isdnformat$(MAN5EXT)
		$(INSTALL_DATA) tools/isdnrate.1     $(DESTDIR)$(MAN1DIR)/isdnrate$(MAN1EXT)
		$(INSTALL_DATA) tools/rate-files.5     $(DESTDIR)$(MAN5DIR)/rate-files$(MAN5EXT)
		$(INSTALL_DATA) tools/rate.conf.5     $(DESTDIR)$(MAN5DIR)/rate.conf$(MAN5EXT)
		$(INSTALL_DATA) country-de.dat$(CSEXT)	$(DESTDIR)$(DATADIR)/country.dat
		$(INSTALL_DATA) rate-$(NATION).dat$(CSEXT)      $(DESTDIR)$(DATADIR)/rate-$(NATION).dat
		$(INSTALL_DATA) holiday-$(NATION).dat$(CSEXT)   $(DESTDIR)$(DATADIR)/holiday-$(NATION).dat
		@for f in `ls zone-$(NATION)-*.gdbm zone-$(NATION)-*.db zone-$(NATION)-*.cdb tools/dest/dest.gdbm tools/dest/dest.db tools/dest/dest.cdb 2>/dev/null` ; do \
		  $(INSTALL_DATA) $$f $(DESTDIR)$(DATADIR); \
		  echo Installing $(DESTDIR)$(DATADIR)/$$f; \
		done
		@: || (grep isdnlog $(SERVICEFILE) >/dev/null) || \
		(echo "";echo "";echo "Add a line to the file $(SERVICEFILE)" ;echo "";echo ""; \
		echo "isdnlog $(SERV_PORT)/tcp        isdnlog" >> $(SERVICEFILE))

install-strip:
		$(MAKE) INSTALL_BIN='$(INSTALL_BIN) -s' \
			INSTALL_SBIN='$(INSTALL_SBIN) -s' install

distrib: distclean
		cd .. && tar cf /tmp/isdnlog-$(I4LVERSION).tar    \
		  isdnlog-$(I4LVERSION)/Makefile       \
		  isdnlog-$(I4LVERSION)/Isdn           \
		  isdnlog-$(I4LVERSION)/README         \
		  isdnlog-$(I4LVERSION)/NEWS           \
		  isdnlog-$(I4LVERSION)/COPYING        \
		  isdnlog-$(I4LVERSION)/BUGS           \
		  isdnlog-$(I4LVERSION)/TODO           \
		  isdnlog-$(I4LVERSION)/FAQ            \
		  isdnlog-$(I4LVERSION)/samples        \
		  isdnlog-$(I4LVERSION)/tools          \
		  isdnlog-$(I4LVERSION)/isdnconf       \
		  isdnlog-$(I4LVERSION)/isdnlog        \
		  isdnlog-$(I4LVERSION)/isdnrep        \
		  isdnlog-$(I4LVERSION)/connect        \
		  isdnlog-$(I4LVERSION)/lib            \
		  isdnlog-$(I4LVERSION)/contrib	       \
		  isdnlog-$(I4LVERSION)/bin
		gzip -f9 /tmp/isdnlog-$(I4LVERSION).tar
#		uuencode /tmp/isdnlog-$(I4LVERSION).tar.gz isdnlog-$(I4LVERSION).tar.gz > /tmp/isdnlog-$(I4LVERSION).uue

$(ISDNLOG):     $(ISDNLOG_OBJS)
		$(CC) -o $(ISDNLOG) $(LFLAGS) $(ISDNLOG_OBJS) $(ORALIBS) $(LIB)

$(ISDNREP):     $(ISDNREP_OBJS)
		$(CC) -o $(ISDNREP) $(LFLAGS) $(ISDNREP_OBJS) $(LIB)

$(ISDNBILL):    $(ISDNBILL_OBJS)
		$(CC) -o $(ISDNBILL) $(LFLAGS) $(ISDNBILL_OBJS) $(LIB)

$(ISDNCONF):    $(ISDNCONF_OBJS)
		$(CC) -o $(ISDNCONF) $(LFLAGS) $(ISDNCONF_OBJS) $(LIB)

$(ISDNRATE):    $(ISDNRATE_OBJS)
		$(CC) -o $(ISDNRATE) $(LFLAGS) $(ISDNRATE_OBJS) $(LIB)

$(ORA_LOAD):    $(ORA_LOAD_OBJS)
		$(CC) -o $(ORA_LOAD) $(LFLAGS) $(ORA_LOAD_OBJS) $(ORALIBS)

isdnlog/oracle.o: isdnlog/oracle.pc
	$(PC) $(PCFLAGS) include=isdnlog code=ansi_c lname=isdnlog/_kgw.lis \
		iname=$< oname=isdnlog/_kgw.c
	$(CC) $(CFLAGS) $(DEFS) $(INCLUDE) -o $@ -c isdnlog/_kgw.c
	$(RM) isdnlog/_kgw.c
	$(RM) isdnlog/_kgw.lis

tools/tools.h: $(LIBISDNDIR)/libisdn.h $(PREFIXDIR)/policy.h
		touch tools/tools.h

depend: .depend

# sed transforms "tools.o: tools/tools.c ..." to "tools/tools.o: ..."
.depend:
		$(CPP) -M $(CFLAGS) $(DEFS) $(INCLUDE) */*.c >.depend.tmp
		cat .depend.tmp | \
		sed -e"s%^\([A-Za-z0-9_]\+\)\.o: \([A-Za-z0-9_]\+\)/\1\.c %\2/\1.o: \2/\1.c %" > .depend
		rm -f .depend.tmp
ifeq ($(ORACLE),1)
		$(CPP) -M $(CFLAGS) $(DEFS) $(INCLUDE) - < isdnlog/oracle.pc | \
		sed s/-:/oracle.o:/ >>.depend
endif
#		$(CPP) -M $(CFLAGS) $(DEFS) $(INCLUDE) */*.c */*/*.c >.depend