File: README

package info (click to toggle)
openser 1.1.0-9etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,828 kB
  • ctags: 11,809
  • sloc: ansic: 120,528; sh: 5,249; yacc: 1,716; makefile: 1,261; php: 656; perl: 205; sql: 190
file content (393 lines) | stat: -rw-r--r-- 10,508 bytes parent folder | download
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

SpeedDial Module

Elena-Ramona Modroiu

   voice-system.ro

Edited by

Elena-Ramona Modroiu

   Copyright  2004 voice-system.ro
     _________________________________________________________

   Table of Contents
   1. User's Guide

        1.1. Overview
        1.2. Dependencies

              1.2.1. OpenSER Modules
              1.2.2. External Libraries or Applications

        1.3. Exported Parameters

              1.3.1. db_url (string)
              1.3.2. user_column (string)
              1.3.3. domain_column (string)
              1.3.4. sd_user_column (string)
              1.3.5. sd_domain_column (string)
              1.3.6. new_uri_column (string)
              1.3.7. domain_prefix (string)
              1.3.8. use_domain (int)

        1.4. Exported Functions

              1.4.1. sd_lookup(table)

        1.5. Installation & Running

              1.5.1. Database setup
              1.5.2. OpenSER config file

   2. Developer's Guide
   3. Frequently Asked Questions

   List of Examples
   1-1. Set db_url parameter
   1-2. Set user_column parameter
   1-3. Set domain_column parameter
   1-4. Set sd_user_column parameter
   1-5. Set sd_domain_column parameter
   1-6. Set new_uri_column parameter
   1-7. Set domain_prefix parameter
   1-8. Set use_domain parameter
   1-9. sd_lookup usage
   1-10. speeddial sql script
   1-11. OpenSER config script - sample speeddial usage
     _________________________________________________________

Chapter 1. User's Guide

1.1. Overview

   This module provides on-server speed dial facilities. An user
   can store records consisting of pairs short numbers (2 digits)
   and SIP addresses into a table of SER. Then it can dial the
   two digits whenever he wants to call the SIP address
   associated with those digits.
     _________________________________________________________

1.2. Dependencies

1.2.1. OpenSER Modules

   The following modules must be loaded before this module:

     * database module (mysql, dbtext, ...).
     * sl - stateless module.
     _________________________________________________________

1.2.2. External Libraries or Applications

   The following libraries or applications must be installed
   before running OpenSER with this module loaded:

     * None.
     _________________________________________________________

1.3. Exported Parameters

1.3.1. db_url (string)

   The URL of database where the table containing speed dial
   records.

   Default value is DEFAULT_RODB_URL. 

   Example 1-1. Set db_url parameter
...
modparam("speeddial", "db_url", "mysql://openser:xxx@localhost/openser"
)
...
     _________________________________________________________

1.3.2. user_column (string)

   The name of column storing the user name of the owner of the
   speed dial record.

   Default value is "username". 

   Example 1-2. Set user_column parameter
...
modparam("speeddial", "user_column", "userid")
...
     _________________________________________________________

1.3.3. domain_column (string)

   The name of column storing the domain of the owner of the
   speed dial record.

   Default value is "domain". 

   Example 1-3. Set domain_column parameter
...
modparam("speeddial", "domain_column", "userdomain")
...
     _________________________________________________________

1.3.4. sd_user_column (string)

   The name of the column storing the user part of the short dial
   address.

   Default value is "sd_username". 

   Example 1-4. Set sd_user_column parameter
...
modparam("speeddial", "sd_user_column", "short_user")
...
     _________________________________________________________

1.3.5. sd_domain_column (string)

   The name of the column storing the domain of the short dial
   address.

   Default value is "sd_domain". 

   Example 1-5. Set sd_domain_column parameter
...
modparam("speeddial", "sd_domain_column", "short_domain")
...
     _________________________________________________________

1.3.6. new_uri_column (string)

   The name of the column containing the URI that will be use to
   replace the short dial URI.

   Default value is "new_uri". 

   Example 1-6. Set new_uri_column parameter
...
modparam("speeddial", "new_uri_column", "real_uri")
...
     _________________________________________________________

1.3.7. domain_prefix (string)

   If the domain of the owner (From URI) starts with the value of
   this parameter, then it is stripped before performing the
   lookup of the short number.

   Default value is NULL. 

   Example 1-7. Set domain_prefix parameter
...
modparam("speeddial", "domain_prefix", "tel.")
...
     _________________________________________________________

1.3.8. use_domain (int)

   The parameter specifies wheter or not to use the domain when
   searching a speed dial record (0 - no domain, 1 - use domain
   from From URI, 2 - use both domains, from From URI and from
   request URI).

   Default value is 0. 

   Example 1-8. Set use_domain parameter
...
modparam("speeddial", "use_domain", 1)
...
     _________________________________________________________

1.4. Exported Functions

1.4.1. sd_lookup(table)

   The function lookups the short dial number from R-URI in
   'table' and replaces the R-URI with associated address.

   Meaning of the parameters is as follows:

     * table - The name of the table storing the speed dial
       records.

   This function can be used from REQUEST_ROUTE.

   Example 1-9. sd_lookup usage
...
# 'speed_dial' is the default table name created by openser db script
if(uri=~"sip:[0-9]{2}@.*")
        sd_lookup("speed_dial");
...
     _________________________________________________________

1.5. Installation & Running

1.5.1. Database setup

   Before using speeddial module, you have to create the database
   table where the short dial addresses are stored. If the table
   was not created at the installation time, you can use the
   following SQL script (tested with MySQL) as template.
   Database, the table name, and column names can be set with
   module parameters so they can be changed.

   Example 1-10. speeddial sql script
...
CREATE TABLE speed_dial (
  username varchar(64) NOT NULL default '',
  domain varchar(128) NOT NULL default '',
  sd_username varchar(64) NOT NULL default '',
  sd_domain varchar(128) NOT NULL default '',
  new_uri varchar(192) NOT NULL default '',
  description varchar(64) NOT NULL default '',
  PRIMARY KEY (username, domain, sd_domain, sd_username)
);

...
     _________________________________________________________

1.5.2. OpenSER config file

   Next picture displays a sample usage of speeddial.

   Example 1-11. OpenSER config script - sample speeddial usage
...
#
# $Id: README,v 1.6 2006/07/10 13:51:47 bogdan_iancu Exp $
#
# sample config script to use speeddial module
#

# ----------- global configuration parameters ------------------------

check_via=no    # (cmd. line: -v)
dns=no          # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
fifo="/tmp/ser_fifo"

# ------------------ module loading ----------------------------------

loadmodule "/usr/local/lib/openser/modules/sl.so"
loadmodule "/usr/local/lib/openser/modules/tm.so"
loadmodule "/usr/local/lib/openser/modules/rr.so"
loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
loadmodule "/usr/local/lib/openser/modules/usrloc.so"
loadmodule "/usr/local/lib/openser/modules/registrar.so"
loadmodule "/usr/local/lib/openser/modules/textops.so"
loadmodule "/usr/local/lib/openser/modules/mysql.so"
loadmodule "/usr/local/lib/openser/modules/speeddial.so"

# ----------------- setting module-specific parameters ---------------

# -- usrloc params --

modparam("usrloc", "db_mode",   0)

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

# -------------------------  request routing logic -------------------

# main routing logic
route{

        # initial sanity checks
        if (!mf_process_maxfwd_header("10"))
        {
                sl_send_reply("483","Too Many Hops");
                break;
        };
        if (msg:len >=  max_len )
        {
                sl_send_reply("513", "Message too big");
                break;
        };

        if (!method=="REGISTER") record_route();

        if (loose_route())
        {
                if (!t_relay())
                {
                        sl_reply_error();
                };
                break;
        };

        if (!uri==myself)
        {
                if (!t_relay())
                {
                        sl_reply_error();
                };
                break;
        };

        if (uri==myself)
        {
                if (method=="REGISTER")
                {
                        save("location");
                        break;
                };

                if(uri=~"sip:[0-9]{2}@.*")
                        sd_lookup("speeddial");

                lookup("aliases");
                if (!uri==myself)
                {
                        if (!t_relay())
                        {
                                sl_reply_error();
                        };
                        break;
                };

                if (!lookup("location"))
                {
                        sl_send_reply("404", "Not Found");
                        break;
                };
        };

        if (!t_relay())
        {
                sl_reply_error();
        };
}


...
     _________________________________________________________

Chapter 2. Developer's Guide

   The module does not provide any API to use in other OpenSER
   modules.
     _________________________________________________________

Chapter 3. Frequently Asked Questions

   3.1. Where can I post a question about this module?
   3.2. How can I report a bug?

   3.1. Where can I post a question about this module?

   Sent an email to <team@openser.org> or, if you want to keep
   the mail private, send it to <ramona@voice-system.ro>.

   Remember: first at all, check if your question was already
   answered on one of OpenSER mailing lists:

     * User Mailing List -
       http://openser.org/cgi-bin/mailman/listinfo/users
     * Developer Mailing List -
       http://openser.org/cgi-bin/mailman/listinfo/devel

   3.2. How can I report a bug?

   Accumulate as much as possible information (OpenSER version,
   ser -V output, your OS (uname -a), OpenSER logs, network
   dumps, core dump files, configuration file) and send a mail to
   <support@voice-system.ro>