Browse code

Readme renamed

Elena-Ramona Modroiu authored on 02/06/2003 15:06:05
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,136 @@
0
+#
1
+#$Id$
2
+#
3
+
4
+ PDT - prefix-domain translation
5
+ ===============================
6
+
7
+1.Description
8
+-------------
9
+
10
+This module translates numerical codes into domains and update accordingly 
11
+the R-URI.
12
+
13
+The module looks up at the R-URI part of a message and if the user part begins 
14
+with an established prefix it will update the uri. Updating the uri consists 
15
+of: read the code after the prefix from the user part of the uri and keep the
16
+rest as the user part of the new uri. The host part will be the domain matched 
17
+for the leading code.
18
+
19
+    [<prefix>]<code><userid><:password>@<mydomain.com> ...
20
+    
21
+    and the result will be:
22
+    
23
+    <userid><:password>@<domain[:port]>...
24
+    
25
+Example:
26
+    prefix=2
27
+    code=3330
28
+    domain[3330]=iptel.org
29
+    
30
+    
31
+    2333091001@mydomain.com  => 91001@iptel.org    
32
+    
33
+The code is always ended with a special digit (a parameter of the module).
34
+This digit will not be inside the code at all.
35
+
36
+2.Exported symbols
37
+------------------
38
+Methods
39
+-------
40
+
41
+Name: 	prefix2domain
42
+Params:	none
43
+Desc:	build a new uri if it is necessary. Returns 1 when the translation was
44
+        made or there was nothing to translate (user part of the URI is empty
45
+		or it does not match the prefix parameter). Returns -1 in error cases.
46
+
47
+
48
+Parameters
49
+----------
50
+
51
+Name:		db_url
52
+Type:		string
53
+Default:	sql://root@127.0.0.1/pdt
54
+Desc:		SQL URL of database - username, password, host, port and 
55
+		database (ex: sql://username:password@hostname.com/database)
56
+
57
+
58
+Name:		db_table
59
+Type:		string
60
+Default:	domains
61
+Desc:		table name
62
+
63
+
64
+Name:		terminator
65
+Type:		int
66
+Default:	0
67
+Desc:		the digit ending a code
68
+
69
+
70
+Name:		start_range
71
+Type:		int
72
+Default:	10
73
+Desc:		default start value for allocating prefixes
74
+
75
+
76
+Name:		prefix
77
+Type:		string
78
+Default:	NULL
79
+Desc:		default prefix who denotes what uri needs to be translated
80
+            -- if it is NULL the module will not check the R-URI against it and
81
+            the code is considered starting from the first digit. Otherwise, the
82
+            module will check first if the R-URI starts with it and will skip it
83
+            to find the code
84
+
85
+Name:       	hsize_2pow
86
+Type:       	int
87
+Default:    	4
88
+Desc:       	number of the hash entries = 2^hash_size
89
+
90
+
91
+3.Module dependences
92
+-------------------
93
+- MYSQL
94
+
95
+
96
+4.Other information
97
+-------------------
98
+- see SQL script for creating databases and a sample of cfg file in './doc/'
99
+- the web interface is in doc/web/ and the SQL script for creating the database
100
+for user interface is './doc/admin.sql'.
101
+- sample shell script to use with fifo interface is './doc/fifo.sh'.
102
+
103
+Contacts
104
+--------
105
+- for any suggestion/bug contact:
106
+	<serhelp@iptel.org>
107
+
108
+
109
+5.Some details
110
+
111
+
112
+The module registers also a function that works with the fifo server
113
+( get_domaincode ). 
114
+That will provide support for a web user interface which will be used by admins
115
+to register new domains and by simple users to find the code for a domain.
116
+
117
+
118
+Registered domains are stored in a database and in tables in share memory. The 
119
+database is kept consistent with the tables in memory. When a new domain is 
120
+registered the information goes first in the database and only than in tables 
121
+in share memory.  
122
+        
123
+Data in share memory is kept in hashtables to have fast searches. Searches are 
124
+possible for domains, but also for codes. Searches for codes are necessary more 
125
+often, every time when a message that needs to be translated passes through SER.
126
+Searches for domains are requested by the user interface only.
127
+
128
+Through the web interface a normal user can find the code for a domain and a 
129
+privileged user (i.e., admins) can register new domains too.
130
+The web interface also encounters problems of mutual exclusion. Any user of the 
131
+interface posts a request to the fifo server and waits his response in a file. 
132
+The file must be unique per user to avoid interfering responses for different 
133
+simultaneous user. That problem is solved using session per user offered by 
134
+the PHP language.
135
+