Browse code

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

Kamailio Dev authored on 04/08/2017 13:16:23
Showing 1 changed files
... ...
@@ -33,6 +33,7 @@ Peter Dunkley
33 33
               4.6. sub_protocols (integer)
34 34
               4.7. cors_mode (integer)
35 35
               4.8. verbose_list (int)
36
+              4.9. event_callback (str)
36 37
 
37 38
         5. Functions
38 39
 
... ...
@@ -68,10 +69,11 @@ Peter Dunkley
68 69
    1.8. Set sub_protocols parameter
69 70
    1.9. Set cors_mode parameter
70 71
    1.10. Set verbose_list parameter
71
-   1.11. ws_handle_handshake usage
72
-   1.12. ws_close usage
73
-   1.13. event_route[websocket:closed] usage
74
-   1.14. $ws_conid usage
72
+   1.11. Set event_callback parameter
73
+   1.12. ws_handle_handshake usage
74
+   1.13. ws_close usage
75
+   1.14. event_route[websocket:closed] usage
76
+   1.15. $ws_conid usage
75 77
 
76 78
 Chapter 1. Admin Guide
77 79
 
... ...
@@ -99,6 +101,7 @@ Chapter 1. Admin Guide
99 101
         4.6. sub_protocols (integer)
100 102
         4.7. cors_mode (integer)
101 103
         4.8. verbose_list (int)
104
+        4.9. event_callback (str)
102 105
 
103 106
    5. Functions
104 107
 
... ...
@@ -341,6 +344,7 @@ onreply_route[WS_REPLY] {
341 344
    4.6. sub_protocols (integer)
342 345
    4.7. cors_mode (integer)
343 346
    4.8. verbose_list (int)
347
+   4.9. event_callback (str)
344 348
 
345 349
 4.1. keepalive_mechanism (integer)
346 350
 
... ...
@@ -457,6 +461,28 @@ modparam("websocket", "cors_mode", 2)
457 461
 modparam("websocket", "verbose_list", 1)
458 462
 ...
459 463
 
464
+4.9. event_callback (str)
465
+
466
+   The name of the function in the kemi configuration file (embedded
467
+   scripting language such as Lua, Python, ...) to be executed instead of
468
+   event_route[...] blocks specific for websocket module.
469
+
470
+   The function has one string parameter, the value is the name of the
471
+   event_route block, respectively "websocket:closed".
472
+
473
+   Default value is 'empty' (no function is executed for events).
474
+
475
+   Example 1.11. Set event_callback parameter
476
+...
477
+modparam("websocket", "event_callback", "ksr_websocket_event")
478
+...
479
+-- event callback function implemented in Lua
480
+function ksr_websocket_event(evname)
481
+        KSR.info("===== websocket module triggered event: " .. evname .. "\n");
482
+        return 1;
483
+end
484
+...
485
+
460 486
 5. Functions
461 487
 
462 488
    5.1. ws_handle_handshake()
... ...
@@ -476,7 +502,7 @@ Note
476 502
    This function returns 0, stopping all further processing of the
477 503
    request, when there is a problem.
478 504
 
479
-   Example 1.11. ws_handle_handshake usage
505
+   Example 1.12. ws_handle_handshake usage
480 506
 ...
481 507
 ws_handle_handshake();
482 508
 ...
... ...
@@ -501,7 +527,7 @@ Note
501 527
 
502 528
    This function can be used from ANY_ROUTE.
503 529
 
504
-   Example 1.12. ws_close usage
530
+   Example 1.13. ws_close usage
505 531
 ...
506 532
 ws_close(4000, "Because I say so");
507 533
 ...
... ...
@@ -615,7 +641,7 @@ kamcmd ws.enable
615 641
    connection closes. The connection may be identified using the the $si
616 642
    and $sp pseudo-variables.
617 643
 
618
-   Example 1.13. event_route[websocket:closed] usage
644
+   Example 1.14. event_route[websocket:closed] usage
619 645
 ...
620 646
 event_route[websocket:closed] {
621 647
         xlog("L_INFO", "WebSocket connection from $si:$sp has closed\n");
... ...
@@ -631,7 +657,7 @@ event_route[websocket:closed] {
631 657
    Connection id of closed websocket connection. Can only be used in
632 658
    websocket:closed event route.
633 659
 
634
-   Example 1.14. $ws_conid usage
660
+   Example 1.15. $ws_conid usage
635 661
 ...
636 662
 event_route[websocket:closed] {
637 663
         xlog("L_INFO", "WebSocket connection with id $ws_conid has closed\n");