| 1 |
dmq_usrloc Module |
| 2 |
|
| 3 |
Andrey Rybkin |
| 4 |
|
| 5 |
bks.tv |
| 6 |
<[email protected]> |
| 7 |
|
| 8 |
Edited by |
| 9 |
|
| 10 |
Andrey Rybkin |
| 11 |
|
| 12 |
bks.tv |
| 13 |
<[email protected]> |
| 14 |
|
| 15 |
Edited by |
| 16 |
|
| 17 |
Julien Chavanton |
| 18 |
|
| 19 |
flowroute.com |
| 20 |
<[email protected]> |
| 21 |
|
| 22 |
Edited by |
| 23 |
|
| 24 |
Emmanuel Schmidbauer |
| 25 |
|
| 26 |
TextNow Inc. |
| 27 |
<[email protected]> |
| 28 |
|
| 29 |
Copyright © 2014 |
| 30 |
|
| 31 |
Copyright © 2017 |
| 32 |
|
| 33 |
Copyright © 2020 |
| 34 |
__________________________________________________________________ |
| 35 |
|
| 36 |
Table of Contents |
| 37 |
|
| 38 |
1. Admin Guide |
| 39 |
|
| 40 |
1. Overview |
| 41 |
2. Dependencies |
| 42 |
|
| 43 |
2.1. Kamailio Modules |
| 44 |
|
| 45 |
3. Parameters |
| 46 |
|
| 47 |
3.1. enable (int) |
| 48 |
3.2. sync (int) |
| 49 |
3.3. batch_size (int) |
| 50 |
3.4. batch_usleep (int) |
| 51 |
3.5. batch_msg_size (int) |
| 52 |
3.6. batch_msg_contacts (int) |
| 53 |
3.7. usrloc_domain (string) |
| 54 |
3.8. replicate_socket_info (int) |
| 55 |
3.9. replicate_cflags (int) |
| 56 |
3.10. usrloc_delete (int) |
| 57 |
3.11. usrloc_delete_expired (int) |
| 58 |
|
| 59 |
List of Examples |
| 60 |
|
| 61 |
1.1. Set enable parameter |
| 62 |
1.2. Set sync parameter |
| 63 |
1.3. Set batch_size parameter |
| 64 |
1.4. Set batch_usleep parameter |
| 65 |
1.5. Set batch_msg_size parameter |
| 66 |
1.6. Set batch_msg_contacts parameter |
| 67 |
1.7. Set usrloc_domain parameter |
| 68 |
1.8. Set replicate_socket_info parameter |
| 69 |
1.9. Set replicate_cflags parameter |
| 70 |
1.10. Set usrloc_delete parameter |
| 71 |
1.11. Set usrloc_delete_expired parameter |
| 72 |
|
| 73 |
Chapter 1. Admin Guide |
| 74 |
|
| 75 |
Table of Contents |
| 76 |
|
| 77 |
1. Overview |
| 78 |
2. Dependencies |
| 79 |
|
| 80 |
2.1. Kamailio Modules |
| 81 |
|
| 82 |
3. Parameters |
| 83 |
|
| 84 |
3.1. enable (int) |
| 85 |
3.2. sync (int) |
| 86 |
3.3. batch_size (int) |
| 87 |
3.4. batch_usleep (int) |
| 88 |
3.5. batch_msg_size (int) |
| 89 |
3.6. batch_msg_contacts (int) |
| 90 |
3.7. usrloc_domain (string) |
| 91 |
3.8. replicate_socket_info (int) |
| 92 |
3.9. replicate_cflags (int) |
| 93 |
3.10. usrloc_delete (int) |
| 94 |
3.11. usrloc_delete_expired (int) |
| 95 |
|
| 96 |
1. Overview |
| 97 |
|
| 98 |
The module adds user location (usrloc) records replication between |
| 99 |
multiple servers via DMQ module. |
| 100 |
|
| 101 |
2. Dependencies |
| 102 |
|
| 103 |
2.1. Kamailio Modules |
| 104 |
|
| 105 |
2.1. Kamailio Modules |
| 106 |
|
| 107 |
The following modules must be loaded before this module: |
| 108 |
* DMQ module.. |
| 109 |
* USRLOC module.. |
| 110 |
|
| 111 |
3. Parameters |
| 112 |
|
| 113 |
3.1. enable (int) |
| 114 |
3.2. sync (int) |
| 115 |
3.3. batch_size (int) |
| 116 |
3.4. batch_usleep (int) |
| 117 |
3.5. batch_msg_size (int) |
| 118 |
3.6. batch_msg_contacts (int) |
| 119 |
3.7. usrloc_domain (string) |
| 120 |
3.8. replicate_socket_info (int) |
| 121 |
3.9. replicate_cflags (int) |
| 122 |
3.10. usrloc_delete (int) |
| 123 |
3.11. usrloc_delete_expired (int) |
| 124 |
|
| 125 |
3.1. enable (int) |
| 126 |
|
| 127 |
The parameter controls whether the replication is active or not. The |
| 128 |
value can be: |
| 129 |
* 0 - replication is disabled |
| 130 |
* 1 - replication is enabled |
| 131 |
|
| 132 |
Default value is 0. |
| 133 |
|
| 134 |
Example 1.1. Set enable parameter |
| 135 |
... |
| 136 |
modparam("dmq_usrloc", "enable", 1) |
| 137 |
... |
| 138 |
|
| 139 |
3.2. sync (int) |
| 140 |
|
| 141 |
The parameter controls whether to request synchronization of all usrloc |
| 142 |
records at startup. The value can be: |
| 143 |
* 0 - disabled |
| 144 |
* 1 - enabled |
| 145 |
|
| 146 |
Default value is 1. |
| 147 |
|
| 148 |
Example 1.2. Set sync parameter |
| 149 |
... |
| 150 |
modparam("dmq_usrloc", "sync", 0) |
| 151 |
... |
| 152 |
|
| 153 |
3.3. batch_size (int) |
| 154 |
|
| 155 |
The parameter controls whether to throttle synchronization of all |
| 156 |
contacts in batches. Once a batch of SIP requests is sent out, then |
| 157 |
sleep for 'batch_usleep' microseconds. The value can be: |
| 158 |
* <=0 - disabled (no batching) |
| 159 |
* >0 - how many records to be sent in a batch |
| 160 |
|
| 161 |
Default value is 0. |
| 162 |
|
| 163 |
Example 1.3. Set batch_size parameter |
| 164 |
... |
| 165 |
modparam("dmq_usrloc", "batch_size", 4000) |
| 166 |
... |
| 167 |
|
| 168 |
3.4. batch_usleep (int) |
| 169 |
|
| 170 |
The parameter controls whether to throttle synchronization of all |
| 171 |
contacts in batches. Once a batch of SIP requests is sent out, then |
| 172 |
sleep for 'batch_usleep' microseconds. The value can be: |
| 173 |
* <=0 - no sleep (it disables the batching) |
| 174 |
* >0 - how many microseconds to sleep before sending out another |
| 175 |
batch of usrloc records. |
| 176 |
|
| 177 |
Default value is 0. |
| 178 |
|
| 179 |
Example 1.4. Set batch_usleep parameter |
| 180 |
... |
| 181 |
modparam("dmq_usrloc", "batch_usleep", 1000) |
| 182 |
... |
| 183 |
|
| 184 |
3.5. batch_msg_size (int) |
| 185 |
|
| 186 |
The parameter controls the size of the messages during a sync. This is |
| 187 |
to make sure the messages are never larger than 65536 (the maximum |
| 188 |
datagram size). |
| 189 |
|
| 190 |
Note that batch_msg_contacts will also be checked. |
| 191 |
|
| 192 |
Default value is 60000. Maximum value is 60000. |
| 193 |
|
| 194 |
Example 1.5. Set batch_msg_size parameter |
| 195 |
... |
| 196 |
modparam("dmq_usrloc", "batch_msg_contacts", 50) # 50 contacts / message |
| 197 |
modparam("dmq_usrloc", "batch_msg_size", 500000) |
| 198 |
# with this config, when doing a full sync, each message will be sent a soon as |
| 199 |
the body is larger 50K or contains 50 contacts |
| 200 |
... |
| 201 |
|
| 202 |
3.6. batch_msg_contacts (int) |
| 203 |
|
| 204 |
The parameter controls the amount of contact per message/transaction |
| 205 |
during a sync. |
| 206 |
|
| 207 |
Note that batch_msg_size will also be checked. |
| 208 |
|
| 209 |
Default value is 1. Maximum value is 150. |
| 210 |
|
| 211 |
Example 1.6. Set batch_msg_contacts parameter |
| 212 |
... |
| 213 |
modparam("dmq_usrloc", "batch_msg_contacts", 50) # 50 contacts / message |
| 214 |
modparam("dmq_usrloc", "batch_size", 10000) # 10000 contacts / batch |
| 215 |
modparam("dmq_usrloc", "batch_usleep", 500000) # one batch every 500ms |
| 216 |
# syncing 20K contacts/second with 50 contacts/message |
| 217 |
... |
| 218 |
|
| 219 |
3.7. usrloc_domain (string) |
| 220 |
|
| 221 |
The usrloc domain to synchronize. |
| 222 |
|
| 223 |
Default value is “location”. |
| 224 |
|
| 225 |
Example 1.7. Set usrloc_domain parameter |
| 226 |
... |
| 227 |
modparam("dmq_usrloc", "usrloc_domain", "my_domain") |
| 228 |
... |
| 229 |
|
| 230 |
3.8. replicate_socket_info (int) |
| 231 |
|
| 232 |
The parameter controls whether the socket replication is active or not. |
| 233 |
This is important for anycast scenarios. The value can be: |
| 234 |
* 0 - disabled |
| 235 |
* 1 - enabled, replicate socket by proto:host:port |
| 236 |
* 2 - enabled, replicate socket by socket name |
| 237 |
* 3 - enabled, use local socket from dmq server_socket modparam |
| 238 |
|
| 239 |
Default value is 0. |
| 240 |
|
| 241 |
Example 1.8. Set replicate_socket_info parameter |
| 242 |
... |
| 243 |
modparam("dmq_usrloc", "replicate_socket_info", 1) |
| 244 |
... |
| 245 |
|
| 246 |
3.9. replicate_cflags (int) |
| 247 |
|
| 248 |
The parameter controls whether the cflags replication is active or not. |
| 249 |
This is important for anycast scenarios. The value can be: |
| 250 |
* 0 - disabled |
| 251 |
* 1 - enabled, replicate cflags |
| 252 |
* > 1 - enabled, set cflags corresponding to this value, on |
| 253 |
replicated peers |
| 254 |
|
| 255 |
Default value is 1. |
| 256 |
|
| 257 |
Example 1.9. Set replicate_cflags parameter |
| 258 |
... |
| 259 |
modparam("dmq_usrloc", "replicate_cflags", 97) # will set cflags corresponding t |
| 260 |
o 1 + 32 + 64 |
| 261 |
... |
| 262 |
|
| 263 |
3.10. usrloc_delete (int) |
| 264 |
|
| 265 |
Enable (1) or disable (0) synchronizing usrloc delete actions. |
| 266 |
Disabling delete actions can be useful when user location data is |
| 267 |
ephemeral. |
| 268 |
|
| 269 |
Default value is 1. |
| 270 |
|
| 271 |
Example 1.10. Set usrloc_delete parameter |
| 272 |
... |
| 273 |
modparam("dmq_usrloc", "usrloc_delete", 0) |
| 274 |
... |
| 275 |
|
| 276 |
3.11. usrloc_delete_expired (int) |
| 277 |
|
| 278 |
Enable (1) or disable (0) synchronizing usrloc expire actions using |
| 279 |
delete actions. In other words, sync delete of (UL_CONTACT_EXPIRE) |
| 280 |
expired contacts. |
| 281 |
|
| 282 |
Default value is 0. |
| 283 |
|
| 284 |
Example 1.11. Set usrloc_delete_expired parameter |
| 285 |
... |
| 286 |
modparam("dmq_usrloc", "usrloc_delete_expired", 1) |
| 287 |
... |