| 1 |
IMS Registrar SCSCF Module |
| 2 |
|
| 3 |
Jason Penton |
| 4 |
|
| 5 |
Smile Communications |
| 6 |
|
| 7 |
Edited by |
| 8 |
|
| 9 |
Richard Good |
| 10 |
|
| 11 |
Smile Communications |
| 12 |
|
| 13 |
Copyright © 2012 Smile Communications |
| 14 |
__________________________________________________________________ |
| 15 |
|
| 16 |
Table of Contents |
| 17 |
|
| 18 |
1. Admin Guide |
| 19 |
|
| 20 |
1. Overview |
| 21 |
2. Dependencies |
| 22 |
|
| 23 |
2.1. Kamailio Modules |
| 24 |
2.2. External Libraries or Applications |
| 25 |
|
| 26 |
3. Parameters |
| 27 |
|
| 28 |
3.1. default_expires (int) |
| 29 |
3.2. default_expires_range (int) |
| 30 |
3.3. min_expires (int) |
| 31 |
3.4. max_expires (int) |
| 32 |
3.5. subscription_default_expires (int) |
| 33 |
3.6. subscription_expires_range (int) |
| 34 |
3.7. subscription_min_expires (int) |
| 35 |
3.8. subscription_max_expires (int) |
| 36 |
3.9. ue_unsubscribe_on_dereg (int) |
| 37 |
3.10. user_data_dtd (string) |
| 38 |
3.11. user_data_xsd (string) |
| 39 |
3.12. support_wildcardPSI (int) |
| 40 |
3.13. scscf_name (string) |
| 41 |
3.14. store_profile_dereg (int) |
| 42 |
3.15. cxdx_dest_realm (string) |
| 43 |
3.16. cxdx_forced_peer (string) |
| 44 |
3.17. append_branches (integer) |
| 45 |
3.18. method_filtering (integer) |
| 46 |
3.19. user_data_always (integer) |
| 47 |
3.20. error_reply_code (int) |
| 48 |
3.21. skip_multiple_bindings_on_reg_resp (int) |
| 49 |
|
| 50 |
4. Functions |
| 51 |
|
| 52 |
4.1. save(async_reply_route, domain, mode, flags) |
| 53 |
4.2. lookup(domain) |
| 54 |
4.3. lookup_path_to_contact(uri) |
| 55 |
4.4. unregister(domain) |
| 56 |
4.5. assign_server_unreg(aysnc_reply_route, domain, |
| 57 |
direction) |
| 58 |
|
| 59 |
4.6. impu_registered(domain) |
| 60 |
4.7. term_impu_registered(domain) |
| 61 |
4.8. reg_fetch_contacts(domain, uri, profile) |
| 62 |
4.9. reg_free_contacts(profile) |
| 63 |
4.10. can_subscribe_to_reg(domain) |
| 64 |
4.11. subscribe_to_reg(domain) |
| 65 |
4.12. can_publish_reg(domain) |
| 66 |
4.13. publish_reg(domain) |
| 67 |
|
| 68 |
5. RPC Commands |
| 69 |
|
| 70 |
5.1. regscscf.dereg_impu |
| 71 |
|
| 72 |
6. Statistics |
| 73 |
|
| 74 |
6.1. registered contacts |
| 75 |
6.2. impus |
| 76 |
6.3. expired contacts |
| 77 |
|
| 78 |
2. Frequently Asked Questions |
| 79 |
|
| 80 |
List of Examples |
| 81 |
|
| 82 |
1.1. Set default_expires parameter |
| 83 |
1.2. Set default_expires_range parameter |
| 84 |
1.3. Set min_expiresparameter |
| 85 |
1.4. Set max_expiresparameter |
| 86 |
1.5. Set subscription_default_expires parameter |
| 87 |
1.6. Set subscription_expires_range parameter |
| 88 |
1.7. Set subscription_min_expiresparameter |
| 89 |
1.8. Set subscription_max_expiresparameter |
| 90 |
1.9. Set user_data_dtdparameter |
| 91 |
1.10. Set user_data_dtdparameter |
| 92 |
1.11. Set user_data_xsdparameter |
| 93 |
1.12. Set support_wildcardPSIparameter |
| 94 |
1.13. Set scscf_nameparameter |
| 95 |
1.14. Set store_profile_deregparameter |
| 96 |
1.15. Set cxdx_dest_realmparameter |
| 97 |
1.16. Set cxdx_forced_peerparameter |
| 98 |
1.17. Set cxdx_forced_peerparameter |
| 99 |
1.18. Set cxdx_forced_peerparameter |
| 100 |
1.19. Set user_data_alwaysparameter |
| 101 |
1.20. Set error_reply_code parameter |
| 102 |
1.21. Set skip_multiple_bindings_on_reg_resp parameter |
| 103 |
1.22. save usage |
| 104 |
1.23. lookup usage |
| 105 |
1.24. lookup usage |
| 106 |
1.25. unregister usage |
| 107 |
1.26. impu_registered usage |
| 108 |
1.27. term_impu_registered usage |
| 109 |
1.28. reg_fetch_contacts usage |
| 110 |
1.29. reg_free_contacts usage |
| 111 |
1.30. can_subscribe_to_reg usage |
| 112 |
1.31. subscribe_to_reg usage |
| 113 |
1.32. can_publish_reg usage |
| 114 |
1.33. publish_reg usage |
| 115 |
|
| 116 |
Chapter 1. Admin Guide |
| 117 |
|
| 118 |
Table of Contents |
| 119 |
|
| 120 |
1. Overview |
| 121 |
2. Dependencies |
| 122 |
|
| 123 |
2.1. Kamailio Modules |
| 124 |
2.2. External Libraries or Applications |
| 125 |
|
| 126 |
3. Parameters |
| 127 |
|
| 128 |
3.1. default_expires (int) |
| 129 |
3.2. default_expires_range (int) |
| 130 |
3.3. min_expires (int) |
| 131 |
3.4. max_expires (int) |
| 132 |
3.5. subscription_default_expires (int) |
| 133 |
3.6. subscription_expires_range (int) |
| 134 |
3.7. subscription_min_expires (int) |
| 135 |
3.8. subscription_max_expires (int) |
| 136 |
3.9. ue_unsubscribe_on_dereg (int) |
| 137 |
3.10. user_data_dtd (string) |
| 138 |
3.11. user_data_xsd (string) |
| 139 |
3.12. support_wildcardPSI (int) |
| 140 |
3.13. scscf_name (string) |
| 141 |
3.14. store_profile_dereg (int) |
| 142 |
3.15. cxdx_dest_realm (string) |
| 143 |
3.16. cxdx_forced_peer (string) |
| 144 |
3.17. append_branches (integer) |
| 145 |
3.18. method_filtering (integer) |
| 146 |
3.19. user_data_always (integer) |
| 147 |
3.20. error_reply_code (int) |
| 148 |
3.21. skip_multiple_bindings_on_reg_resp (int) |
| 149 |
|
| 150 |
4. Functions |
| 151 |
|
| 152 |
4.1. save(async_reply_route, domain, mode, flags) |
| 153 |
4.2. lookup(domain) |
| 154 |
4.3. lookup_path_to_contact(uri) |
| 155 |
4.4. unregister(domain) |
| 156 |
4.5. assign_server_unreg(aysnc_reply_route, domain, direction) |
| 157 |
4.6. impu_registered(domain) |
| 158 |
4.7. term_impu_registered(domain) |
| 159 |
4.8. reg_fetch_contacts(domain, uri, profile) |
| 160 |
4.9. reg_free_contacts(profile) |
| 161 |
4.10. can_subscribe_to_reg(domain) |
| 162 |
4.11. subscribe_to_reg(domain) |
| 163 |
4.12. can_publish_reg(domain) |
| 164 |
4.13. publish_reg(domain) |
| 165 |
|
| 166 |
5. RPC Commands |
| 167 |
|
| 168 |
5.1. regscscf.dereg_impu |
| 169 |
|
| 170 |
6. Statistics |
| 171 |
|
| 172 |
6.1. registered contacts |
| 173 |
6.2. impus |
| 174 |
6.3. expired contacts |
| 175 |
|
| 176 |
1. Overview |
| 177 |
|
| 178 |
This module contains REGISTER processing logic for the S-CSCF. The |
| 179 |
'storage engine' of this module is provided by the ims_usrloc_scscf |
| 180 |
module: |
| 181 |
|
| 182 |
2. Dependencies |
| 183 |
|
| 184 |
2.1. Kamailio Modules |
| 185 |
2.2. External Libraries or Applications |
| 186 |
|
| 187 |
2.1. Kamailio Modules |
| 188 |
|
| 189 |
The following modules must be loaded before this module: |
| 190 |
* CDP |
| 191 |
* CDP_AVP |
| 192 |
* TM |
| 193 |
* ims_usrloc_scscf |
| 194 |
|
| 195 |
2.2. External Libraries or Applications |
| 196 |
|
| 197 |
The following libraries or applications must be installed before |
| 198 |
running Kamailio with this module loaded: |
| 199 |
* LibXML2 - used for parsing the XML Subscription information |
| 200 |
obtained from the HSS (Home Subscriber Server) |
| 201 |
|
| 202 |
3. Parameters |
| 203 |
|
| 204 |
3.1. default_expires (int) |
| 205 |
3.2. default_expires_range (int) |
| 206 |
3.3. min_expires (int) |
| 207 |
3.4. max_expires (int) |
| 208 |
3.5. subscription_default_expires (int) |
| 209 |
3.6. subscription_expires_range (int) |
| 210 |
3.7. subscription_min_expires (int) |
| 211 |
3.8. subscription_max_expires (int) |
| 212 |
3.9. ue_unsubscribe_on_dereg (int) |
| 213 |
3.10. user_data_dtd (string) |
| 214 |
3.11. user_data_xsd (string) |
| 215 |
3.12. support_wildcardPSI (int) |
| 216 |
3.13. scscf_name (string) |
| 217 |
3.14. store_profile_dereg (int) |
| 218 |
3.15. cxdx_dest_realm (string) |
| 219 |
3.16. cxdx_forced_peer (string) |
| 220 |
3.17. append_branches (integer) |
| 221 |
3.18. method_filtering (integer) |
| 222 |
3.19. user_data_always (integer) |
| 223 |
3.20. error_reply_code (int) |
| 224 |
3.21. skip_multiple_bindings_on_reg_resp (int) |
| 225 |
|
| 226 |
3.1. default_expires (int) |
| 227 |
|
| 228 |
If the processed message contains neither Expires HFs nor expires |
| 229 |
contact parameters, this value will be used for newly created S-CSCF |
| 230 |
usrloc records. The parameter contains number of second to expire (for |
| 231 |
example use 3600 for one hour). If it is set to a lower value than the |
| 232 |
min_expires parameter then it will be ignored. This parameter can be |
| 233 |
modified via ser config framework. A random value in a specific |
| 234 |
interval can be selected by using the default_expires_range parameter |
| 235 |
|
| 236 |
Default value is 3600. |
| 237 |
|
| 238 |
Example 1.1. Set default_expires parameter |
| 239 |
... |
| 240 |
modparam("ims_registrar_scscf", "default_expires", 3600) |
| 241 |
... |
| 242 |
|
| 243 |
3.2. default_expires_range (int) |
| 244 |
|
| 245 |
This parameter specifies that the expiry used for newly created S-CSCF |
| 246 |
usrloc records are not fixed(when default_expires applies), but a |
| 247 |
random value in the intervalrdq |
| 248 |
[default_expires-default_expires_range%, |
| 249 |
default_expires+default_expires_range%]. The value is between 0 and 100 |
| 250 |
and represent the maximum percentage from default_expires that will be |
| 251 |
subtracted or added when computing the value. Default in 0, meaning |
| 252 |
default_expires is left unmodified. This parameter can be modified via |
| 253 |
ser config framework. |
| 254 |
|
| 255 |
Default value is 0. |
| 256 |
|
| 257 |
Example 1.2. Set default_expires_range parameter |
| 258 |
... |
| 259 |
modparam("ims_registrar_scscf", "default_expires_range", 30) # +- 30% fr |
| 260 |
om default_expires |
| 261 |
... |
| 262 |
|
| 263 |
3.3. min_expires (int) |
| 264 |
|
| 265 |
The minimum expires value of a Contact, values lower than this minimum |
| 266 |
will be automatically set to the minimum. Value 0 disables the |
| 267 |
checking. This parameter can be modified via ser config framework. |
| 268 |
|
| 269 |
Default value is 60. |
| 270 |
|
| 271 |
Example 1.3. Set min_expiresparameter |
| 272 |
... |
| 273 |
modparam("ims_registrar_scscf", "min_expires", 1800) |
| 274 |
... |
| 275 |
|
| 276 |
3.4. max_expires (int) |
| 277 |
|
| 278 |
The maximum expires value of a Contact, values higher than this maximum |
| 279 |
will be automatically set to the maximum. Value 0 disables the |
| 280 |
checking. This parameter can be modified via ser config framework. |
| 281 |
|
| 282 |
Default value is 0. |
| 283 |
|
| 284 |
Example 1.4. Set max_expiresparameter |
| 285 |
... |
| 286 |
modparam("ims_registrar_scscf", "max_expires", 3600) |
| 287 |
... |
| 288 |
|
| 289 |
3.5. subscription_default_expires (int) |
| 290 |
|
| 291 |
If the processed message contains neither Expires HFs nor expires |
| 292 |
contact parameters, this value will be used for newly created |
| 293 |
subscriptions. The parameter contains number of second to expire (for |
| 294 |
example use 3600 for one hour). If it is set to a lower value than the |
| 295 |
subscription_min_expires parameter then it will be ignored. A random |
| 296 |
value in a specific interval can be selected by using the |
| 297 |
subscription_expires_range parameter |
| 298 |
|
| 299 |
Default value is 3600. |
| 300 |
|
| 301 |
Example 1.5. Set subscription_default_expires parameter |
| 302 |
... |
| 303 |
modparam("ims_registrar_scscf", "subscription_default_expires", 3600) |
| 304 |
... |
| 305 |
|
| 306 |
3.6. subscription_expires_range (int) |
| 307 |
|
| 308 |
This parameter specifies that the expiry used for newly created |
| 309 |
subscriptions are not fixed(when subscription_default_expires applies), |
| 310 |
but a random value in the interval |
| 311 |
[subscription_default_expires-subscription_expires_range%, |
| 312 |
subscription_default_expires+subscription_expires_range%]. The value is |
| 313 |
between 0 and 100 and represent the maximum percentage from |
| 314 |
subscription_default_expires that will be subtracted or added when |
| 315 |
computing the value. Default in 0, meaning subscription_default_expires |
| 316 |
is left unmodified. |
| 317 |
|
| 318 |
Default value is 0. |
| 319 |
|
| 320 |
Example 1.6. Set subscription_expires_range parameter |
| 321 |
... |
| 322 |
modparam("ims_registrar_scscf", "subscription_expires_range", 30) # +- 3 |
| 323 |
0% from subscription_expires_range |
| 324 |
... |
| 325 |
|
| 326 |
3.7. subscription_min_expires (int) |
| 327 |
|
| 328 |
The minimum expires value of a subscription, values lower than this |
| 329 |
minimum will be automatically set to the minimum. Value 0 disables the |
| 330 |
checking. |
| 331 |
|
| 332 |
Default value is 10. |
| 333 |
|
| 334 |
Example 1.7. Set subscription_min_expiresparameter |
| 335 |
... |
| 336 |
modparam("subscription_min_expires", "min_expires", 1800) |
| 337 |
... |
| 338 |
|
| 339 |
3.8. subscription_max_expires (int) |
| 340 |
|
| 341 |
The maximum expires value of a subscription, values higher than this |
| 342 |
maximum will be automatically set to the maximum. Value 0 disables the |
| 343 |
checking. |
| 344 |
|
| 345 |
Default value is 1000000. |
| 346 |
|
| 347 |
Example 1.8. Set subscription_max_expiresparameter |
| 348 |
... |
| 349 |
modparam("ims_registrar_scscf", "subscription_max_expires", 3600) |
| 350 |
... |
| 351 |
|
| 352 |
3.9. ue_unsubscribe_on_dereg (int) |
| 353 |
|
| 354 |
Many UEs do not unsubscribe on de-register, therefor if the parameter |
| 355 |
is set to 0, the default, any subscription of that subscriber will be |
| 356 |
removed and NOTIFY will be not sent. To disable this behaviour set this |
| 357 |
parameter to 1. |
| 358 |
|
| 359 |
Default value is 0 (disabled) |
| 360 |
|
| 361 |
Example 1.9. Set user_data_dtdparameter |
| 362 |
... |
| 363 |
modparam("ims_registrar_scscf", "ue_unsubscribe_on_dereg", 1) |
| 364 |
... |
| 365 |
|
| 366 |
3.10. user_data_dtd (string) |
| 367 |
|
| 368 |
DTD to check the user data received in SAA (Server Assignment Answer). |
| 369 |
|
| 370 |
Default value is NULL (none). |
| 371 |
|
| 372 |
Example 1.10. Set user_data_dtdparameter |
| 373 |
... |
| 374 |
modparam("ims_registrar_scscf", "user_data_dtd", "/usr/local/etc/kamaili |
| 375 |
o/CxDataType_Rel7.dtd") |
| 376 |
... |
| 377 |
|
| 378 |
3.11. user_data_xsd (string) |
| 379 |
|
| 380 |
XSD to check the user data received in SAA (Server Assignment Answer). |
| 381 |
|
| 382 |
Default value is NULL (none). |
| 383 |
|
| 384 |
Example 1.11. Set user_data_xsdparameter |
| 385 |
... |
| 386 |
modparam("ims_registrar_scscf", "user_data_xsd", "/usr/local/etc/kamaili |
| 387 |
o/CxDataType_Rel7.xsd") |
| 388 |
... |
| 389 |
|
| 390 |
3.12. support_wildcardPSI (int) |
| 391 |
|
| 392 |
indicate support for wildcard PSI is subscription profile (SAA) |
| 393 |
|
| 394 |
Default value is 0. |
| 395 |
|
| 396 |
Example 1.12. Set support_wildcardPSIparameter |
| 397 |
... |
| 398 |
modparam("ims_registrar_scscf", "support_wildcardPSI", 1) |
| 399 |
... |
| 400 |
|
| 401 |
3.13. scscf_name (string) |
| 402 |
|
| 403 |
The name of the S-CSCF |
| 404 |
|
| 405 |
Default value is sip:scscf.ims.smilecoms.com:6060. |
| 406 |
|
| 407 |
Example 1.13. Set scscf_nameparameter |
| 408 |
... |
| 409 |
modparam("ims_registrar_scscf", "scscf_name", "sip:scscf2.ims.smilecoms. |
| 410 |
com:6060") |
| 411 |
... |
| 412 |
|
| 413 |
3.14. store_profile_dereg (int) |
| 414 |
|
| 415 |
Should the subscription profile be stored on de-registration |
| 416 |
|
| 417 |
Default value 0. |
| 418 |
|
| 419 |
Example 1.14. Set store_profile_deregparameter |
| 420 |
... |
| 421 |
modparam("ims_registrar_scscf", "store_profile_dereg", 1) |
| 422 |
... |
| 423 |
|
| 424 |
3.15. cxdx_dest_realm (string) |
| 425 |
|
| 426 |
Destination realm to be used in Diameter messages |
| 427 |
|
| 428 |
Default value "ims.smilecoms.com" |
| 429 |
|
| 430 |
Example 1.15. Set cxdx_dest_realmparameter |
| 431 |
... |
| 432 |
modparam("ims_registrar_scscf", "cxdx_dest_realm", "my.domain,org") |
| 433 |
... |
| 434 |
|
| 435 |
3.16. cxdx_forced_peer (string) |
| 436 |
|
| 437 |
FQDN of Diameter Peer (HSS) to use for communication (SAR). If you use |
| 438 |
this, the routing defined in your diameter xml configuration file (CDP) |
| 439 |
will be ignored and as a result you will lose the benefits of load |
| 440 |
balancing and failover. |
| 441 |
|
| 442 |
Default value NULL (none) |
| 443 |
|
| 444 |
Example 1.16. Set cxdx_forced_peerparameter |
| 445 |
... |
| 446 |
modparam("ims_registrar_scscf", "cxdx_forced_peer", "hss.ims.smilecoms.c |
| 447 |
om") |
| 448 |
... |
| 449 |
|
| 450 |
3.17. append_branches (integer) |
| 451 |
|
| 452 |
The parameter controls how lookup function processes multiple contacts. |
| 453 |
If there are multiple contacts for the given username in usrloc and |
| 454 |
this parameter is set to 1, Request-URI will be overwritten with the |
| 455 |
highest-q rated contact and the rest will be appended to sip_msg |
| 456 |
structure and can be later used by tm for forking. If the parameter is |
| 457 |
set to 0, only Request-URI will be overwritten with the highest-q rated |
| 458 |
contact and the rest will be left unprocessed. This parameter can be |
| 459 |
modified via Kamailio config framework. |
| 460 |
|
| 461 |
Default value is 0 (disabled) |
| 462 |
|
| 463 |
Example 1.17. Set cxdx_forced_peerparameter |
| 464 |
... |
| 465 |
modparam("ims_registrar_scscf", "append_branches", 1) |
| 466 |
... |
| 467 |
|
| 468 |
3.18. method_filtering (integer) |
| 469 |
|
| 470 |
Tells if the contact filtering based on supported methods should be |
| 471 |
performed during lookup. It's enabled only if it has a non zero value. |
| 472 |
|
| 473 |
Default value is 0 (disabled) |
| 474 |
|
| 475 |
Example 1.18. Set cxdx_forced_peerparameter |
| 476 |
... |
| 477 |
modparam("ims_registrar_scscf", "method_filtering", 1) |
| 478 |
... |
| 479 |
|
| 480 |
3.19. user_data_always (integer) |
| 481 |
|
| 482 |
If specified this will make the S-CSCF always request user data from |
| 483 |
HSS. |
| 484 |
|
| 485 |
Default value is 0 (disabled) |
| 486 |
|
| 487 |
Example 1.19. Set user_data_alwaysparameter |
| 488 |
... |
| 489 |
modparam("ims_registrar_scscf", "user_data_always", 1) |
| 490 |
... |
| 491 |
|
| 492 |
3.20. error_reply_code (int) |
| 493 |
|
| 494 |
In certain error conditions, the S-CSCF may not be able to process the |
| 495 |
request (e.g. in case of database failures). Per default and according |
| 496 |
to the Specs, the S-CSCF would return a 500 error in this case. |
| 497 |
However, according to the SIP-Specs for DNS-SRV, this won't trigger a |
| 498 |
failover, which may be desired. |
| 499 |
|
| 500 |
This parameter let's you override the default 500 with another |
| 501 |
return-code (e.g. 503) in order to get the desired behaviour. |
| 502 |
|
| 503 |
Default value is 500. |
| 504 |
|
| 505 |
Example 1.20. Set error_reply_code parameter |
| 506 |
... |
| 507 |
modparam("ims_registrar_scscf", "error_reply_code", 503) |
| 508 |
... |
| 509 |
|
| 510 |
3.21. skip_multiple_bindings_on_reg_resp (int) |
| 511 |
|
| 512 |
If set to 1 - on Re-Registration registrar sends in 200 OK reply only |
| 513 |
current contact in case of multiple bindings. If set to 0 - on |
| 514 |
Re-Registration registrar sends in 200 OK reply all contacts in case of |
| 515 |
multiple bindings according to RFC3261. |
| 516 |
|
| 517 |
Default value is 0. |
| 518 |
|
| 519 |
Example 1.21. Set skip_multiple_bindings_on_reg_resp parameter |
| 520 |
... |
| 521 |
modparam("ims_registrar_scscf", "skip_multiple_bindings_on_reg_resp", 1) |
| 522 |
... |
| 523 |
|
| 524 |
4. Functions |
| 525 |
|
| 526 |
4.1. save(async_reply_route, domain, mode, flags) |
| 527 |
4.2. lookup(domain) |
| 528 |
4.3. lookup_path_to_contact(uri) |
| 529 |
4.4. unregister(domain) |
| 530 |
4.5. assign_server_unreg(aysnc_reply_route, domain, direction) |
| 531 |
4.6. impu_registered(domain) |
| 532 |
4.7. term_impu_registered(domain) |
| 533 |
4.8. reg_fetch_contacts(domain, uri, profile) |
| 534 |
4.9. reg_free_contacts(profile) |
| 535 |
4.10. can_subscribe_to_reg(domain) |
| 536 |
4.11. subscribe_to_reg(domain) |
| 537 |
4.12. can_publish_reg(domain) |
| 538 |
4.13. publish_reg(domain) |
| 539 |
|
| 540 |
4.1. save(async_reply_route, domain, mode, flags) |
| 541 |
|
| 542 |
The function processes a REGISTER message. It can add, remove or modify |
| 543 |
usrloc records depending on Contact and Expires HFs in the REGISTER |
| 544 |
message. On success and when called from the REQUEST_ROUTE, 200 OK will |
| 545 |
be returned listing all contacts that are currently in usrloc. On an |
| 546 |
error, error message will be sent with a short description in reason |
| 547 |
phrase. In case of internal errors the function will return FALSE, |
| 548 |
otherwise a force to exit the cfg is file is actioned by returning 0 |
| 549 |
(asynchronous processing) |
| 550 |
|
| 551 |
Meaning of the parameters is as follows: |
| 552 |
* async_reply_route- the route to execute after the save has |
| 553 |
completed. This is required because the save function is executed |
| 554 |
asynchronously (Diameter). |
| 555 |
* domain- Logical domain within registrar. |
| 556 |
* mode- Optional and unused legacy parameter. |
| 557 |
* flags- Optional parameter. Valid values: 0x01 - Realm is not used |
| 558 |
when extracting Private Identity from the Authorization header. |
| 559 |
|
| 560 |
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE |
| 561 |
|
| 562 |
Example 1.22. save usage |
| 563 |
... |
| 564 |
if (!impu_registered("location")) { |
| 565 |
save("PRE_REG_SAR_REPLY","location"); |
| 566 |
} |
| 567 |
... |
| 568 |
|
| 569 |
4.2. lookup(domain) |
| 570 |
|
| 571 |
This function extract the IMPU from the Request-URI and tries to find |
| 572 |
all registered contacts in usrloc. If there are no such contacts, -1 is |
| 573 |
returned. If there are, Request-URI will be rewritten with the contact |
| 574 |
that has the highest q value. The rest of the contacts will be appended |
| 575 |
to the sip msg structure (if append_branches is set) and can be later |
| 576 |
used by TM module for forking for example... |
| 577 |
|
| 578 |
If the method filtering option is enabled, the lookup function will |
| 579 |
only return contacts that support the method of the request being |
| 580 |
processed (see allows header) |
| 581 |
|
| 582 |
Meaning of the parameters is as follows: |
| 583 |
* domain - Logical domain within registrar. |
| 584 |
|
| 585 |
Return codes: |
| 586 |
* -1 - Not found |
| 587 |
* -2 - Found, but method not allowed (check Allows header for INVITE, |
| 588 |
MESSAGE, etc). |
| 589 |
* -3 - Error occurred internally during processing |
| 590 |
|
| 591 |
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE |
| 592 |
|
| 593 |
Example 1.23. lookup usage |
| 594 |
... |
| 595 |
lookup("location"); |
| 596 |
switch ($retcode) { |
| 597 |
case -1: |
| 598 |
case -3: |
| 599 |
sl_send_reply("404", "Not Found"); |
| 600 |
exit; |
| 601 |
case -2: |
| 602 |
sl_send_reply("405", "Not Found"); |
| 603 |
exit; |
| 604 |
}; |
| 605 |
... |
| 606 |
|
| 607 |
4.3. lookup_path_to_contact(uri) |
| 608 |
|
| 609 |
This function take a URI and tries to find the contact in usrloc. If |
| 610 |
the contact is found and has a path set, then a path header is added to |
| 611 |
the SIP message so it can be loose routed. |
| 612 |
|
| 613 |
Meaning of the parameters is as follows: |
| 614 |
* uri - URI of contact to lookup |
| 615 |
|
| 616 |
Return codes: |
| 617 |
* 1 - Success |
| 618 |
* -1 - Failure |
| 619 |
|
| 620 |
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE |
| 621 |
|
| 622 |
Example 1.24. lookup usage |
| 623 |
... |
| 624 |
lookup_path_to_contact($ruri); |
| 625 |
... |
| 626 |
|
| 627 |
4.4. unregister(domain) |
| 628 |
|
| 629 |
This function will remove all bindings for the IMPU found in the |
| 630 |
Request-URI. |
| 631 |
|
| 632 |
Meaning of the parameters is as follows: |
| 633 |
* Domain- Logical domain within registrar. |
| 634 |
|
| 635 |
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE |
| 636 |
|
| 637 |
Example 1.25. unregister usage |
| 638 |
... |
| 639 |
unregister("location"); |
| 640 |
... |
| 641 |
|
| 642 |
4.5. assign_server_unreg(aysnc_reply_route, domain, direction) |
| 643 |
|
| 644 |
TBD |
| 645 |
|
| 646 |
used in REQUEST_ROUTE |
| 647 |
|
| 648 |
4.6. impu_registered(domain) |
| 649 |
|
| 650 |
This function checks if the IMPU in the To header is registered in |
| 651 |
usrloc. |
| 652 |
|
| 653 |
Meaning of the parameters is as follows: |
| 654 |
* domain- Logical domain within registrar. |
| 655 |
|
| 656 |
Return codes: |
| 657 |
* 1 - True, IMPU exists in registered state in usrloc |
| 658 |
* -1 - False, IMPU not registered |
| 659 |
|
| 660 |
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE |
| 661 |
|
| 662 |
Example 1.26. impu_registered usage |
| 663 |
... |
| 664 |
impu_registered("location"); |
| 665 |
switch ($retcode) { |
| 666 |
case -1: |
| 667 |
sl_send_reply("404", "Not Found"); |
| 668 |
exit; |
| 669 |
case 1: |
| 670 |
#true, continue with normal processing |
| 671 |
}; |
| 672 |
... |
| 673 |
|
| 674 |
4.7. term_impu_registered(domain) |
| 675 |
|
| 676 |
This function checks if the IMPU in the Request-URI is registered in |
| 677 |
usrloc. |
| 678 |
|
| 679 |
Meaning of the parameters is as follows: |
| 680 |
* domain- Logical domain within registrar. |
| 681 |
|
| 682 |
Return codes: |
| 683 |
* 1 - True, IMPU exists in registered state in usrloc |
| 684 |
* -1 - False, IMPU not registered |
| 685 |
|
| 686 |
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE |
| 687 |
|
| 688 |
Example 1.27. term_impu_registered usage |
| 689 |
... |
| 690 |
term_impu_registered("location"); |
| 691 |
switch ($retcode) { |
| 692 |
case -1: |
| 693 |
sl_send_reply("404", "Not Found"); |
| 694 |
exit; |
| 695 |
case 1: |
| 696 |
#true, continue with normal processing |
| 697 |
}; |
| 698 |
... |
| 699 |
|
| 700 |
4.8. reg_fetch_contacts(domain, uri, profile) |
| 701 |
|
| 702 |
The function fetches the contacts for 'uri' from table 'domain' to |
| 703 |
pseudo-variable $ulc(profile) [ulc = ims scscf ulc]. |
| 704 |
|
| 705 |
Meaning of the parameters is as follows: |
| 706 |
* domain - Name of table that should be used for the lookup of |
| 707 |
contact addresses. |
| 708 |
* uri - The SIP URI address of the user which to fetch the contact |
| 709 |
addresses for. It can contain pseudo-variables that are evaluated |
| 710 |
at runtime. |
| 711 |
* profile - Name of $ulc pseudo-variable profile that will store the |
| 712 |
fetched contacts. It is a static string. |
| 713 |
|
| 714 |
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE |
| 715 |
|
| 716 |
Example 1.28. reg_fetch_contacts usage |
| 717 |
... |
| 718 |
reg_fetch_contacts("location", "$ru", "callee"); |
| 719 |
reg_fetch_contacts("location", "sip:[email protected]", "caller"); |
| 720 |
... |
| 721 |
|
| 722 |
4.9. reg_free_contacts(profile) |
| 723 |
|
| 724 |
The function frees the contacts from pseudo-variable $ulc(profile). |
| 725 |
Should be called to release the content of a profile. Anyhow, fetching |
| 726 |
a new contact addresses set over a profile will release any existing |
| 727 |
data in that profile. |
| 728 |
|
| 729 |
Meaning of the parameters is as follows: |
| 730 |
* profile - Name of $ulc pseudo-variable profile that stores the |
| 731 |
contacts. It is a static string. |
| 732 |
|
| 733 |
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE |
| 734 |
|
| 735 |
Example 1.29. reg_free_contacts usage |
| 736 |
... |
| 737 |
reg_free_contacts("callee"); |
| 738 |
... |
| 739 |
|
| 740 |
4.10. can_subscribe_to_reg(domain) |
| 741 |
|
| 742 |
This function checks to see that a SUBSCRIBE request is authorised to |
| 743 |
subscribe to the particular identity. Only 3 entities can subscribe: |
| 744 |
* The user agent to its own state |
| 745 |
* The P-CSCF specified in the path header for that user |
| 746 |
* Application Server (AS) not yet implemented |
| 747 |
|
| 748 |
Meaning of the parameters is as follows: |
| 749 |
* domain - Logical domain within registrar. |
| 750 |
|
| 751 |
This function can be used in REQUEST_ROUTE |
| 752 |
|
| 753 |
Example 1.30. can_subscribe_to_reg usage |
| 754 |
... |
| 755 |
if (can_subscribe_to_reg("location")){ |
| 756 |
$var(ret)= subscribe_to_reg("location"); |
| 757 |
} |
| 758 |
... |
| 759 |
|
| 760 |
4.11. subscribe_to_reg(domain) |
| 761 |
|
| 762 |
Save the subscription to the REG event for the UAC or the appropriate |
| 763 |
P-CSCF (in the path to the UAC). |
| 764 |
|
| 765 |
Meaning of the parameters is as follows: |
| 766 |
* domain - Logical domain within registrar. |
| 767 |
|
| 768 |
This function can be used in REQUEST_ROUTE |
| 769 |
|
| 770 |
Example 1.31. subscribe_to_reg usage |
| 771 |
... |
| 772 |
if (can_subscribe_to_reg("location")){ |
| 773 |
$var(ret)= subscribe_to_reg("location"); |
| 774 |
} |
| 775 |
... |
| 776 |
|
| 777 |
4.12. can_publish_reg(domain) |
| 778 |
|
| 779 |
This function checks to see that a PUBLISH request is authorised to |
| 780 |
publish for a particular identity. Only 3 entities can publish: |
| 781 |
* The user agent to its own state |
| 782 |
* The P-CSCF specified in the path header for that user |
| 783 |
* Application Server (AS) not yet implemented |
| 784 |
|
| 785 |
Meaning of the parameters is as follows: |
| 786 |
* domain - Logical domain within registrar. |
| 787 |
|
| 788 |
This function can be used in REQUEST_ROUTE |
| 789 |
|
| 790 |
Example 1.32. can_publish_reg usage |
| 791 |
... |
| 792 |
if (can_publish_reg("location")){ |
| 793 |
$var(ret)= publish_reg("location"); |
| 794 |
} |
| 795 |
... |
| 796 |
|
| 797 |
4.13. publish_reg(domain) |
| 798 |
|
| 799 |
Save the publish to the REG event for the UAC or the appropriate P-CSCF |
| 800 |
(in the path to the UAC). |
| 801 |
|
| 802 |
Meaning of the parameters is as follows: |
| 803 |
* domain - Logical domain within registrar. |
| 804 |
|
| 805 |
This function can be used in REQUEST_ROUTE |
| 806 |
|
| 807 |
Example 1.33. publish_reg usage |
| 808 |
... |
| 809 |
if (can_publish_reg("location")){ |
| 810 |
$var(ret)= publish_reg("location"); |
| 811 |
} |
| 812 |
... |
| 813 |
|
| 814 |
5. RPC Commands |
| 815 |
|
| 816 |
5.1. regscscf.dereg_impu |
| 817 |
|
| 818 |
exported RPC commands. |
| 819 |
|
| 820 |
5.1. regscscf.dereg_impu |
| 821 |
|
| 822 |
Initiate network de-register of IMPU |
| 823 |
|
| 824 |
6. Statistics |
| 825 |
|
| 826 |
6.1. registered contacts |
| 827 |
6.2. impus |
| 828 |
6.3. expired contacts |
| 829 |
|
| 830 |
Exported statistics are listed in the next sections. |
| 831 |
|
| 832 |
6.1. registered contacts |
| 833 |
|
| 834 |
Number of AOR contacts in registered state - cannot be reset. |
| 835 |
|
| 836 |
6.2. impus |
| 837 |
|
| 838 |
Number of IMPUs - cannot be reset. |
| 839 |
|
| 840 |
6.3. expired contacts |
| 841 |
|
| 842 |
Number of expired contacts - can be reset. |
| 843 |
|
| 844 |
Chapter 2. Frequently Asked Questions |
| 845 |
|
| 846 |
2.1. Where can I find more about Kamailio? |
| 847 |
2.2. Where can I post a question about this module? |
| 848 |
2.3. How can I report a bug? |
| 849 |
|
| 850 |
2.1. |
| 851 |
|
| 852 |
Where can I find more about Kamailio? |
| 853 |
|
| 854 |
Take a look at https://www.kamailio.org/. |
| 855 |
|
| 856 |
2.2. |
| 857 |
|
| 858 |
Where can I post a question about this module? |
| 859 |
|
| 860 |
First at all check if your question was already answered on one of our |
| 861 |
mailing lists: |
| 862 |
* User Mailing List - |
| 863 |
https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists. |
| 864 |
kamailio.org/ |
| 865 |
* Developer Mailing List - |
| 866 |
https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.ka |
| 867 |
mailio.org/ |
| 868 |
|
| 869 |
E-mails regarding any stable Kamailio release should be sent to |
| 870 |
<[email protected]> and e-mails regarding development |
| 871 |
versions should be sent to <[email protected]>. |
| 872 |
|
| 873 |
2.3. |
| 874 |
|
| 875 |
How can I report a bug? |
| 876 |
|
| 877 |
Please follow the guidelines provided at: |
| 878 |
https://github.com/kamailio/kamailio/issues. |