Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -15,7 +15,7 @@
15 15
  *
16 16
  * You should have received a copy of the GNU General Public License 
17 17
  * along with this program; if not, write to the Free Software 
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 19
  */
20 20
 
21 21
 #include "pdb_server_backend.h"
Browse code

pdb: add daemon 'pdb_server' and optimising data compiler 'pdbt'

- add number portability database daemon and optimizing data compiler
- add debian packaging scripts for tool and daemon as well
- TODO:
- add documentation (run binaries with '-h' for now to get help)
- fix this redundant declaration of trie (dt* files) and logging (log*).
There exists already an implementation that uses the sr core parts for
this, but we import the proven implementation for now.
- add data helper scripts as well, they need some cleanup first
- initial implementation was done from Hardy Kahl @ 1&1 Internet Ag
- further bug fixes from Timo Reimann, timo dot reimann at 1und1 dot de

Henning Westerholt authored on 10/09/2009 16:35:05
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (C) 2009 1&1 Internet AG
3
+ *
4
+ * This file is part of sip-router, a free SIP server.
5
+ *
6
+ * sip-router is free software; you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation; either version 2 of the License, or
9
+ * (at your option) any later version
10
+ *
11
+ * sip-router is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License 
17
+ * along with this program; if not, write to the Free Software 
18
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
+ */
20
+
21
+#include "pdb_server_backend.h"
22
+#include "dtm.h"
23
+#include "log.h"
24
+#include <stdio.h>
25
+#include <string.h>
26
+
27
+
28
+
29
+
30
+struct dtm_node_t *mroot;
31
+
32
+
33
+
34
+
35
+int init_backend(char *filename)
36
+{
37
+	mroot=dtm_load(filename);
38
+	if (mroot == NULL) {
39
+		LERR("cannot load '%s'.\n", filename);
40
+		return -1;
41
+	}
42
+	return 0;
43
+}
44
+
45
+
46
+
47
+
48
+carrier_t lookup_number(char *number)
49
+{
50
+	carrier_t carrierid;
51
+	int nmatch=dtm_longest_match(mroot, number, strlen(number), &carrierid);
52
+	if (nmatch<=0) {
53
+		/* nothing found - return id 0 */
54
+		carrierid=0;
55
+	}
56
+	LINFO("request='%s', nmatch=%ld, carrier=%ld\n", number, (long int)nmatch, (long int)carrierid);
57
+	return carrierid;
58
+}