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
|
dialog Module
Bogdan-Andrei Iancu
Voice Sistem SRL
Edited by
Bogdan-Andrei Iancu
Copyright 2006 voice-system.ro
_________________________________________________________
Table of Contents
1. User's Guide
1.1. Overview
1.2. How it works
1.3. Dependencies
1.3.1. OpenSER Modules
1.3.2. External Libraries or Applications
1.4. Exported Parameters
1.4.1. enable_stats (integer)
1.4.2. hash_size (integer)
1.4.3. rr_param (string)
1.4.4. dlg_flag (integer)
1.4.5. timeout_avp (string)
1.4.6. default_timeout (integer)
1.4.7. use_tight_match (integer)
1.5. Exported Functions
1.6. Exported statistics
1.6.1. active_dialogs
1.6.2. processed_dialogs
1.6.3. expired_dialogs
1.7. Exported pseudo-variables
1.7.1. $dlg_count
2. Developer's Guide
2.1. Available Functions
2.1.1. register_dlgcb (dialog, type, cb, param)
3. Frequently Asked Questions
List of Examples
1-1. Set enable_stats parameter
1-2. Set hash_size parameter
1-3. Set rr_param parameter
1-4. Set dlg_flag parameter
1-5. Set timeout_avp parameter
1-6. Set default_timeout parameter
1-7. Set use_tight_match parameter
_________________________________________________________
Chapter 1. User's Guide
1.1. Overview
The dialog module provides dialog awareness to OpenSER proxy.
Its functionality is to keep trace of the current dialogs, to
offer information about them (like how many dialogs are
active). The module exports no functions that could be used
directly from scripts.
The module, via an internal API, also provide the foundation
to build on top of it more complex dialog-based
functionalities via other OpenSER modules.
_________________________________________________________
1.2. How it works
To create the dialog associated to an initial request, the
flag "dlg_flag" (Section 1.4.4) must be set before creating
the corresponding transaction.
The dialog is automatically destroyed when a "BYE" is
received. In case of no "BYE", the dialog lifetime is
controlled via the default timeout (see "default_timeout" -
Section 1.4.6) and custom timeout (see "timeout_avp" - Section
1.4.5). The dialog timeout is reset each time a sequential
request passes.
_________________________________________________________
1.3. Dependencies
1.3.1. OpenSER Modules
The following modules must be loaded before this module:
* TM - Transaction module
* RR - Record-Route module
_________________________________________________________
1.3.2. External Libraries or Applications
The following libraries or applications must be installed
before running OpenSER with this module loaded:
* None.
_________________________________________________________
1.4. Exported Parameters
1.4.1. enable_stats (integer)
If the statistics support should be enabled or not. Via
statistic variables, the module provide information about the
dialog processing. Set it to zero to disable or to non-zero to
enable it.
Default value is "1 (enabled)".
Example 1-1. Set enable_stats parameter
...
modparam("dialog", "enable_stats", 0)
...
_________________________________________________________
1.4.2. hash_size (integer)
The size of the hash table internally used to keep the
dialogs. A larger table is much faster but consumes more
memory. The hash size must be a power of 2 number.
Default value is "4096".
Example 1-2. Set hash_size parameter
...
modparam("dialog", "hash_size", 1024)
...
_________________________________________________________
1.4.3. rr_param (string)
Name of the Record-Route parameter to be added with the dialog
cookie. It is used for fast dialog matching of the sequential
requests.
Default value is "did".
Example 1-3. Set rr_param parameter
...
modparam("dialog", "rr_param", "xyz")
...
_________________________________________________________
1.4.4. dlg_flag (integer)
Flag to be used for marking if a dialog should be constructed
for the current request (make sense only for initial
requests).
Default value is "none".
Example 1-4. Set dlg_flag parameter
...
modparam("dialog", "dlg_flag", 4)
...
_________________________________________________________
1.4.5. timeout_avp (string)
The specification of an AVP to contain a custom timeout (in
seconds) for the dialog. It may be used only in a request
(initial or sequential) context
Default value is "none".
Example 1-5. Set timeout_avp parameter
...
modparam("dialog", "timeout_avp", "$avp(i:10)")
...
_________________________________________________________
1.4.6. default_timeout (integer)
The default dialog timeout (in seconds) if no custom one is
set.
Default value is "43200 (12 hours)".
Example 1-6. Set default_timeout parameter
...
modparam("dialog", "default_timeout", 21600)
...
_________________________________________________________
1.4.7. use_tight_match (integer)
If tight matching should be use dialog matching of sequential
requests. By default, the matching is done only on the RR
cookie; tight matching extra checks the callid. Set it to zero
to disable or to non-zero to enable it.
Default value is "0 (disabled)".
Example 1-7. Set use_tight_match parameter
...
modparam("dialog", "use_tight_match", 1)
...
_________________________________________________________
1.5. Exported Functions
There are no exported functions that could be used in scripts.
_________________________________________________________
1.6. Exported statistics
1.6.1. active_dialogs
Returns the number of current active dialogs (may be confirmed
or not).
_________________________________________________________
1.6.2. processed_dialogs
Returns the total number of processed dialogs (terminated,
expired or active) from the startup.
_________________________________________________________
1.6.3. expired_dialogs
Returns the total number of expired dialogs from the startup.
_________________________________________________________
1.7. Exported pseudo-variables
1.7.1. $dlg_count
Returns the number of current active dialogs (may be confirmed
or not).
_________________________________________________________
Chapter 2. Developer's Guide
2.1. Available Functions
2.1.1. register_dlgcb (dialog, type, cb, param)
Register a new callback to the dialog.
Meaning of the parameters is as follows:
* struct dlg_cell* dlg - dialog to register callback to. If
maybe NULL only for DLG_CREATED callback type, which is
not a per dialog type.
* int type - types of callbacks; more types may be register
for the same callback function; only DLG_CREATED must be
register alone. Possible types:
+ DLG_CREATED - called when a new dialog is created -
it's a global type (not associated to any dialog)
+ DLG_FAILED - called when the dialog was negatively
replied (non-2xx) - it's a per dialog type.
+ DLG_CONFIRMED - called when the dialog is confirmed
(2xx replied) - it's a per dialog type.
+ DLG_REQ_WITHIN - called when the dialog matches a
sequential request - it's a per dialog type.
+ DLG_TERMINATED - called when the dialog is terminated
via BYE - it's a per dialog type.
+ DLG_EXPIRED - called when the dialog expires without
receiving a BYE - it's a per dialog type.
* dialog_cb f - callback function to be called. Prototype
is: "void (dialog_cb) (struct dlg_cell* dlg, int type,
struct sip_msg* msg, void** param);"
* void *param - parameter to be passed to the callback
function.
_________________________________________________________
Chapter 3. Frequently Asked Questions
3.1. Where can I find more about OpenSER?
3.2. Where can I post a question about this module?
3.3. How can I report a bug?
3.1. Where can I find more about OpenSER?
Take a look at http://openser.org/.
3.2. Where can I post a question about this module?
First at all check if your question was already answered on
one of our mailing lists:
* User Mailing List -
http://openser.org/cgi-bin/mailman/listinfo/users
* Developer Mailing List -
http://openser.org/cgi-bin/mailman/listinfo/devel
E-mails regarding any stable OpenSER release should be sent to
<users@openser.org> and e-mails regarding development versions
should be sent to <devel@openser.org>.
If you want to keep the mail private, send it to
<team@openser.org>.
3.3. How can I report a bug?
Please follow the guidelines provided at:
http://sourceforge.net/tracker/?group_id=139143.
|