Module: kamailio Branch: 5.6 Commit: 09e9fa84bc550411c1840e5af325407ba4e25a7c URL: https://github.com/kamailio/kamailio/commit/09e9fa84bc550411c1840e5af325407b...
Author: Kamailio Dev kamailio.dev@kamailio.org Committer: Kamailio Dev kamailio.dev@kamailio.org Date: 2022-07-04T11:01:46+02:00
modules: readme files regenerated - modules ... [skip ci]
---
Modified: src/modules/nats/README
---
Diff: https://github.com/kamailio/kamailio/commit/09e9fa84bc550411c1840e5af325407b... Patch: https://github.com/kamailio/kamailio/commit/09e9fa84bc550411c1840e5af325407b...
---
diff --git a/src/modules/nats/README b/src/modules/nats/README index f7f1ad7239..29cef171b7 100644 --- a/src/modules/nats/README +++ b/src/modules/nats/README @@ -35,6 +35,7 @@ Emmanuel Schmidbauer 4.1. nats_url (str) 4.2. num_publish_workers (int) 4.3. subject_queue_group (str) + 4.4. event_callback (str)
5. Functions
@@ -48,9 +49,10 @@ Emmanuel Schmidbauer 1.1. Set nats_url parameter 1.2. Set num_publish_workers parameter 1.3. Set subject_queue_group parameter - 1.4. nats_publish usage - 1.5. Example usage of $natsData pseudo variable - 1.6. Define the event routes + 1.4. Set event_callback parameter + 1.5. nats_publish usage + 1.6. Example usage of $natsData pseudo variable + 1.7. Define the event routes
Chapter 1. Admin Guide
@@ -68,6 +70,7 @@ Chapter 1. Admin Guide 4.1. nats_url (str) 4.2. num_publish_workers (int) 4.3. subject_queue_group (str) + 4.4. event_callback (str)
5. Functions
@@ -115,6 +118,7 @@ Chapter 1. Admin Guide 4.1. nats_url (str) 4.2. num_publish_workers (int) 4.3. subject_queue_group (str) + 4.4. event_callback (str)
4.1. nats_url (str)
@@ -161,6 +165,24 @@ modparam("nats", "subject_queue_group", "MyQueue1:2021") modparam("nats", "subject_queue_group", "MyQueue2:2021") ...
+4.4. event_callback (str) + + Name of the KEMI function to be executed instead of the event route. + + Default value is not set. + + Example 1.4. Set event_callback parameter +... +modparam("nats", "event_callback", "ksr_nats_event") + +-- event callback function implemented in Lua +function ksr_nats_event(evname) + KSR.info("===== nats module received event: " .. evname .. + ", data:" .. KSR.pv.gete('$natsData') .. "\n"); + return 1; +end +... + 5. Functions
5.1. nats_publish(subject, payload) @@ -169,7 +191,7 @@ modparam("nats", "subject_queue_group", "MyQueue2:2021")
Publishes the payload to subject.
- Example 1.4. nats_publish usage + Example 1.5. nats_publish usage ... $var(my_info) = "$ci=" + $ci + " $fU=" + $fU; nats_publish("mysubject", "$var(my_info)"); # publish $var(my_info) to "mysubjec @@ -178,7 +200,7 @@ t"
6. Pseudo Variables
- Example 1.5. Example usage of $natsData pseudo variable + Example 1.6. Example usage of $natsData pseudo variable ... xlog("L_INFO", "received payload $natsData"); } @@ -191,7 +213,7 @@ t" received payload. The name of the event-route name must match the subject of the message.
- Example 1.6. Define the event routes + Example 1.7. Define the event routes ... modparam("nats", "subject_queue_group", "Kamailio-World:2021") modparam("nats", "subject_queue_group", "MyQueue1:2021")