Browse code

modules: readme files regenerated - registrar ... [skip ci]

Kamailio Dev authored on 20/05/2022 11:31:17
Showing 1 changed files
... ...
@@ -96,6 +96,7 @@ Bogdan-Andre Iancu
96 96
               4.9. reg_fetch_contacts(domain, uri, profile)
97 97
               4.10. reg_free_contacts(profile)
98 98
               4.11. reg_send_reply()
99
+              4.12. reg_from_user(ultable, uri, mode)
99 100
 
100 101
         5. Event Routes
101 102
 
... ...
@@ -162,8 +163,9 @@ Bogdan-Andre Iancu
162 163
    1.43. reg_fetch_contacts usage
163 164
    1.44. reg_free_contacts usage
164 165
    1.45. reg_send_reply usage
165
-   1.46. event_route[usrloc:contact-expired] usage
166
-   1.47. $ulc(name) usage
166
+   1.46. reg_from_user usage
167
+   1.47. event_route[usrloc:contact-expired] usage
168
+   1.48. $ulc(name) usage
167 169
 
168 170
 Chapter 1. Admin Guide
169 171
 
... ...
@@ -230,6 +232,7 @@ Chapter 1. Admin Guide
230 232
         4.9. reg_fetch_contacts(domain, uri, profile)
231 233
         4.10. reg_free_contacts(profile)
232 234
         4.11. reg_send_reply()
235
+        4.12. reg_from_user(ultable, uri, mode)
233 236
 
234 237
    5. Event Routes
235 238
 
... ...
@@ -991,6 +994,7 @@ kamcmd cfg.set_now_int registrar use_expired_contacts 0
991 994
    4.9. reg_fetch_contacts(domain, uri, profile)
992 995
    4.10. reg_free_contacts(profile)
993 996
    4.11. reg_send_reply()
997
+   4.12. reg_from_user(ultable, uri, mode)
994 998
 
995 999
 4.1.  save(domain, [, flags [, uri]])
996 1000
 
... ...
@@ -1293,6 +1297,30 @@ save("location", "0x2");
1293 1297
 reg_send_reply();
1294 1298
 ...
1295 1299
 
1300
+4.12.  reg_from_user(ultable, uri, mode)
1301
+
1302
+   The function returns true if the SIP message comes from the user
1303
+   identified by 'uri' parameter by matching the associated location
1304
+   records. The matching is done with the field 'received' if it is set,
1305
+   otherwise with the contact address.
1306
+
1307
+   Meaning of the parameters is as follows:
1308
+     * ultable - user location table (e.g., 'location')
1309
+     * uri - SIP URI to identify the location records to match against.
1310
+     * mode - matching mode (int) - host part (IP address) is matched
1311
+       always. If mode has bit 1 set (value 1), then the port is matched
1312
+       as well. If mode has bit 2 set (value 2), then the protocol is
1313
+       matched as well.
1314
+
1315
+   This function can be used from ANY_ROUTE.
1316
+
1317
+   Example 1.46. reg_from_user usage
1318
+...
1319
+if(reg_from_user("location", "sip:alice@server.com", "0")) {
1320
+    # message coming from where 'alice' sent before a REGISTER request
1321
+}
1322
+...
1323
+
1296 1324
 5. Event Routes
1297 1325
 
1298 1326
    5.1. event_route[usrloc:contact-expired]
... ...
@@ -1302,7 +1330,7 @@ reg_send_reply();
1302 1330
    Executed when a contact in location table has expired. The variable
1303 1331
    $ulc(exp=>...) is filled with the attributes of the expired contact.
1304 1332
 
1305
-   Example 1.46. event_route[usrloc:contact-expired] usage
1333
+   Example 1.47. event_route[usrloc:contact-expired] usage
1306 1334
 ...
1307 1335
 event_route[usrloc:contact-expired] {
1308 1336
     xlog("expired contact for $ulc(exp=>aor)\n");
... ...
@@ -1376,7 +1404,7 @@ event_route[usrloc:contact-expired] {
1376 1404
    The pseudo-variable accepts positive index value to access a specific
1377 1405
    contact record.
1378 1406
 
1379
-   Example 1.47. $ulc(name) usage
1407
+   Example 1.48. $ulc(name) usage
1380 1408
 ...
1381 1409
 if(reg_fetch_contacts("location", "$fu", "caller"))
1382 1410
 {