[r10376]: branches / 1.8 / modules / msilo / doc / msilo_admin.xml  Maximize  Restore  History

Download this file

704 lines (692 with data), 19.1 kB

  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
<!-- Module User's Guide -->
<chapter>
<title>&adminguide;</title>
<section>
<title>Overview</title>
<para>
This modules provides offline message storage for the &osipsname;. It
stores received messages for an offline user and sends them when the
user becomes online.
</para>
<para>
For each message, the modules stores <quote>Request-URI</quote>
(<quote>R-URI</quote>) only if it is a complete address of record
(<quote>username@hostname</quote>), &uri; from <quote>To</quote>
header, &uri; from <quote>From</quote> header, incoming time,
expiration time, content type and body of the message. If
<quote>R-URI</quote> is not an address of record (it might be the
contact address for current &sip; session) the &uri;
from <quote>To</quote> header will be used as <abbrev>R-URI</abbrev>.
</para>
<para>
When the expiration time passed, the message is discarded from
database. Expiration time is computed based on incoming time and
one of the module's parameters.
</para>
<para>
Every time when a user registers with &osips;, the module is looking in
database for offline messages intended for that user. All of them will
be sent to contact address provided in REGISTER request.
</para>
<para>
It may happen the &sip; user to be registered but his &sip; User Agent
to have no support for MESSAGE request. In this case it should be used
the <quote>failure_route</quote> to store the undelivered requests.
</para>
<para>
Another functionality provided by the modules is to send messages at
a certain time -- the reminder functionality. Using config logic, a
received message can be stored and delivered at a time specified while
storing with the 'snd_time_avp'.
</para>
</section>
<section>
<title>Dependencies</title>
<section>
<title>&osips; modules</title>
<para>
The following modules must be loaded before this module:
<itemizedlist>
<listitem>
<para>
<emphasis>database module</emphasis> - mysql, dbtext or other
module that implements the <quote>db</quote> interface and
provides support for storing/receiving data to/from a
database system.
</para>
</listitem>
<listitem>
<para>
<emphasis>TM</emphasis>--transaction module--is used to
send &sip; requests.
</para>
</listitem>
</itemizedlist>
</para>
</section>
<section>
<title>External libraries or applications</title>
<para>
The following libraries or applications must be installed before
running &osips; with this module:
<itemizedlist>
<listitem>
<para>
<emphasis>none</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section>
<section>
<title>Exported Parameters</title>
<section>
<title><varname>db_url</varname> (string)</title>
<para>
Database &url;.
</para>
<para>
<emphasis>
Default value is
<quote>&defaultdb;</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>db_url</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "db_url", "mysql://user:passwd@host.com/dbname")
...
</programlisting>
</example>
</section>
<section>
<title><varname>db_table</varname> (string)</title>
<para>
The name of table where to store the messages.
</para>
<para>
<emphasis>
Default value is <quote>silo</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>db_table</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "db_table", "silo")
...
</programlisting>
</example>
</section>
<section>
<title><varname>from_address</varname> (string)</title>
<para>
The &sip; address used to inform users that destination of their
message is not online and the message will be delivered next time
when that user goes online. If the parameter is not set, the module
will not send any notification. It can contain pseudo-variables.
</para>
<para>
<emphasis>
Default value is <quote>NULL</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>from_address</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "from_address", "sip:registrar@example.org")
modparam("msilo", "from_address", "sip:$rU@example.org")
...
</programlisting>
</example>
</section>
<section>
<title><varname>contact_hdr</varname> (string)</title>
<para>
The value of the Contact header (including header name and ending
\r\n) to be added in notification messages.
It can contain pseudo-variables.
</para>
<para>
<emphasis>
Default value is <quote>NULL</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>contact_hdr</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "contact_hdr", "Contact: &lt;sip:null@example.com&gt;\r\n")
...
</programlisting>
</example>
</section>
<section>
<title><varname>offline_message</varname> (string)</title>
<para>
The body of the notification message.
It can contain pseudo-variables.
</para>
<para>
<emphasis>
Default value is <quote>NULL</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>offline_message</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "offline_message", "*** User $rU is offline!")
modparam("msilo", "offline_message", "&lt;em&gt;I am offline!&lt;/em&gt;")
...
</programlisting>
</example>
</section>
<section>
<title><varname>content_type_hdr</varname> (string)</title>
<para>
The value of the Content-Type header (including header name and ending
\r\n) to be added in notification messages. It must reflect what the
'offline_message' contains.
It can contain pseudo-variables.
</para>
<para>
<emphasis>
Default value is <quote>NULL</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>content_type_hdr</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "content_type_hdr", "Content-Type: text/plain\r\n")
modparam("msilo", "content_type_hdr", "Content-Type: text/html\r\n")
...
</programlisting>
</example>
</section>
<section>
<title><varname>reminder</varname> (string)</title>
<para>
The &sip; address used to send reminder messages. If this value
is not set, the reminder feature is disabled.
</para>
<para>
<emphasis>
Default value is <quote>NULL</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>reminder</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "reminder", "sip:registrar@example.org")
...
</programlisting>
</example>
</section>
<section>
<title><varname>outbound_proxy</varname> (string)</title>
<para>
The &sip; address used as next hop when sending the message. Very
useful when using OpenSIPS with a domain name not in DNS, or when
using a separate OpenSIPS instance for msilo processing. If not set,
the message will be sent to the address in destination URI.
</para>
<para>
<emphasis>
Default value is <quote>NULL</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>outbound_proxy</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "outbound_proxy", "sip:opensips.org;transport=tcp")
...
</programlisting>
</example>
</section>
<section>
<title><varname>expire_time</varname> (int)</title>
<para>
Expire time of stored messages - seconds. When this time passed, the message is
silently discarded from database.
</para>
<para>
<emphasis>
Default value is <quote>259200 (72 hours = 3 days)</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>expire_time</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "expire_time", 36000)
...
</programlisting>
</example>
</section>
<section>
<title><varname>check_time</varname> (int)</title>
<para>
Timer interval to check if dumped messages are sent OK - seconds. The module keeps
each request send by itself for a new online user and if the reply is 2xx then the
message is deleted from database.
</para>
<para>
<emphasis>
Default value is <quote>30</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>check_time</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "check_time", 10)
...
</programlisting>
</example>
</section>
<section>
<title><varname>send_time</varname> (int)</title>
<para>
Timer interval in seconds to check if there are reminder messages.
The module takes all reminder messages that must be sent at that moment
or before that moment.
</para>
<para>
If the value is 0, the reminder feature is disabled.
</para>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>send_time</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "send_time", 60)
...
</programlisting>
</example>
</section>
<section>
<title><varname>clean_period</varname> (int)</title>
<para>
Number of <quote>check_time</quote> cycles when to check if
there are expired messages in database.
</para>
<para>
<emphasis>
Default value is <quote>5</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>clean_period</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "clean_period", 3)
...
</programlisting>
</example>
</section>
<section>
<title><varname>use_contact</varname> (int)</title>
<para>
Turns on/off the usage of the Contact address to send notification
back to sender whose message is stored by MSILO.
</para>
<para>
<emphasis>
Default value is <quote>1 (0 = off, 1 = on)</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>use_contact</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "use_contact", 0)
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_mid</varname> (string)</title>
<para>
The name of the column in silo table, storing message id.
</para>
<para>Default value is <quote>mid</quote>.</para>
<example>
<title>Set the <quote>sc_mid</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_mid", "other_mid")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_from</varname> (string)</title>
<para>
The name of the column in silo table, storing the source address.
</para>
<para>Default value is <quote>src_addr</quote>.</para>
<example>
<title>Set the <quote>sc_from</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_from", "source_address")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_to</varname> (string)</title>
<para>
The name of the column in silo table, storing the destination address.
</para>
<para>Default value is <quote>dst_addr</quote>.</para>
<example>
<title>Set the <quote>sc_to</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_to", "destination_address")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_uri_user</varname> (string)</title>
<para>
The name of the column in silo table, storing the user name.
</para>
<para>Default value is <quote>username</quote>.</para>
<example>
<title>Set the <quote>sc_uri_user</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_uri_user", "user")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_uri_host</varname> (string)</title>
<para>
The name of the column in silo table, storing the domain.
</para>
<para>Default value is <quote>domain</quote>.</para>
<example>
<title>Set the <quote>sc_uri_host</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_uri_host", "domain")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_body</varname> (string)</title>
<para>
The name of the column storing the message body in silo table.
</para>
<para>Default value is <quote>body</quote>.</para>
<example>
<title>Set the <quote>sc_body</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_body", "message_body")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_ctype</varname> (string)</title>
<para>
The name of the column in silo table, storing content type.
</para>
<para>Default value is <quote>ctype</quote>.</para>
<example>
<title>Set the <quote>sc_ctype</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_ctype", "content_type")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_exp_time</varname> (string)</title>
<para>
The name of the column in silo table, storing the expire time of the message.
</para>
<para>Default value is <quote>exp_time</quote>.</para>
<example>
<title>Set the <quote>sc_exp_time</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_exp_time", "expire_time")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_inc_time</varname> (string)</title>
<para>
The name of the column in silo table, storing the incoming time of the message.
</para>
<para>Default value is <quote>inc_time</quote>.</para>
<example>
<title>Set the <quote>sc_inc_time</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_inc_time", "incoming_time")
...
</programlisting>
</example>
</section>
<section>
<title><varname>sc_snd_time</varname> (string)</title>
<para>
The name of the column in silo table, storing the send time for the reminder.
</para>
<para>Default value is <quote>snd_time</quote>.</para>
<example>
<title>Set the <quote>sc_snd_time</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "sc_snd_time", "send_reminder_time")
...
</programlisting>
</example>
</section>
<section>
<title><varname>snd_time_avp</varname> (str)</title>
<para>
The name of an AVP which may contain the time when to sent
the received message as reminder.The AVP is used ony by m_store().
</para>
<para>
If the parameter is not set, the module does not look for this AVP. If
the value is set to a valid AVP name, then the module expects in the AVP
to be a time value in format YYYYMMDDHHMMSS (e.g., 20060101201500).
</para>
<para>
<emphasis>
Default value is <quote>null</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>snd_time_avp</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "snd_time_avp", "$avp(snd_time_avp)")
...
</programlisting>
</example>
</section>
<section>
<title><varname>add_date</varname> (int)</title>
<para>
Wheter to add as prefix the date when the message was stored.
</para>
<para>
<emphasis>
Default value is <quote>1</quote> (1==on/0==off).
</emphasis>
</para>
<example>
<title>Set the <quote>add_date</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "add_date", 0)
...
</programlisting>
</example>
</section>
<section>
<title><varname>max_messages</varname> (int)</title>
<para>
Maximum number of stored message for an AoR. Value 0
equals to no limit.
</para>
<para>
<emphasis>
Default value is 0.
</emphasis>
</para>
<example>
<title>Set the <quote>max_messages</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("msilo", "max_messages", 0)
...
</programlisting>
</example>
</section>
</section>
<section>
<title>Exported Functions</title>
<section>
<title><function moreinfo="none">m_store([owner])</function></title>
<para>
The method stores certain parts of the current &sip; request (it
should be called when the request type is MESSAGE and the destination
user is offline or his UA does not support MESSAGE requests). If the
user is registered with a UA which does not support MESSAGE requests
you should not use mode=<quote>0</quote> if you have
changed the request uri with the contact address of user's &ua;.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>owner</emphasis> - is a string that must contain
a SIP URI in whose inbox the message will be stored. It can have
any pseudo variable. If "owner" is missing, the SIP address is
taken from R-URI.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
</para>
<example>
<title><function>m_store</function> usage</title>
<programlisting format="linespecific">
...
m_store();
m_store("$tu");
...
</programlisting>
</example>
</section>
<section>
<title><function moreinfo="none">m_dump([owner])</function></title>
<para>
The method sends stored messages for the &sip; user that is going to
register to his actual contact address. The method should be called
when a REGISTER request is received and the <quote>Expire</quote>
header has a value greater than zero.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>owner</emphasis> - is a string that must contain
a SIP URI whose inbox will be dumped. It can have
any pseudo variable. If "owner" is missing, the SIP address is
taken from To URI.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from REQUEST_ROUTE.
</para>
<example>
<title><function>m_dump</function> usage</title>
<programlisting format="linespecific">
...
m_dump();
m_dump("$fu");
...
</programlisting>
</example>
</section>
</section>
<section>
<title>Exported Statistics</title>
<section>
<title>stored_messages</title>
<para>
The number of messages stored by msilo.
</para>
</section>
<section>
<title>dumped_messages</title>
<para>
The number of dumped messages.
</para>
</section>
<section>
<title>failed_messages</title>
<para>
The number of failed dumped messages.
</para>
</section>
<section>
<title>dumped_reminders</title>
<para>
The number of dumped reminder messages.
</para>
</section>
<section>
<title>failed_reminders</title>
<para>
The number of failed reminder messages.
</para>
</section>
</section>
<section>
<title>Installation and Running</title>
<section>
<title>&osips; config file</title>
<para>
Next picture displays a sample usage of msilo.
</para>
<example>
<title>&osips; config script - sample msilo usage</title>
<programlisting format="linespecific">
...
&msilocfg;
...
</programlisting>
</example>
</section>
</section>
</chapter>

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks